From: Robert Love <rml@novell.com>
To: John McCutchan <ttb@tentacle.dhs.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] inotify 0.13.1
Date: Thu, 07 Oct 2004 19:37:36 -0400 [thread overview]
Message-ID: <1097192256.3960.71.camel@betsy.boston.ximian.com> (raw)
In-Reply-To: <1097097180.12126.2.camel@vertex>
OK.
I am working on redoing the inotify locking wrt inodes.
Most of the time that we grab inode->i_lock, we don't need it. We do
need it when allocating or freeing inode->inotify_data. We also need it
when first obtaining the inotify_data reference count (see below).
So we need an inotify_data reference count to track its lifetime. We
already have ->watcher_count, which functions pretty well as this ref
count, but we need to formalize it, make it atomic_t, and always grab it
under ->i_lock. Freeing the structure is then a consequence of the ref
count dropping to zero via atomic_dec_and_test().
Then we can add inotify_data->lock to protect the contents of
inotify_data from concurrent access and not use i_lock.
Anyone dereferencing inotify_data (or setting/freeing it for the first
time) needs to hold a ref count. This is an existing bug.
We can hopefully end up only taking inode->i_lock when grabbing this ref
count, and no other time. We won't have to nest it with dev->lock any
more.
That is the plan, anyhow. Patch later tonight or tomorrow, with luck.
Robert Love
prev parent reply other threads:[~2004-10-07 23:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-06 21:13 John McCutchan
2004-10-07 23:37 ` Robert Love [this message]
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=1097192256.3960.71.camel@betsy.boston.ximian.com \
--to=rml@novell.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
all inboxes | Powered by JetHome®