All of lore.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
@ 2003-03-22  4:12 Keith Owens
  2003-03-24 21:54 ` David Mosberger
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Keith Owens @ 2003-03-22  4:12 UTC (permalink / raw)
  To: linux-ia64

arch/ia64/kernel/mca.c:ia64_mca_rendez_int_handler has

#ifdef CONFIG_SMP
	cpu = cpu_logical_id(hard_smp_processor_id());
#endif
	ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;

All the other code that runs imi_rendez_checkin does so using logical
cpu numbers.  Why does ia64_mca_rendez_int_handler use that convoluted
expression instead of the simpler
	cpu = smp_processor_id();



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
  2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
@ 2003-03-24 21:54 ` David Mosberger
  2003-03-25 16:45 ` Luck, Tony
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: David Mosberger @ 2003-03-24 21:54 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sat, 22 Mar 2003 15:12:55 +1100, Keith Owens <kaos@sgi.com> said:

  Keith> arch/ia64/kernel/mca.c:ia64_mca_rendez_int_handler has
  Keith> #ifdef CONFIG_SMP
  Keith> cpu = cpu_logical_id(hard_smp_processor_id());
  Keith> #endif
  Keith> ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;

  Keith> All the other code that runs imi_rendez_checkin does so using logical
  Keith> cpu numbers.  Why does ia64_mca_rendez_int_handler use that convoluted
  Keith> expression instead of the simpler
  Keith> cpu = smp_processor_id();

I don't know either.  Perhaps the original author remembers (Jenna or
Tony, perhaps?).

	--david


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
  2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
  2003-03-24 21:54 ` David Mosberger
@ 2003-03-25 16:45 ` Luck, Tony
  2003-03-25 21:15 ` Keith Owens
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2003-03-25 16:45 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Sat, 22 Mar 2003 15:12:55 +1100, Keith Owens <kaos@sgi.com> said:

  Keith> arch/ia64/kernel/mca.c:ia64_mca_rendez_int_handler has
  Keith> #ifdef CONFIG_SMP
  Keith> cpu = cpu_logical_id(hard_smp_processor_id());
  Keith> #endif
  Keith> ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;

  Keith> All the other code that runs imi_rendez_checkin does so using logical
  Keith> cpu numbers.  Why does ia64_mca_rendez_int_handler use that convoluted
  Keith> expression instead of the simpler
  Keith> cpu = smp_processor_id();

  David> I don't know either.  Perhaps the original author remembers (Jenna or
  David> Tony, perhaps?).

This code predates me.  I checked with Jenna and she says that it's before
her time too.

<speculation>
That convoluted expression avoids use of the per-cpu mapping, but I can't see
why we'd be scared to use that here, and not be paranoid elsewhere.  How was
smp_processor_id() implemented far back in days of 2.4.0 and before?
</speculation>

-Tony


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
  2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
  2003-03-24 21:54 ` David Mosberger
  2003-03-25 16:45 ` Luck, Tony
@ 2003-03-25 21:15 ` Keith Owens
  2003-03-26  1:55 ` Peter Chubb
  2003-04-16 16:36 ` Bjorn Helgaas
  4 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2003-03-25 21:15 UTC (permalink / raw)
  To: linux-ia64

On Tue, 25 Mar 2003 08:45:56 -0800, 
"Luck, Tony" <tony.luck@intel.com> wrote:
>>>>>> On Sat, 22 Mar 2003 15:12:55 +1100, Keith Owens <kaos@sgi.com> >said:
>
>  Keith> arch/ia64/kernel/mca.c:ia64_mca_rendez_int_handler has
>  Keith> #ifdef CONFIG_SMP
>  Keith> cpu = cpu_logical_id(hard_smp_processor_id());
>  Keith> #endif
>  Keith> ia64_mc_info.imi_rendez_checkin[cpu] = >IA64_MCA_RENDEZ_CHECKIN_DONE;
>
>  Keith> All the other code that runs imi_rendez_checkin does so using >logical
>  Keith> cpu numbers.  Why does ia64_mca_rendez_int_handler use that >convoluted
>  Keith> expression instead of the simpler
>  Keith> cpu = smp_processor_id();
>
>  David> I don't know either.  Perhaps the original author remembers >(Jenna or
>  David> Tony, perhaps?).
>
>This code predates me.  I checked with Jenna and she says that it's >before
>her time too.
>
><speculation>
>That convoluted expression avoids use of the per-cpu mapping, but I >can't see
>why we'd be scared to use that here, and not be paranoid elsewhere.  How >was
>smp_processor_id() implemented far back in days of 2.4.0 and before?
></speculation>

At one time there was confusion between which arrays used the logical
cpu number in smp_processor_id() and which arrays used the hardware cpu
number.  This is probably a holdover from that period.

Index: 20.5/arch/ia64/kernel/mca.c
--- 20.5/arch/ia64/kernel/mca.c Wed, 11 Dec 2002 20:58:53 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
+++ 20.5(w)/arch/ia64/kernel/mca.c Wed, 26 Mar 2003 08:14:29 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
@@ -640,13 +640,10 @@ ia64_mca_wakeup_all(void)
 void
 ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *ptregs)
 {
-	int flags, cpu = 0;
+	int flags, cpu = smp_processor_id();
 	/* Mask all interrupts */
 	save_and_cli(flags);
 
-#ifdef CONFIG_SMP
-	cpu = cpu_logical_id(hard_smp_processor_id());
-#endif
 	ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;
 	/* Register with the SAL monarch that the slave has
 	 * reached SAL



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
  2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
                   ` (2 preceding siblings ...)
  2003-03-25 21:15 ` Keith Owens
@ 2003-03-26  1:55 ` Peter Chubb
  2003-04-16 16:36 ` Bjorn Helgaas
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Chubb @ 2003-03-26  1:55 UTC (permalink / raw)
  To: linux-ia64


Index: 20.5/arch/ia64/kernel/mca.c
--- 20.5/arch/ia64/kernel/mca.c Wed, 11 Dec 2002 20:58:53 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
+++ 20.5(w)/arch/ia64/kernel/mca.c Wed, 26 Mar 2003 08:14:29 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
@@ -640,13 +640,10 @@ ia64_mca_wakeup_all(void)
 void
 ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *ptregs)
 {
-	int flags, cpu = 0;
+	int flags, cpu = smp_processor_id();
 	/* Mask all interrupts */
 	save_and_cli(flags);

If this is called from a preemptible context, then move the cpu cmp_processor_id() within the save_and_cli() section, or it won't be
preempt safe.  (thread could be migrated between getting the processor
ID and stopping interrupts.)

Peter C


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id
  2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
                   ` (3 preceding siblings ...)
  2003-03-26  1:55 ` Peter Chubb
@ 2003-04-16 16:36 ` Bjorn Helgaas
  4 siblings, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2003-04-16 16:36 UTC (permalink / raw)
  To: linux-ia64

I applied this for 2.4.

On Tuesday 25 March 2003 2:15 pm, Keith Owens wrote:
> Index: 20.5/arch/ia64/kernel/mca.c
> --- 20.5/arch/ia64/kernel/mca.c Wed, 11 Dec 2002 20:58:53 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
> +++ 20.5(w)/arch/ia64/kernel/mca.c Wed, 26 Mar 2003 08:14:29 +1100 kaos (linux-2.4/s/c/5_mca.c 1.1.3.2.3.1.1.1.1.3 644)
> @@ -640,13 +640,10 @@ ia64_mca_wakeup_all(void)
>  void
>  ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *ptregs)
>  {
> -	int flags, cpu = 0;
> +	int flags, cpu = smp_processor_id();
>  	/* Mask all interrupts */
>  	save_and_cli(flags);
>  
> -#ifdef CONFIG_SMP
> -	cpu = cpu_logical_id(hard_smp_processor_id());
> -#endif
>  	ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;
>  	/* Register with the SAL monarch that the slave has
>  	 * reached SAL



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-04-16 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22  4:12 [Linux-ia64] ia64_mca_rendez_int_handler use of hard_smp_processor_id Keith Owens
2003-03-24 21:54 ` David Mosberger
2003-03-25 16:45 ` Luck, Tony
2003-03-25 21:15 ` Keith Owens
2003-03-26  1:55 ` Peter Chubb
2003-04-16 16:36 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.