Re: [rfc][patch] remove racy sync_page?

From: Hugh Dickins
Date: Wed May 31 2006 - 10:29:58 EST


On Wed, 31 May 2006, Hugh Dickins wrote:
>
> Yes, I had noticed yours is a different issue. I'm saying that if we
> can "fix" set_page_dirty_nolock not to sleep, then your issue is fixed
> (as least as it affects set_page_dirty_lock, which is all your patch
> is dealing with, and we hope all it needs to deal with). Because your
> issue is with the sync_page in the lock_page of set_page_dirty_nolock,
> and it's that particular lock_page which I'm trying to be rid of.
>
> I now think it can be done: in cases where TestSetPageLocked finds
> the page already locked, then I believe we can fall back to inode_lock
> to stabilize. But I do need to consider the possibilities some more.

No, I'm wrong, and have been all along in thinking set_page_dirty_lock
could be done better avoiding the lock_page. inode_lock gives the hint:
it's not irq safe, nor is mapping->private_lock, and both may be taken
by set_page_dirty. The lock_page in set_page_dirty_lock was the obvious
reason it couldn't be used at interrupt time, but not the only reason.

So your lock_page_nosync does look the best way forward to me now.

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