mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Levon <levon@movementarian.org>
To: Chris Wright <chrisw@osdl.org>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, cliffw@osdl.org
Subject: Re: [PATCH][OPROFILE] disable preempt when calling smp_processor_id()
Date: Sun, 7 Nov 2004 16:56:23 +0000	[thread overview]
Message-ID: <20041107165623.GA36328@compsoc.man.ac.uk> (raw)
In-Reply-To: <20041105163221.J14339@build.pdx.osdl.net>

On Fri, Nov 05, 2004 at 04:32:21PM -0800, Chris Wright wrote:

> smp_processor_id() is called w/out preempt disabled.  Use
> get_cpu()/put_cpu() instead.  Should this be put_cpu_no_resched()?

No, the patch below looks fine

regards
john

> Signed-off-by: Chris Wright <chrisw@osdl.org>
> 
> --- linux-2.6.10-rc1-mm3-smp_processor_id/drivers/oprofile/buffer_sync.c~orig	2004-11-05 15:21:21.551984200 -0800
> +++ linux-2.6.10-rc1-mm3-smp_processor_id/drivers/oprofile/buffer_sync.c	2004-11-05 15:23:29.000000000 -0800
> @@ -62,7 +62,8 @@
>  	/* To avoid latency problems, we only process the current CPU,
>  	 * hoping that most samples for the task are on this CPU
>  	 */
> -	sync_buffer(smp_processor_id());
> +	sync_buffer(get_cpu());
> +	put_cpu();
>    	return 0;
>  }
>  
> @@ -86,7 +87,8 @@
>  		/* To avoid latency problems, we only process the current CPU,
>  		 * hoping that most samples for the task are on this CPU
>  		 */
> -		sync_buffer(smp_processor_id());
> +		sync_buffer(get_cpu());
> +		put_cpu();
>  		return 0;
>  	}
>  

  reply	other threads:[~2004-11-07 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-06  0:32 Chris Wright
2004-11-07 16:56 ` John Levon [this message]
2004-11-08 17:11   ` Chris Wright

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=20041107165623.GA36328@compsoc.man.ac.uk \
    --to=levon@movementarian.org \
    --cc=akpm@osdl.org \
    --cc=chrisw@osdl.org \
    --cc=cliffw@osdl.org \
    --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

all inboxes | Powered by JetHome®