From: Tejun Heo <tj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>,
"sangjung.woo" <sangjung.woo@samsung.com>,
Alessandro Rubini <rubini@gnudd.com>,
Russell King <rmk+kernel@arm.linux.org.uk>,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org,
Greg KH <greg@kroah.com>
Subject: Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()
Date: Thu, 10 Oct 2013 19:18:51 -0400 [thread overview]
Message-ID: <20131010231851.GB14030@mtj.dyndns.org> (raw)
In-Reply-To: <20131010160603.1489fe054c2bdc0a0eb9460f@linux-foundation.org>
Hello,
On Thu, Oct 10, 2013 at 04:06:03PM -0700, Andrew Morton wrote:
> On Tue, 08 Oct 2013 21:59:27 -0700 Joe Perches <joe@perches.com> wrote:
>
> > I was a bit surprised to find there isn't a devm_kmalloc.
>
> Yes, the unconditional memset is silly. Especially when the
> function has a handy gfp_t and could be passed __GFP_ZERO.
>
> The comment says "managed kzalloc/kfree for device drivers, no kmalloc,
> always use kzalloc". There's no explanation for this - it looks like
> some ideological thing.
Skipping resetting just is highly unlikely to make any meaningful
difference in the paths devres is supposed to be used. These don't
and shouldn't get called from hot paths. Wouldn't it be more
idelogical to have something just because it feels weird not to have
it even if it is not necessary? I don't necessarily object to having
non-zeroing interface but it seems rather pointless. Do we have an
actual cases where this makes meaningful differences?
> - memset(dr, 0, tot_size);
> + if (gfp & __GFP_ZERO)
> + memset(dr, 0, tot_size);
I'd much prefer to have at least the devres_node part cleared
regardless of __GFP_ZERO and Joe already has better patches doing
this.
Thanks.
--
tejun
next prev parent reply other threads:[~2013-10-10 23:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 4:00 Sangjung Woo
2013-10-09 4:07 ` Joe Perches
2013-10-09 4:36 ` sangjung.woo
2013-10-09 4:59 ` Joe Perches
2013-10-09 5:32 ` sangjung.woo
2013-10-10 23:06 ` Andrew Morton
2013-10-10 23:14 ` Joe Perches
2013-10-10 23:46 ` Andrew Morton
2013-10-10 23:18 ` Tejun Heo [this message]
2013-10-10 23:25 ` Joe Perches
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=20131010231851.GB14030@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=rtc-linux@googlegroups.com \
--cc=rubini@gnudd.com \
--cc=sangjung.woo@samsung.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
all inboxes | Powered by JetHome®