From: Alex Chiang <achiang@hp.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: htejun@gmail.com, greg@kroah.com, cornelia.huck@de.ibm.com,
kay.sievers@vrfy.org, rusty@rustcorp.com.au,
ebiederm@xmission.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] sysfs: allow suicide
Date: Wed, 25 Mar 2009 17:03:54 -0600 [thread overview]
Message-ID: <20090325230354.GB11447@ldl.fc.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0903251036450.3462-100000@iolanthe.rowland.org>
* Alan Stern <stern@rowland.harvard.edu>:
> On Tue, 24 Mar 2009, Alex Chiang wrote:
>
> > Hi all,
> >
> > This is a refreshed version of the patch series Tejun posted quite a while
> > ago that allowed sysfs attributes to commit suicide directly:
> >
> > http://thread.gmane.org/gmane.linux.kernel/582130/
>
> > The most contentious part is patch 1/3, wherein sysfs abuses the
> > module notifier call chain, and basically prevents all module unloads
> > until suicidal sysfs attributes have completed.
> >
> > This is poison of a different flavor from last time. The earlier version
> > of this series modified the module API and created an interface that
> > allowed anyone to inhibit module unload.
> >
> > This time, only sysfs is allowed to be so... special. Which is a slight
> > improvement, but the question as to whether sysfs should be allowed to
> > do something like this is unresolved.
>
> I tend to agree with Eric that this feels a little like a band-aid, and
> a more general solution would be preferable. But I don't have one to
> offer, and getting the immediate problems fixed is also important.
Well, getting the sysfs callback off the global workqueue is an
immediate fix that:
- introduces no conceptual change
- fixes the lockdep false positive
- doesn't try to be clever with references
If the consensus here is that this suicide patch series is simply
a band-aid, then I think my other patch will have solved the
problem as much as possible without getting mired in a
conversation about truth and beauty.
> Why change the inhibit-module-unload interface? This new approach
> seems a lot more complicated than needed; a simple rwsem should work
> okay. Exposing it to the entire kernel when only sysfs uses it doesn't
> matter -- there must be plenty of EXPORTed symbols with only one user.
My concern was more the other way around, that exposing a
sledgehammer interface to anyone who wants to inhibit module
unload might not seem like such a wise choice.
I felt that going through the blocking notifier call chain was a
little more proper, in the sense of, "ok well we're going to
allow this inhibit-unload but we know exactly who's doing it".
But that seems irrelevant now.
> Which reminds me... What happens if two different processes write to
> the same suicidal sysfs attribute at the same time?
Good question; I didn't test that with Tejun's patches.
Using the callback mechanism, and a recent patch I wrote that
Greg accepted for 2.6.30, we only allow one in-flight callback
per sysfs attribute/kobject at a time. The loser of the race gets
-EAGAIN while the remove is occurring, and then when the
attribute goes away, gets "file not found" (or something
similar).
Thanks.
/ac
prev parent reply other threads:[~2009-03-25 23:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-25 4:16 Alex Chiang
2009-03-25 4:16 ` [RFC PATCH 1/3] sysfs: make the sysfs_addrm_cxt->removed list FIFO Alex Chiang
2009-03-25 4:16 ` [RFC PATCH 2/3] sysfs: add blocking notifier to prohibit module unload Alex Chiang
2009-03-25 4:17 ` [RFC PATCH 3/3] sysfs: care-free suicide for sysfs files Alex Chiang
2009-03-26 5:24 ` Tejun Heo
2009-03-25 5:54 ` [RFC PATCH 0/3] sysfs: allow suicide Eric W. Biederman
2009-03-25 22:54 ` Alex Chiang
2009-03-26 0:42 ` Eric W. Biederman
2009-03-26 1:26 ` Alex Chiang
2009-03-26 2:41 ` Eric W. Biederman
2009-03-26 1:32 ` Tejun Heo
2009-03-26 3:05 ` Eric W. Biederman
2009-03-26 3:36 ` Tejun Heo
2009-03-26 14:21 ` Alan Stern
2009-03-26 14:56 ` Cornelia Huck
2009-03-25 14:45 ` Alan Stern
2009-03-25 23:03 ` Alex Chiang [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=20090325230354.GB11447@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=cornelia.huck@de.ibm.com \
--cc=ebiederm@xmission.com \
--cc=greg@kroah.com \
--cc=htejun@gmail.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=stern@rowland.harvard.edu \
/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®