public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: Henrik Austad <haustad@cisco.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tile: ns2cycles should use __raw_get_cpu_var
Date: Tue, 26 Mar 2013 09:14:35 -0400	[thread overview]
Message-ID: <51519F3B.6070201@tilera.com> (raw)
In-Reply-To: <1364282202-8031-1-git-send-email-haustad@cisco.com>

On 3/26/2013 3:16 AM, Henrik Austad wrote:
> ns2cycles use per_cpu variables, and will, eventually, find its way into
> smp_processord_id(). This is not safe in a preemptible kernel,
> preemption should ideally be disabled.
>
> BUG: using smp_processor_id() in preemptible [00000000] code:
> systemd-modules/367
> caller is ns2cycles+0x40/0xb8
>
> Starting stack dump of tid 367, pid 367 (systemd-modules) on cpu 2 at
> cycle 20969956421
>  frame 0: 0xfffffff70004b860 dump_stack+0x0/0x20 (sp 0xfffffe407993fa90)
>  frame 1: 0xfffffff7006abc28 debug_smp_processor_id+0x1a8/0x1e0 (sp
> 0xfffffe407993fa90)
>  frame 2: 0xfffffff7004d7b40 ns2cycles+0x40/0xb8 (sp 0xfffffe407993fab8)
>  frame 3: 0xfffffff7004dc578 __ndelay+0x38/0x80 (sp 0xfffffe407993fae0)
>
> However, in this case:
>
> - the frequency is the same accross all cores
> - we use the data read-only
> - we do not scale the frequency
>
> Which means that we can use the __raw_get_cpu_var instead.
>
> Signed-off-by: Henrik Austad <haustad@cisco.com>
> ---
>  arch/tile/kernel/time.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)

Thanks - taken into the tile tree!

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


      reply	other threads:[~2013-03-26 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 17:37 [PATCH] tile: ns2cycles must be called with preempt disabled Henrik Austad
2013-03-22 19:37 ` Chris Metcalf
2013-03-23  7:23   ` [PATCH] tile: ns2cycles should use __raw_get_cpu_var Henrik Austad
2013-03-23 14:13     ` Chris Metcalf
2013-03-26  7:16       ` Henrik Austad
2013-03-26 13:14         ` Chris Metcalf [this message]

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=51519F3B.6070201@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=haustad@cisco.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