Re: [patch 6/12] hold atomic kmaps across generic_file_read

Linus Torvalds (torvalds@transmeta.com)
Sun, 11 Aug 2002 12:00:09 -0700 (PDT)


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.

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.

See? You actually _do_ have choices on what to do.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/