mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* (no subject)
@ 2009-02-06  1:41 hannes
  2009-02-06 23:39 ` [PATCH 0/3] swsusp: shrink file cache first Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: hannes @ 2009-02-06  1:41 UTC (permalink / raw)


>From hannes@cmpxchg.org Fri Feb  6 02:28:54 2009
Message-Id: <20090206012605.378214179@cmpxchg.org>
User-Agent: quilt/0.47-1
Date: Fri, 06 Feb 2009 02:26:05 +0100
From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
 Rik van Riel <riel@redhat.com>,
 linux-kernel@vger.kernel.org,
 linux-mm@kvack.org
Subject: [PATCH 0/3] swsusp: shrink file cache first

Hello!

here are three patches that adjust the memory shrinking code used for
suspend-to-disk.

The first two patches are cleanups only and can probably go in
regardless of the third one.

The third patch changes the shrink_all_memory() logic to drop the file
cache first before touching any mapped files and only then goes for
anon pages.

The reason is that everything not shrunk before suspension has to go
into the image and will be 'prefaulted' before the processes can
resume and the system is usable again, so the image should be small
and contain only pages that are likely to be used right after resume
again.  And this in turn means that the inactive file cache is the
best point to start decimating used memory.

Also, right now, subsequent faults of contiguously mapped files are
likely to perform better than swapin (see
http://kernelnewbies.org/KernelProjects/SwapoutClustering), so not
only file cache is preferred over other pages, but file pages over
anon pages in general.

Testing up to this point shows that the patch does what is intended,
shrinking file cache in favor of anon pages.  But whether the idea is
correct to begin with is a bit hard to quantify and I am still working
on it, so RFC only.

	Hannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0/3] swsusp: shrink file cache first
  2009-02-06  1:41 hannes
@ 2009-02-06 23:39 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2009-02-06 23:39 UTC (permalink / raw)
  To: hannes; +Cc: Andrew Morton, Rik van Riel, linux-kernel, linux-mm

> Hello!

Hi Hannes,
 
> here are three patches that adjust the memory shrinking code used for
> suspend-to-disk.
> 
> The first two patches are cleanups only and can probably go in
> regardless of the third one.
> 
> The third patch changes the shrink_all_memory() logic to drop the file
> cache first before touching any mapped files and only then goes for
> anon pages.
> 
> The reason is that everything not shrunk before suspension has to go
> into the image and will be 'prefaulted' before the processes can
> resume and the system is usable again, so the image should be small
> and contain only pages that are likely to be used right after resume
> again.  And this in turn means that the inactive file cache is the
> best point to start decimating used memory.
> 
> Also, right now, subsequent faults of contiguously mapped files are
> likely to perform better than swapin (see
> http://kernelnewbies.org/KernelProjects/SwapoutClustering), so not
> only file cache is preferred over other pages, but file pages over
> anon pages in general.
> 
> Testing up to this point shows that the patch does what is intended,
> shrinking file cache in favor of anon pages.  But whether the idea is
> correct to begin with is a bit hard to quantify and I am still working
> on it, so RFC only.

Thanks a lot for the patches, I'll review them as soon as I can.

I've got them with broken headers, but that's not a big deal.

Best,
Rafael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-06 23:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-06  1:41 hannes
2009-02-06 23:39 ` [PATCH 0/3] swsusp: shrink file cache first Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®