Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1291599

Re: [PATCH] kobject: Ensure child's resources get released before parent's resources

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] kobject: Ensure child's resources get released before parent's resources
Date 2015-12-14 22:50 +0100
Message-ID <qFJah-3kf-7@gated-at.bofh.it> (permalink)
References <qFGFu-1Ro-59@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] kobject: Ensure child's resources get released before parent's resources Rajat Jain <rajatja@google.com> - 2015-12-14 20:10 +0100
  Re: [PATCH] kobject: Ensure child's resources get released before  parent's resources Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-12-14 22:50 +0100
    Re: [PATCH] kobject: Ensure child's resources get released before  parent's resources Rajat Jain <rajatxjain@gmail.com> - 2015-12-14 23:40 +0100
      Re: [PATCH] kobject: Ensure child's resources get released before  parent's resources Rajat Jain <rajatxjain@gmail.com> - 2015-12-14 23:40 +0100
      Re: [PATCH] kobject: Ensure child's resources get released before  parent's resources Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-12-15 00:20 +0100

csiph-web