From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rajat Jain <rajatja@google.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.com,
rajatxjain@gmail.com
Subject: Re: [PATCH] kobject: Ensure child's resources get released before parent's resources
Date: Mon, 14 Dec 2015 13:40:22 -0800 [thread overview]
Message-ID: <20151214214022.GA24226@kroah.com> (raw)
In-Reply-To: <1450119766-28102-1-git-send-email-rajatja@google.com>
On Mon, Dec 14, 2015 at 11:02:46AM -0800, Rajat Jain wrote:
> If the only remaining reference to a parent, is the one taken by
> the child (in kobject_add_internal()), then when the last
> reference to the child goes away, both child and its parents
> shall be released. However, currently the resources of parent
> get released first, followed by the child's resources:
>
> kobject_cleanup(child)
> ....
> kobject_del(child)
> ....
> kobject_put(child->parent) -> results in parent's release()
> ...
> child->kobj_type->release() -> Child's release()
>
> This is a problem because the child's release() method may still
> need to use parent resources or memory for its own cleanup. E.g.
> child may need parent pointer for dma_free_coherent() etc.
>
> Signed-off-by: Rajat Jain <rajatja@google.com>
> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
Why are you listed twice here?
Where in the kernel is the parent being freed before the child that is
causing this issue to happen? We should fix that root cause first...
thanks,
greg k-h
next prev parent reply other threads:[~2015-12-14 21:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 19:02 [PATCH] kobject: Ensure child's resources get released before parent's resources Rajat Jain
2015-12-14 21:40 ` Greg Kroah-Hartman [this message]
2015-12-14 22:33 ` Rajat Jain
2015-12-14 22:35 ` Rajat Jain
2015-12-14 23:10 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2015-12-14 19:04 Rajat Jain
2015-12-14 19:00 Rajat Jain
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=20151214214022.GA24226@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.com \
--cc=rajatja@google.com \
--cc=rajatxjain@gmail.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