Messages in this thread | | | Date | Thu, 20 Apr 2006 12:52:09 +0200 | From | Jens Axboe <> | Subject | Re: [PATCH] Remove softlockup from invalidate_mapping_pages. |
| |
On Thu, Apr 20 2006, Andrew Morton wrote: > > Does Jens know that? > > __generic_file_splice_read seems to violate this principle! > > It looks OK from a quick read (but the code duplication is saddening)
Yes, it saddens me too. There really are a bunch of cases to check for on each page that is shared with do_generic_mapping_read(), I'll see if I can do something about that.
> > So when I have a cleared head and a bit more time I'll see if I can > > come up with a better patch which only looks at ->index under > > ->tree_lock. > > tree_lock will stabilise ->index, yes. > > But I think we'd be OK assuming that ->index is stable. Although that may > break if splice() is concurrently pulling the page out of pagecache and > stuffing it into a pipe.
Putting the page in the pipe is a simple reference operations. However, we can migrate a page from a pipe into the page cache in another address space. If we do that, we will lock the page first though. And the actual ->index change is inside the tree_lock, outside of splice itself.
So with splice migrating pages, ->index and ->mapping can and will change but only with the page locked.
-- Jens Axboe
- 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/
| |