mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Tejun Heo <htejun@gmail.com>
Subject: Re: [Patch -mm 3/3] RFC: Introduce kobject->owner for refcounting.
Date: Tue, 17 Apr 2007 12:53:10 +1000	[thread overview]
Message-ID: <1176778391.14322.273.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0704161539110.2685-100000@iolanthe.rowland.org>

On Mon, 2007-04-16 at 15:53 -0400, Alan Stern wrote:
> The fundamental rule is that whenever you hand out a pointer to a routine
> living in a module, the receiver has to increment the module's refcount.  
> But the driver core violates this rule all over the place.

Hi Alan,

	Your rule is overly simplistic, unfortunately.  You have two choices:
take a reference count, *or* ensure that the reference will go away when
the module's cleanup routine is called.  Network drivers are a classic
example of the latter.

	Note that you cannot do both: if the cleanup routine calls something
which drops a reference count, it implies that the cleanup routine needs
to be called with non-zero reference count, and it won't be (ignoring
--force).

I hope that clarifies?
Rusty.


  reply	other threads:[~2007-04-17  2:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16 17:36 Cornelia Huck
2007-04-16 18:05 ` Greg KH
2007-04-16 19:53   ` Alan Stern
2007-04-17  2:53     ` Rusty Russell [this message]
2007-04-17  7:16       ` Cornelia Huck
2007-04-17 16:08         ` Alan Stern
2007-04-17 23:55           ` Rusty Russell
2007-04-18 15:20             ` Alan Stern
2007-04-19  0:46               ` Rusty Russell

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=1176778391.14322.273.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=cornelia.huck@de.ibm.com \
    --cc=greg@kroah.com \
    --cc=htejun@gmail.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

Powered by JetHome