Re: [PATCH -mm] swsusp: support creating bigger images (rev. 2)
From: Con Kolivas
Date: Mon May 15 2006 - 19:50:35 EST
On Tuesday 16 May 2006 05:52, Rafael J. Wysocki wrote:
> On Monday 15 May 2006 11:48, Con Kolivas wrote:
> > On Sunday 14 May 2006 08:33, Rafael J. Wysocki wrote:
> > > On Friday 12 May 2006 12:30, Pavel Machek wrote:
> > > > > Please also remember that you are introducing complexity in other
> > > > > ways, with that swap prefetching code and so on. Any comparison in
> > > > > speed should include the time to fault back in pages that have been
> > > > > discarded.
> > > >
> > > > Well, swap prefetching is useful for other workloads, too; so it gets
> > > > developed/tested outside swsusp.
> > >
> > > Still my experience indicates that it doesn't play very nice with
> > > swsusp and unfortunately it hogs the I/O.
> > There is no swap prefetching code linked in any way to swsusp suspend or
> > resume on mainline or -mm. It was a preliminary experiment and Rafael
> > lost interest in it so I never bothered pursuing it.
> I'm referring to the code currently in -mm, where kprefetchd sometimes
> starts prefetching like mad after resume which hurts the disk I/O really
> badly (unless I set /proc/sys/vm/swap_prefetch to 0, that is).
Not my experience. It does lots of disk I/O after resume because as you say
yourself there is heaps in swap, but I haven't seen that I/O hurt as it
simply stops the instant I do anything with the machine even as trivial as
moving the mouse.
> I think the problem is related to the fact that swsusp tends to leave quite
> a lot of pages in the swap, if they had to be swapped out before suspend,
> and that makes kprefetchd believe it should get these pages back into RAM,
> which usually is not the greatest idea.
> The above is only a speculation, however, and I'd have to investigate it a
> bit more to say something more certain. Anyway, my experience indicates
> that it usually is better to set /proc/sys/vm/swap_prefetch to 0 after
> resume, but YMMV.
My mileage definitely varies here. I don't concentrate on examining the fact
that the machine is doing any I/O, but how usable the machine is and it's my
experience that it is much better as about 1/3 of my applications are not
floundering entirely on swap. Fortunately there's a tunable there and it
allows you to set and unset it how you see fit.
Anyway the original point of my response was to point out to Nigel that there
is no added complexity on behalf of swsusp in the swap prefetch code.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/