From: James Bottomley <James.Bottomley@SteelEye.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] driver core: remove unneeded klist methods
Date: Fri, 20 Jan 2006 13:19:47 -0600 [thread overview]
Message-ID: <1137784787.3442.7.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0601201043540.4788-100000@iolanthe.rowland.org>
On Fri, 2006-01-20 at 11:39 -0500, Alan Stern wrote:
> This patch (as641) removes unneeded klist methods from the driver core and
> changes a klist_del call to klist_remove in device_del.
>
> The _get and _put methods have no effect, because the klist nodes are
> deleted by calling klist_remove, which waits until they are unreferenced
> by any klist iterators. Furthermore, the _puts cause problems because
> they occur while the iterator is holding a spinlock.
Could you just elaborate on the actual problem that you're trying to
solve here?
Iterators of volatile lists are ipso facto just "best guess", so moving
the location of the iterator piece is OK. However, your assumption that
only the routine called by the iterator is always going to do the final
put on the object is fundamentally flawed. The list is volatile because
references to the object are being acquired and released all the time.
Additionally, the list nodes are embedded in the object, so by removing
the object get and put calls, you remove the ability for the object
refcounting to see the fact that the list is using the object. This
will lead to the situation where the object could be freed while the
iterator is acting on it. You cannot remove the object get/put calls
from the klist references otherwise the list refcounting will be totally
divorced from the object refcounting.
James
next prev parent reply other threads:[~2006-01-21 0:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-20 16:39 Alan Stern
2006-01-20 19:19 ` James Bottomley [this message]
2006-01-21 4:37 ` Alan Stern
2006-01-22 16:30 ` James Bottomley
2006-01-22 22:13 ` Alan Stern
2006-01-23 21:07 ` Alan Stern
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=1137784787.3442.7.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--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®