All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: haveblue@us.ibm.com, Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [-mm PATCH] sysdev_unregister() should call kobject_del()
Date: Fri, 8 Feb 2008 15:57:56 -0800	[thread overview]
Message-ID: <20080208235756.GA7876@kroah.com> (raw)
In-Reply-To: <1202512949.6354.3.camel@badari-laptop.beaverton.ibm.com>

On Fri, Feb 08, 2008 at 03:22:29PM -0800, Badari Pulavarty wrote:
> 
> On Thu, 2008-02-07 at 20:55 -0800, Greg KH wrote:
> > On Thu, Feb 07, 2008 at 05:25:46PM -0800, Badari Pulavarty wrote:
> > > On Thu, 2008-02-07 at 16:38 -0800, Greg KH wrote:
> > > > On Thu, Feb 07, 2008 at 03:56:58PM -0800, Badari Pulavarty wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > While playing with hotplug memory remove on 2.6.24-mm1, I 
> > > > > noticed that /sysfs directory entries are not getting removed.
> > > > > 
> > > > > sysdev_unregister() used to call kobject_unregister().
> > > > > But in 2.6.24-mm1, its only dropping the ref. It should
> > > > > call kobject_del() to remove the object. Correct ?
> > > > > 
> > > > > With this change, the directories are getting removed
> > > > > correctly. Comments ?
> > > > 
> > > > Ick, no, this shouldn't be needed, someone else must be holding a
> > > > reference to the kobject device somewhere.  See the kobject documenation
> > > > for more info.
> > > > 
> > > > I'll try to see where we grab 2 references...
> > > 
> > > I will take a closer look then. I was taking easy way out :(
> > 
> > Hm, I don't see anything obvious in the sys.c core.  What code is
> > controlling these objects that you are creating and removing from the
> > system?
> > 
> 
> I found the culprit. Its not in sys.c core :)

Glad to hear it :)

> remove_memory_block() takes a reference on kobject by calling
> find_memory_block(). It then calls  unregister_memory() to free up sysfs
> entry.
> It drops only one ref (which it got at register time). So it never gets
> freed up. I am going to send out a separate patch for it.

Ah, nice catch.

thanks,

greg k-h

      reply	other threads:[~2008-02-09  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 23:56 [-mm PATCH] sysdev_unregister() should call kobject_del() Badari Pulavarty
2008-02-08  0:38 ` Greg KH
2008-02-08  1:25   ` Badari Pulavarty
2008-02-08  4:55     ` Greg KH
2008-02-08  5:08       ` Badari Pulavarty
2008-02-08  5:41         ` Greg KH
2008-02-08 16:42           ` Badari Pulavarty
2008-02-08 21:30             ` Dave Hansen
2008-02-08 23:22       ` Badari Pulavarty
2008-02-08 23:57         ` Greg KH [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=20080208235756.GA7876@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@linux-foundation.org \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.