Messages in this thread | | | Date | Thu, 30 Mar 2006 00:27:26 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH][RFC] splice support |
| |
Jens Axboe <axboe@suse.de> wrote: > > > find_get_pages() does "find me the next N pages above `index' which are > > presently in pagecache'. So it can return an array of page*'s which do not > > represent contiguous pages in the file - there can be holes in there. > > > > IOW: pages[n]->index !necessarily= pages[n+1]->index-1 > > > > Maybe the code handles that by making sure that all the pages in the range > > are already in pagecache - I didn't check. But that would take some heroic > > locking. > > It doesn't, I'm assuming that find_get_pages() returns consequtive pages > atm. Would seem like the sane interface :-)
Yeah, sorry. It's a "gather what's presently there" thing. For writeback.
Nick has some gang-lookup-slots code. So instead of populating an array of page*'s you can populate an array of (effectively) page**'s. Then one could walk that. All while holding ->tree_lock. This doesn't help ;)
Or you could walk the pages[] array until you hit an ->index which doesn't match and then toss the rest away. That's a bit of extra work, but in the common case all the pages will be good. Perhaps.
> We continue doing find_or_create_page() on the remaining, but using 'i' > as the 'index' addition. So if we had non-conseq pages, we'd be screwed.
Yup.
Probably the simplest for now is an open-coded find_get_page() loop. Later on we should optimise that into a find_get_contig_pages() which only takes tree_lock a single time.
Doing it with a new radix_tree_gang_lookup_contig_name_me_longer() would be relatively straightforward too. It would bale out as soon as it hit a not-present slot.
- 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/
| |