From: Tejun Heo <tj@kernel.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH hw_breakpoint] percpu: add __percpu sparse annotations to hw_breakpoint
Date: Thu, 18 Feb 2010 09:49:08 +0900 [thread overview]
Message-ID: <4B7C8E84.2030701@kernel.org> (raw)
In-Reply-To: <20100217163944.GC5041@nowhere>
Hello,
On 02/18/2010 01:39 AM, Frederic Weisbecker wrote:
> On Wed, Feb 17, 2010 at 10:50:50AM +0900, Tejun Heo wrote:
> Yeah, looks good, I'm queuing it.
> Just few comments below, for nano-considerations.
>> cpu_events = alloc_percpu(typeof(*cpu_events));
>> if (!cpu_events)
>> - return ERR_PTR(-ENOMEM);
>> + return (void __percpu __force *)ERR_PTR(-ENOMEM);
>
> Is this pattern common enough that we can think about a ERR_CPU_PTR ?
I thought about that but there aren't too many yet, so I just added
the ugly castings. It would be cool if sparse can be taught that
ERR_PTR() returns universal pseudo pointer.
>> sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler);
>> - if (IS_ERR(sample_hbp)) {
>> - ret = PTR_ERR(sample_hbp);
>> + if (IS_ERR((void __force *)sample_hbp)) {
>> + ret = PTR_ERR((void __force *)sample_hbp);
>
> Same comments here, although I wouldn't like much a CPU_PTR_ERR or
> IS_ERR_CPU.... CPP is just so poor in magic for that.
>
> I must confess I miss a bit the old per_cpu prefix that guarded the implicit
> separate namespace.
Yeap, I agree that the prefix had its advantages. It's just that it
can't scale to the new situation where static and dynamic percpu
variables behave uniformly.
Thank you.
--
tejun
next prev parent reply other threads:[~2010-02-18 0:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-17 1:50 Tejun Heo
2010-02-17 16:39 ` Frederic Weisbecker
2010-02-18 0:49 ` Tejun Heo [this message]
2010-02-18 18:25 ` Frederic Weisbecker
2010-02-28 8:57 ` [tip:perf/core] percpu: Add " tip-bot for Tejun Heo
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=4B7C8E84.2030701@kernel.org \
--to=tj@kernel.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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
Powered by JetHome