From: Robert Love <rml@novell.com>
To: John McCutchan <ttb@tentacle.dhs.org>,
John Hawkes <hawkes@tomahawk.engr.sgi.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.10-mm3 scaling problem with inotify
Date: Thu, 13 Jan 2005 21:29:02 -0500 [thread overview]
Message-ID: <1105669742.6027.243.camel@localhost> (raw)
In-Reply-To: <1105666283.15782.2.camel@vertex>
On Thu, 2005-01-13 at 20:31 -0500, John McCutchan wrote:
> No, you covered things well. This code was really just a straight copy
> of the dnotify code. Rob cleaned it up at some point, giving us what we
> have today. The only fix I can think of is the one suggested by Rob --
> copying the dnotify code again.
Oh, did I undo the dnotify optimization? :-)
Eh, no, looks like not exactly: The old code always did a dget().
John Hawkes: Attached patch implements the dget() optimization in the
same manner as dnotify. Compile-tested but not booted.
Let me know!
Robert Love
inotify: don't do dget() unless we have to
drivers/char/inotify.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff -urN linux-2.6.10-mm3/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-2.6.10-mm3/drivers/char/inotify.c 2005-01-13 21:04:53.108971856 -0500
+++ linux/drivers/char/inotify.c 2005-01-13 21:25:20.052448096 -0500
@@ -607,10 +607,18 @@
u32 cookie, const char *filename)
{
struct dentry *parent;
+ struct inode *inode;
- parent = dget_parent(dentry);
- inotify_inode_queue_event(parent->d_inode, mask, cookie, filename);
- dput(parent);
+ spin_lock(&dentry->d_lock);
+ parent = dentry->d_parent;
+ inode = parent->d_inode;
+ if (inode->inotify_data) {
+ dget(parent);
+ spin_unlock(&dentry->d_lock);
+ inotify_inode_queue_event(inode, mask, cookie, filename);
+ dput(parent);
+ } else
+ spin_unlock(&dentry->d_lock);
}
EXPORT_SYMBOL_GPL(inotify_dentry_parent_queue_event);
next prev parent reply other threads:[~2005-01-14 2:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-13 23:56 2.6.10-mm3 scaling problem with inotify John Hawkes
2005-01-14 0:49 ` Robert Love
2005-01-14 1:31 ` John McCutchan
2005-01-14 2:29 ` Robert Love [this message]
2005-01-14 18:05 ` John Hawkes
2005-01-14 18:15 ` Robert Love
2005-01-14 18:39 ` John Hawkes
-- strict thread matches above, loose matches on Subject: below --
2005-01-14 0:51 John Hawkes
2005-01-14 2:31 Zou, Nanhai
2005-01-14 2:36 ` John McCutchan
2005-01-14 2:41 ` 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=1105669742.6027.243.camel@localhost \
--to=rml@novell.com \
--cc=hawkes@tomahawk.engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ttb@tentacle.dhs.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox