From: Daniel Phillips <phillips@arcor.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Jamie Lokier <lk@tantalophile.demon.co.uk>,
Andrew Morton <akpm@zip.com.au>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch 6/12] hold atomic kmaps across generic_file_read
Date: Sun, 11 Aug 2002 21:43:21 +0200 [thread overview]
Message-ID: <E17dycT-0001hv-00@starship> (raw)
In-Reply-To: <Pine.LNX.4.44.0208111155460.9930-100000@home.transmeta.com>
On Sunday 11 August 2002 21:00, Linus Torvalds wrote:
> On Sun, 11 Aug 2002, Daniel Phillips wrote:
>
> > On Sunday 11 August 2002 00:42, Linus Torvalds wrote:
> > > For example, what do you do when somebody has a COW-page mapped into it's
> > > VM space and you want to start paging stuff out?
> >
> > Clearly it requires a CoW break and swapping out that page won't free any
> > memory directly, but it will in turn allow the cache page to be dropped.
>
> Well, that's the point. Is it really "clearly"?
>
> One alternative is to just instead remove it from the page cache, and add
> it to the swap cache directly (and unmapping it). In fact, I _think_ that
> is the right thing to do (yes, it only works if the page count is 2 (one
> for page cache, one for the VM mapping), but that's very different from
> breaking the COW and generating two separate pages.
Far clearer ;-)
With reverse mapping it works for any page count.
> The "move directly to swap cache" is nice in that it doesn't add any new
> pages. But it's nasty in that it steals pages from the file cache, so that
> it basically turns a potentially sharable cache into a private cache that
> nobody else will see.
But you got it right the first time: we're evicting the page because it's
inactive and we want the memory for something else. We don't need to give
that page more second chances, it already had its share of chances before
it got this far in the eviction process. If the file page gets reloaded
before the swap-out completes it just means we chose the victim poorly
in the first place, or we're unlucky. The latter is supposed to be the
exception, not the rule.
> See? You actually _do_ have choices on what to do.
Yes, in this case, the correct thing and the dumb thing.
--
Daniel
next prev parent reply other threads:[~2002-08-11 19:38 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 0:57 [patch 6/12] hold atomic kmaps across generic_file_read Andrew Morton
2002-08-10 1:33 ` Linus Torvalds
2002-08-10 3:53 ` Andrew Morton
2002-08-10 3:53 ` Linus Torvalds
2002-08-10 6:12 ` Andrew Morton
2002-08-10 7:25 ` Linus Torvalds
2002-08-10 9:08 ` Andrew Morton
2002-08-10 12:44 ` Daniel Phillips
2002-08-10 17:01 ` Linus Torvalds
2002-08-10 18:16 ` Daniel Phillips
2002-08-10 18:32 ` Linus Torvalds
2002-08-10 18:46 ` Daniel Phillips
2002-08-10 14:16 ` Rik van Riel
2002-08-10 17:03 ` Linus Torvalds
2002-08-10 17:36 ` Jamie Lokier
2002-08-10 17:46 ` Linus Torvalds
2002-08-10 17:55 ` Jamie Lokier
2002-08-10 18:42 ` Linus Torvalds
2002-08-10 18:52 ` Jeff Garzik
2002-08-10 19:01 ` Christoph Hellwig
2002-08-10 19:04 ` Jeff Garzik
2002-08-12 15:20 ` Ingo Oeser
2002-08-12 0:18 ` Albert D. Cahalan
2002-08-12 14:11 ` Jeff Garzik
2002-08-12 14:46 ` David Woodhouse
2002-08-10 19:10 ` Jamie Lokier
2002-08-10 22:42 ` Linus Torvalds
2002-08-11 3:17 ` Simon Kirby
2002-08-11 6:07 ` Andrew Morton
2002-08-11 8:46 ` Simon Kirby
2002-08-11 9:36 ` Andrew Morton
2002-08-11 9:49 ` Andrew Morton
2002-08-11 10:28 ` Andrew Morton
2002-08-11 18:52 ` Linus Torvalds
2002-08-12 3:28 ` Andrew Morton
2002-08-12 3:27 ` Linus Torvalds
2002-08-12 4:08 ` Andrew Morton
2002-08-12 6:20 ` Simon Kirby
2002-08-12 6:44 ` Andrew Morton
2002-08-12 19:43 ` Trond Myklebust
2002-08-12 20:43 ` Andrew Morton
2002-08-11 8:00 ` Daniel Phillips
2002-08-11 19:00 ` Linus Torvalds
2002-08-11 19:43 ` Daniel Phillips [this message]
2002-08-11 0:34 ` Andrew Morton
2002-08-11 0:56 ` Linus Torvalds
2002-08-11 1:27 ` Andrew Morton
2002-08-12 7:45 ` Rusty Russell
2002-08-12 9:45 ` Daniel Phillips
2002-08-12 20:29 ` Linus Torvalds
2002-08-12 21:21 ` Daniel Phillips
2002-08-12 17:30 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E17dycT-0001hv-00@starship \
--to=phillips@arcor.de \
--cc=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox