From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Robert Love <rml@novell.com>
Cc: Zach Brown <zab@zabbo.net>,
linux-kernel@vger.kernel.org,
Al Viro <viro@parcelfarce.linux.theplanet.co.uk>,
John McCutchan <ttb@tentacle.dhs.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [patch] inotify.
Date: Fri, 17 Jun 2005 11:30:29 +1000 [thread overview]
Message-ID: <42B227B5.3090509@yahoo.com.au> (raw)
In-Reply-To: <1118946334.3949.63.camel@betsy>
Robert Love wrote:
> On Thu, 2005-06-16 at 10:52 -0700, Zach Brown wrote:
>>>+ if (likely(!atomic_read(&inode->inotify_watch_count)))
>>>+ return;
>>
>>Are there still platforms that implement atomic_read() with locks? I
>>wonder if there isn't a cheaper way for inodes to find out that they're
>>not involved in inotify.. maybe an inode function pointer that is only
>>set to queue_event when watchers are around?
>
>
> I don't know what esoteric architectures are doing, but the solution
> needs to be atomic (or we need to say "we don't care about races"--but
> its hard not to care about a pointer race). On x86, at least, an
> atomic_read() is trivial.
>
> I actually would not mind being racey (in a safe way) or finding a
> cheaper solution, especially if we could remove
> inode->inotify_watch_count altogether (and not replace it with
> anything).
>
> But the overhead here is not biting us (we just went through some
> off-list benchmarking that led to the inclusion of this check, in fact).
>
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!
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2005-06-17 1:30 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-15 17:18 [patch] inotify Robert Love
2005-06-16 17:52 ` Zach Brown
2005-06-16 18:25 ` Robert Love
2005-06-17 1:30 ` Nick Piggin [this message]
2005-06-17 1:35 ` Robert Love
2005-06-17 15:15 ` [patch] inotify, improved Robert Love
2005-06-17 15:37 ` Chris Friesen
2005-06-17 15:44 ` Robert Love
2005-06-17 16:11 ` Valdis.Kletnieks
2005-06-17 16:29 ` Robert Love
2005-06-17 16:36 ` Chris Friesen
2005-06-17 16:43 ` Chris Wright
2005-06-17 16:46 ` Muli Ben-Yehuda
2005-06-17 16:40 ` Chris Friesen
2005-06-17 17:57 ` John McCutchan
2005-06-17 17:20 ` Zach Brown
2005-06-17 17:54 ` John McCutchan
2005-06-17 17:56 ` Zach Brown
2005-06-17 18:15 ` John McCutchan
2005-06-17 18:17 ` Zach Brown
2005-06-17 17:07 ` [patch] inotify Arnd Bergmann
2005-06-17 17:54 ` Christoph Hellwig
2005-06-17 18:12 ` John McCutchan
2005-06-17 18:16 ` Robert Love
2005-06-17 18:28 ` Christoph Hellwig
2005-06-17 18:38 ` Robert Love
2005-06-17 18:45 ` Christoph Hellwig
2005-06-17 18:54 ` Robert Love
2005-06-17 17:56 ` John McCutchan
2005-06-17 21:33 ` Andrew Morton
2005-06-17 21:40 ` Robert Love
2005-06-17 23:52 ` Robert Love
2005-06-21 0:51 ` Neil Brown
2005-06-21 2:15 ` John McCutchan
2005-06-21 2:29 ` Neil Brown
2005-06-21 2:43 ` John McCutchan
2005-06-21 15:55 ` Robert Love
2005-07-14 0:25 ` Neil Brown
2005-07-14 4:11 ` John McCutchan
2005-06-18 0:05 ` Arnd Bergmann
2005-06-18 0:57 ` Robert Love
2005-06-18 1:51 ` Chris Wedgwood
-- strict thread matches above, loose matches on Subject: below --
2005-05-09 16:05 Robert Love
2005-05-09 17:43 ` Coywolf Qi Hunt
2005-01-06 20:00 Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42B227B5.3090509@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
--cc=ttb@tentacle.dhs.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
--cc=zab@zabbo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.