Re: [patch] inotify.

Robert Love
2005-06-17T01:35:17Z

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