Re: Can prune_icache safely discard inodes which have only clean pages? (2.4.18)

From: Andrew Morton (akpm@digeo.com)
Date: Fri Sep 13 2002 - 14:57:36 EST


Bill Davenport wrote:
>
> I've got a system which has a fairly large amount of physical memory (2GB)
> that experiences
> performance problems after a large number of files have been accessed.
>
> ...

Your analysis is 100% correct. It's a problem.

There's a fix for this in Andrea's kernel.
 
> ...
>
> and I'd like to change it to:
>
> void prune_icache(int goal)
> {
> ...
> while (entry != &inode_unused)
> {
> ...
> if (inode->i_state & (I_FREEING|I_CLEAR|I_LOCK))
> continue;
> if ((inode->i_state != 0) || inode_has_buffers(inode))
> continue;
> if (inode->i_data.nrpages != 0) {
> if ((!list_empty(&inode->i_data.dirty_pages)) ||
> (!list_empty(&inode->i_data.locked_pages))) {
> /* skip if any dirty or locked pages */
> continue;
> }
> }

locked_pages tends to hold clean, unlocked pages, alas. Testing
->dirty_pages makes sense.

If there are no dirty pages then you can run invalidate_inode_pages();
chances are, that will bring ->nrpages to zero, and all is well.
-
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/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:35 EST