Re: invalidate_inode_pages in 2.5.32/3

Andrew Morton
2002-09-05T18:25:33Z

Chuck Lever wrote:
>
> hi all-
>
> it appears that changes in or around invalidate_inode_pages that went into
> 2.5.32/3 have broken certain cache behaviors that the NFS client depends
> on. when the NFS client calls invalidate_inode_pages to purge directory
> data from the page cache, sometimes it works as before, and sometimes it
> doesn't, leaving stale pages in the page cache.
>
> i don't know much about the MM, but i can reliably reproduce the problem.
> what more information can i provide? please copy me, as i'm not a member
> of the linux-kernel mailing list.

The locking became finer-grained.

Up to 2.5.31 or thereabouts, invalidate_inode_pages was grabbing
the global pagemap_lru_lock and walking all the inodes pages inside
that lock. This basically shuts down the entire VM for the whole
operation.

In 2.5.33, that lock is per-zone, and invalidate takes it on a
much more fine-grained basis.

That all assumes SMP/preempt. If you're seeing these problems on
uniproc/non-preempt then something fishy may be happening.

But be aware that invalidate_inode_pages has always been best-effort.
If someone is reading, or writing one of those pages then it
certainly will not be removed. If you need assurances that the
pagecache has been taken down then we'll need something stronger
in there.