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?) 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. ---