Re: invalidate_inode_pages in 2.5.32/3

Andrew Morton
2002-09-07T22:50:27Z

Rik van Riel wrote:
>
> On Sat, 7 Sep 2002, Daniel Phillips wrote:
> > On Friday 06 September 2002 00:19, Andrew Morton wrote:
> > > I'm not sure what semantics we really want for this. If we were to
> > > "invalidate" a mapped page then it would become anonymous, which
> > > makes some sense.
> >
> > There's no need to leave the page mapped, you can easily walk the rmap list
> > and remove the references.
>
> A pagefaulting task can have claimed a reference to the page
> and only be waiting on the lock we're currently holding.

Yup. In which case it comes away with an anonymous page.

I'm very unkeen about using the inaccurate invalidate_inode_pages
for anything which matters, really. And the consistency of pagecache
data matters.

NFS should be using something stronger. And that's basically
vmtruncate() without the i_size manipulation. Hold i_sem,
vmtruncate_list() for assured pagetable takedown, proper page
locking to take the pages out of pagecache, etc.

Sure, we could replace the page_count() heuristic with a
page->pte.direct heuristic. Which would work just as well. Or
better. Or worse. Who knows?

Guys, can we sort out the NFS locking so that it is possible to
take the correct locks to get the 100% behaviour?