Re: [PATCH] remove_inode_page rewrite.

From: Steve Dodd (steved@loth.demon.co.uk)
Date: Wed May 10 2000 - 05:10:36 EST


On Tue, May 09, 2000 at 09:14:08PM +0100, Dave Jones wrote:

> I believe that while after CPU0 drops the pagecache_lock, and starts
> removing one page, CPU1 fails to lock the same page (as CPU0 grabbed it
> with the trylock) and moves to the next page in the list, succeeds,
> removes it, and then rescans from the top.
>
> With the current locking I believe it's then possible for CPU1 to
> lock that page

Which page? CPU1 should never find the page CPU0 is freeing because it will
either be locked, or not on the list at all. By the time CPU0 unlocks the
page, it's removed it from the list (and it grabs the spinlock while messing
with the list structure).

> (again in the TryLockPage(page) call) just before CPU0
> calls page_cache_release(page)
>
> This patch probably kills us latency-wise, but looks a lot more
> sane in my eyes.

Now that invalidate_inode_page isn't calling sync_page, there seems to be
no reason to drop and retake the spinlock, I agree.

[..]
> - repeat:
> - head = &inode->i_mapping->pages;
> spin_lock(&pagecache_lock);
> +
> + head = &inode->i_mapping->pages;

That shouldn't be necessary - nobody is likely to change the address of
inode->i_mapping->pages under us :)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:15 EST