Re: [PATCH] splice SPLICE_F_MOVE support

From: Jens Axboe
Date: Fri Mar 31 2006 - 14:50:27 EST


On Fri, Mar 31 2006, Nick Piggin wrote:
> Jens Axboe wrote:
> >Hi,
> >
> >This applies on top of the splice #3 just posted, adding support for
> >moving of pages. The caller can use the SPLICE_F_MOVE flag to the splice
> >syscall to ask the kernel to try and move pages, if needed.
> >
> >Disclaimer: this works for me, but may have vm issues that I missed.
> >CC'ing Nick :-)
> >
>
> Like Andrew said, you can't check PageLRU without holding zone->lru_lock.
> The page release code can get away with it only because the page refcount
> is 0 at that point. Also, you can't reliably remove pages from the LRU
> unless the refcount is 0. Ever.
>
> The following (untested) is something like what I had in mind, and should
> get stealing closer to working. I've only given it a quick review so far
> (btw. why do you only unlock the page if it hasn't been stolen?)

The current branch does not :)

> With this patch, the ->steal will indicate if the page had been on the
> LRU or not. If not, then add it; if yes, then do nothing.
>
> There is no caller of ->steal yet that wants the page off the LRU (is
> there?). That's a bit harder.

Thanks Nick, but would you care to rebase it off the 'splice' branch?
There's already some changes in this area (notably, getting rid of
->stolen).

git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git splice

--
Jens Axboe

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