Re: [patch, feature] nonlinear mappings, prefaulting support, 2.5.42-F8

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Oct 15 2002 - 01:48:41 EST


On Tue, 15 Oct 2002, Jamie Lokier wrote:
>
> I like the SIGBUS. Am I correct to assume that, when there is memory
> pressure, some pages are evicted from memory and all accesses to those
> pages from userspace will raise SIBUS until the mapping is
> reastablished? Am I correct to assume this works fine on /dev/shm files?

It should work fine, assuming the shm interface has a "populate" macro.

The only real problem I think the interface has is that the nonlinear
mappings cannot have private pages in them - because while the MM would be
happy to swap them out, there is no sane way to get them back.

The private page information actually does exist in the page tables, but
the _protection_ does not. That's in the VMA, and since one of the whole
points with the nonlinear mapping is that the VMA is "anonymous", we're
kind of screwed.

As it is, you cannot really even add private pages to the linear mapping:
all the page add interfaces are for shared pages only. But I could imagine
that it could be useful to have a "add private page here".

(The "add private page here" interface might also have a "use previous
page if one existed" method, in which case the SIGBUS handler could just
use that one, and thus generate the protection information on the fly -
while generating the actual swap-in data from the page table entry itself)

Ingo - what do you think? I suspect a anonymous ("swap-backed" as opposed
to "backed by this file") interface might be quite useful.

                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/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:54 EST