lkml.org 
[lkml]   [2005]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] inotify.
From
Date
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/

\
 
 \ /
  Last update: 2005-06-17 03:38    [W:1.324 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site