Re: [patch] inotify.

From: Robert Love
Date: Thu Jun 16 2005 - 20:36:38 EST

On Fri, 2005-06-17 at 11:30 +1000, Nick Piggin wrote:

> What we could do is just check list_empty(&inode->inotify_watchers)
> and remove the atomic count completely.
> We don't actually care about getting an exact count at all, just
> whether or not it is empty, and in that case using list_empty is
> no more racy than checking an atomic count, both are done outside
> any locks.
> It is basically just a lock avoidance heuristic. But I think count
> is superfluous - off with its head!

Yah. This is what I originally did. Because of the current
implementation of list_empty(), the race is never dangerous (e.g., no
segfault), we just get false positives/negatives, but that is no
different than the atomic check, really, since we can race in the
interim and then we go on and check the list anyhow.

So, let's do it. I'll cook up a patch and updated inotify tomorrow, if
no one beats me to the punch.

Robert Love

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at