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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]