Re: [ck] Re: Faster resuming of suspend technology.

Nigel Cunningham
2006-03-13T01:46:25Z

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

Hi.

On Monday 13 March 2006 08:30, Con Kolivas wrote:
> On Monday 13 March 2006 08:32, Andreas Mohr wrote:
> > And... well... this sounds to me exactly like a prime task
> > for the newish swap prefetch work, no need for any other
> > special solutions here, I think.
> > We probably want a new flag for swap prefetch to let it know
> > that we just resumed from software suspend and thus need
> > prefetching to happen *much* faster than under normal
> > conditions for a short while, though (most likely by
> > enabling prefetching on a *non-idle* system for a minute).
>
> Adding a resume_swap_prefetch() called just before the resume finishes that
> aggressively prefetches from swap would be easy. Please tell me if you
> think adding such a function would be worthwhile.

My 2c would be that swsusp is broken in a number of ways in discarding those
pages in the first place:

- Forcing pages out to swap by vm pressure is an inefficient way of writing
the pages.
- It doesn't get the pages compressed, and so makes inefficient use of the
storage and forces more pages to be discarded that would otherwise be
necessary.
- Bringing the pages back in by swap prefetching or swapoffing or whatever is
equally inefficient (I was going to say 'particularly in low memory
situations', but immediately ate my words as I remembered that if you've just
swsusp'd, you've freed at least half of memory anyway).
- This technique doesn't guarantee that the pages you end up with in memory
are the pages that you're actually most likely to want. The vast majority of
what you really want will simply have been discarded rather than swapped.

Having said that, Rafael is making some progress in these areas, such that
swsusp is eating less memory than it used to, so that swap prefetching will
be less important at resume time than it has been in the past.

Hope this helps.

Nigel

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]