From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Veaceslav Falico <vfalico@redhat.com>,
Russell King <linux@arm.linux.org.uk>,
Neil Horman <nhorman@tuxdriver.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Zdenek Kabelac <zkabelac@redhat.com>,
Matt Domsch <Matt_Domsch@dell.com>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH 1/2] kobject: remove kset from sysfs immediately in kset_unregister()
Date: Thu, 5 Dec 2013 16:01:17 -0800 [thread overview]
Message-ID: <20131206000117.GA21358@kroah.com> (raw)
In-Reply-To: <20131203224143.GA19962@google.com>
On Tue, Dec 03, 2013 at 03:41:43PM -0700, Bjorn Helgaas wrote:
> [+cc Matt, Tejun]
>
> On Tue, Dec 03, 2013 at 10:04:25AM -0800, Greg Kroah-Hartman wrote:
> > On Tue, Oct 08, 2013 at 02:20:16PM -0600, Bjorn Helgaas wrote:
> > > There's no explicit "unlink from sysfs" interface for ksets, so I think
> > > callers of kset_unregister() expect the kset to be removed from sysfs
> > > immediately, without waiting for the last reference to be released.
> > >
> > > This patch makes the sysfs removal happen immediately, so the caller may
> > > create a new kset with the same name as soon as kset_unregister() returns.
> > >
> > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> >
> > With the PCI MSI attribute change, this patch is no longer needed,
> > right?
>
> Well, yes and no. The attached patch extends Russell's delayed kobject
> release to make the delay somewhat random. I *think* that should be
> valid, but correct me if I'm wrong.
Heh, I like it, mind if I queue it up?
> With the random delay patch, it's easy to trigger the "sysfs: cannot
> create duplicate filename" error, e.g., by unloading and reloading the
> edd module, because the module unload only waits for the /sys/module/edd
> object to be released. Other objects, such as the /sys/firmware/edd
> kset, may be released later.
>
> Modules like edd could be changed to explicitly call kobject_del() on
> the kset kobject. Maybe that's a better approach, so we consistently
> use kobject_del() to remove things from sysfs. But I don't know whether
> it's really useful to allow the kset to hang around in sysfs after
> kset_unregister(), and it's sort of subtle to track down problems like
> this.
>
> Several other kset_unregister() callers have this situation, so if we
> don't change it to call kobject_del() internally, maybe we should add a
> note to Documentation/kobject.txt about calling kobject_del() first.
> The existing hint only talks about using it when you need a two-stage
> delete, which isn't really the case here.
>
> If we *do* decide to change kset_unregister(), I have an updated
> documentation patch that makes it more clear that the release may
> happen after kset_unregister() returns.
Ok, I'll take this patch, it makes sense on the module unload path for
example. Thanks for the explanation.
greg k-h
next prev parent reply other threads:[~2013-12-06 0:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 20:20 [PATCH 0/2] Remove ksets from sysfs eagerly Bjorn Helgaas
2013-10-08 20:20 ` [PATCH 1/2] kobject: remove kset from sysfs immediately in kset_unregister() Bjorn Helgaas
2013-12-03 18:04 ` Greg Kroah-Hartman
2013-12-03 22:41 ` Bjorn Helgaas
2013-12-06 0:01 ` Greg Kroah-Hartman [this message]
2013-12-06 0:34 ` Bjorn Helgaas
2013-10-08 20:20 ` [PATCH 2/2] kobject: fix kset sample error path Bjorn Helgaas
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=20131206000117.GA21358@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Matt_Domsch@dell.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nhorman@tuxdriver.com \
--cc=tj@kernel.org \
--cc=vfalico@redhat.com \
--cc=zkabelac@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).