Messages in this thread | | | Subject | Re: [patch] inotify. | From | Robert Love <> | Date | Thu, 16 Jun 2005 21:35:09 -0400 |
| |
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |