public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] fix call of smp_processor_id() by XPC while preemptible
Date: Tue, 12 Jul 2005 20:47:54 +0000	[thread overview]
Message-ID: <20050712204754.GA11356@infradead.org> (raw)
In-Reply-To: <42D41A65.mailx8QB11670O@aqua.americas.sgi.com>

On Tue, Jul 12, 2005 at 02:30:45PM -0500, Dean Nelson wrote:
> XPC calls smp_processor_id() twice from xpc_setup_infrastructure() with
> preemption enabled, which gets flagged if 'DEBUG_PREEMPT=y'. This patch
> disables preemption around a now single call to smp_processor_id(). Note
> that it doesn't matter if the thread is moved to another processor once
> it has the processor ID.
> 
> Signed-off-by: Dean Nelson <dcn@sgi.com>
> 
> 
> Index: linux-2.6/arch/ia64/sn/kernel/xpc_channel.c
> =================================> --- linux-2.6.orig/arch/ia64/sn/kernel/xpc_channel.c	2005-07-12 12:09:14.026288661 -0500
> +++ linux-2.6/arch/ia64/sn/kernel/xpc_channel.c	2005-07-12 13:23:34.976151339 -0500
> @@ -72,7 +72,7 @@
>  enum xpc_retval
>  xpc_setup_infrastructure(struct xpc_partition *part)
>  {
> -	int ret;
> +	int ret, cpuid;
>  	struct timer_list *timer;
>  	partid_t partid = XPC_PARTID(part);
>  
> @@ -223,9 +223,13 @@
>  	xpc_vars_part[partid].openclose_args_pa >  					__pa(part->local_openclose_args);
>  	xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va);
> -	xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(smp_processor_id());
> -	xpc_vars_part[partid].IPI_phys_cpuid > -					cpu_physical_id(smp_processor_id());
> +
> +	preempt_disable();
> +	cpuid = smp_processor_id();
> +	preempt_enable();

just use __smp_processor_id() (or the fashionable name of the day)
for it.


  parent reply	other threads:[~2005-07-12 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-12 19:30 [PATCH] fix call of smp_processor_id() by XPC while preemptible Dean Nelson
2005-07-12 19:39 ` Luck, Tony
2005-07-12 20:00 ` Dean Nelson
2005-07-12 20:47 ` Christoph Hellwig [this message]
2005-07-13 12:44 ` Dean Nelson
2005-07-13 14:25 ` Christoph Hellwig

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=20050712204754.GA11356@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-ia64@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