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

William Lee Irwin III
2002-10-14T13:52:32Z

On Mon, Oct 14, 2002 at 02:38:43PM +0200, Ingo Molnar wrote:
> the patch has got an initial review from Linus, Andrew Morton and Hugh
> Dickins, and most of their suggestions are part of the patch already.

hmm

On Mon, Oct 14, 2002 at 02:38:43PM +0200, Ingo Molnar wrote:
> +int sys_remap_file_pages(unsigned long start, unsigned long size,
> + unsigned long prot, unsigned long pgoff, unsigned long flags)

ISTR suggesting vectorizing this to reduce syscall traffic.

The semantics of faulting in pages on such a region, while not
incorrect, are at least unusual enough to raise the question of
whether it's appropriate for the kernel to fill the pages as opposed
to returning an error to userspace. The requirement of MAP_LOCKED
or PROT_NONE might as well be in-kernel if the file offset contiguity
assumption is not met, since there's no reliable way for userspace to
use the syscall otherwise. sys_remap_file_pages() also interacts in
an unusual way with the semantics of MAP_POPULATE. MAP_POPULATE seems
to perform a non-blocking make_pages_present() operation not shared
with MAP_LOCKED, and filemap_populate() performs the file offset
contiguous prefaulting which again doesn't mix well with the scatter
gather semantics desired. These are the file offset contiguity
assumptions I mentioned.

Also, a stranger phenomenon appears in filemap_populate(), where
nonblock may be true, and so filemap_getpage() will return NULL,
but -ENOMEM is returned if filemap_getpage() returns NULL.

Also, I see a significant portion of filemap_nopage() duplicated in
filemap_getpage(), including long-stale hashtable-related comments.

Bill