From: John McCutchan <john@johnmccutchan.com>
To: Andrew Morton <akpm@osdl.org>
Cc: john@johnmccutchan.com, holt@sgi.com,
linux-kernel@vger.kernel.org, rml@novell.com, arnd@arndb.de,
hch@lst.de
Subject: Re: udevd is killing file write performance.
Date: Fri, 24 Feb 2006 00:47:26 -0500 [thread overview]
Message-ID: <20060224054724.GA8593@johnmccutchan.com> (raw)
In-Reply-To: <20060223161425.4388540e.akpm@osdl.org>
On Thu, Feb 23, 2006 at 04:14:25PM -0800, Andrew Morton wrote:
> John McCutchan <john@johnmccutchan.com> wrote:
> >
> > ...
> > >
> > > I have a bad feeling about this one. It'd be nice to have an exact
> > > understanding of the problen source, but if it's just lots of traffic on
> > > ->d_lock we're kinda stuck. I don't expect we'll run off and RCUify
> > > d_parent or turn d_lock into a seq_lock or anything liek that.
> > >
> > > Then again, maybe making d_lock an rwlock _will_ help - if this workload is
> > > also hitting tree_lock (Robin?) and we're not seeing suckiness due to that
> > > then perhaps the rwlock is magically helping.
> > >
> > >
> > > > instead of your hack.
> > >
> > > It's not a terribly bad hack - it's just poor-man's hashing, and it's
> > > reasonably well-suited to the sorts of machines and workloads which we
> > > expect will hit this problem.
> > >
> >
> > If this is as good as it gets, here is a patch (totally untested).
> >
> > ...
> > @@ -538,7 +537,7 @@
> > struct dentry *parent;
> > struct inode *inode;
> >
> > - if (!atomic_read (&inotify_watches))
> > + if (!atomic_read (&dentry->d_sb->s_inotify_watches))
> > return;
> >
>
> What happens here if we're watching a mountpoint - the parent is on a
> different fs?
There are four cases to consider here.
Case 1: parent fs watched and child fs watched
correct results
Case 2: parent fs watched and child fs not watched
We may not deliver an event that should be delivered.
Case 3: parent fs not watched and child fs watched
We take d_lock when we don't need to
Case 4: parent fs not watched and child fs not watched
correct results
Case 2 screws us. We have to take the lock to even look at the parent's
dentry->d_sb->s_inotify_watches. I don't know of a way around this one.
John
next prev parent reply other threads:[~2006-02-24 4:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-22 13:42 udevd is killing file write performance Robin Holt
2006-02-22 13:55 ` Andrew Morton
2006-02-22 16:48 ` John McCutchan
2006-02-22 17:50 ` Robin Holt
2006-02-22 20:05 ` Andrew Morton
2006-02-22 21:50 ` Jeff V. Merkey
2006-02-23 12:56 ` Robin Holt
2006-02-23 13:42 ` David Chinner
2006-02-22 22:52 ` John McCutchan
2006-02-22 23:12 ` Andrew Morton
2006-02-22 23:41 ` John McCutchan
2006-02-24 0:14 ` Andrew Morton
2006-02-24 0:14 ` Andrew Morton
2006-02-24 5:47 ` John McCutchan [this message]
2006-02-24 6:00 ` Andrew Morton
2006-02-24 7:07 ` Nick Piggin
2006-02-24 7:16 ` Andrew Morton
2006-02-24 7:19 ` Nick Piggin
2006-02-26 16:58 ` John McCutchan
2006-02-24 18:56 ` Robin Holt
2006-02-25 2:44 ` Nick Piggin
2006-02-25 15:53 ` [patch] inotify: lock avoidance with parent watch status in dentry Nick Piggin
2006-02-28 0:48 ` Andrew Morton
2006-02-26 16:55 ` udevd is killing file write performance John McCutchan
2006-02-27 10:11 ` Nick Piggin
2006-02-27 20:17 ` John McCutchan
2006-02-23 20:38 ` Benjamin LaHaise
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=20060224054724.GA8593@johnmccutchan.com \
--to=john@johnmccutchan.com \
--cc=akpm@osdl.org \
--cc=arnd@arndb.de \
--cc=hch@lst.de \
--cc=holt@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
/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.