From: Tejun Heo <tj@kernel.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Dan Williams <dan.j.williams@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Is devm_* broken ?
Date: Tue, 28 Jul 2015 11:22:25 -0400 [thread overview]
Message-ID: <20150728152225.GA454@mtj.duckdns.org> (raw)
In-Reply-To: <1643821.fnPPMYQxCt@avalon>
Hello, Laurent.
On Tue, Jul 28, 2015 at 05:16:16PM +0300, Laurent Pinchart wrote:
> Using devm_kzalloc() in such a way has value though, and reverting drivers to
> the pre-devm memory allocation code would make error handling and cleanup code
> paths more complex again. Should we introduce a managed allocator for that
> purpose that would have a lifespan explicitly handled by drivers ?
I don't know. Sure, we can have memory allocations which are tied to
open file; however, the distinction between that and regular devm
resources, which can't linger on no matter what, would be subtle and
confusing. IMHO, a better approach would be implmenting generic
revoke feature and sever open files on driver detach so that
everything can be shutdown then.
Thanks.
--
tejun
next prev parent reply other threads:[~2015-07-28 15:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 22:34 Is devm_* broken ? Laurent Pinchart
2015-07-15 15:51 ` Takashi Iwai
2015-07-15 16:08 ` Laurent Pinchart
2015-07-15 16:20 ` Takashi Iwai
2015-07-15 16:27 ` Laurent Pinchart
2015-07-15 16:34 ` Takashi Iwai
2015-07-28 14:10 ` Laurent Pinchart
2015-07-15 17:00 ` Dan Williams
2015-07-15 18:03 ` Tejun Heo
2015-07-28 14:16 ` Laurent Pinchart
2015-07-28 15:22 ` Tejun Heo [this message]
2015-07-28 17:05 ` Laurent Pinchart
2015-08-04 19:56 ` Pavel Machek
2015-08-04 21:26 ` Dmitry Torokhov
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=20150728152225.GA454@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=dan.j.williams@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
/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