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 must be called with preempt disabled.
Date: Fri, 22 Mar 2013 15:37:08 -0400	[thread overview]
Message-ID: <514CB2E4.2030009@tilera.com> (raw)
In-Reply-To: <1363973871-13199-1-git-send-email-haustad@cisco.com>

On 3/22/2013 1:37 PM, Henrik Austad wrote:
> ns2cycles use per_cpu variables, and will, eventually, find its way into
> smp_processord_id(). The latter must be called with either preempt
> disabled, irq's off, from a thread locked to a single core or early in
> the bootprocess (according to debug_smp_processor_id())

A better fix would be to use __raw_get_cpu_var() in ns2cycles(), along with a comment saying that the frequency of the tile timer is the same on all cores, so it doesn't matter which copy of the per-cpu structure we look at.

I don't object to the performance hit of the preemption calls so much as the confusing aspect of why it appears we need to disable preemption to compute the value, but not to use it :-)

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


  reply	other threads:[~2013-03-22 19:37 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 [this message]
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

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=514CB2E4.2030009@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