Re: [RFC, PATCHv2 0/2] mm: map few pages around fault address if they are in page cache

Linus Torvalds
2014-02-17T20:24:10Z

On Mon, Feb 17, 2014 at 11:49 AM, Kirill A. Shutemov
<kirill@shutemov.name> wrote:
>
> But it could be safer to keep locking in place and reduce lookup cost by
> exposing something like ->fault_iter_init() and ->fault_iter_next(). It
> will still return one page a time, but it will keep radix-tree context
> around for cheaper next-page lookup.

I really would prefer for the loop to be much smaller than that, and
not contain indirect calls to helpers that pretty much guarantee that
you can't generate nice code.

Plus I'd rather not have the mm layer know too much about the radix
tree iterations anyway, and try to use the existing page array
functions we already have (ie "find_get_pages()").

So I'd really prefer if we can do this with tight loops over explicit
pages, rather than some loop over an iterator.

Linus