public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Nathan Lynch <nathanl@austin.ibm.com>
Cc: Zwane Mwaikambo <zwane@linuxpower.ca>,
	Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] i386 CPU hotplug updated for -mm
Date: Mon, 11 Oct 2004 23:23:39 -0700	[thread overview]
Message-ID: <1097562219.8085.732.camel@localhost> (raw)
In-Reply-To: <1097560787.6557.99.camel@biclops>

On Mon, 2004-10-11 at 22:59, Nathan Lynch wrote:
> On Mon, 2004-10-11 at 03:19, Zwane Mwaikambo wrote:
> > Hi Andrew,
> > 	Find attached the i386 cpu hotplug patch updated for Ingo's latest 
> > round of goodies. In order to avoid dumping cpu hotplug code into 
> > kernel/irq/* i dropped the cpu_online check in do_IRQ() by modifying 
> > fixup_irqs(). The difference being that on cpu offline, fixup_irqs() is 
> > called before we clear the cpu from cpu_online_map and a long delay in 
> > order to ensure that we never have any queued external interrupts on the 
> > APICs. Due to my usual test victims being in boxes a continent away this 
> > hasn't been tested, but i'll cover bug reports (nudge, Nathan! ;)
> 
> Had to apply the patch to 2.6.9-rc4-mm1 (2.6.9-rc3-mm3 doesn't detect my
> scsi controller).  Tested on a dual Pentium 3.  Simple offline/online
> tests seem ok, except I see these warnings when taking a cpu down:
> 
> using smp_processor_id() in preemptible code: bash/3436
>  [<c0106f37>] dump_stack+0x17/0x20
>  [<c011a087>] smp_processor_id+0x87/0xa0
>  [<c0134d54>] cpu_down+0x134/0x240
>  [<c02770d9>] store_online+0x39/0x70
>  [<c0274487>] sysdev_store+0x37/0x50
>  [<c019339e>] flush_write_buffer+0x2e/0x40
>  [<c0193427>] sysfs_write_file+0x77/0x90
>  [<c015aa20>] vfs_write+0xe0/0x120
>  [<c015ab0d>] sys_write+0x3d/0x70
>  [<c0106123>] syscall_call+0x7/0xb

I think this warning is likely bogus:

        /* Move it here so it can run. */
        kthread_bind(p, smp_processor_id());

That just makes sure that the thread can get cleaned up somewhere on
some active cpu.  The only problem would be if the cpu that the thread
was bound to also went down.  But, I think that's prevented by the big
cpu hotplug semaphore.  (the "down"ing CPU can't be "down"ed in the
process of "down"ing :)

> diff -puN kernel/cpu.c~cpu_down-fix-smp_processor_id-warning kernel/cpu.c
> --- 2.6.9-rc4-mm1/kernel/cpu.c~cpu_down-fix-smp_processor_id-warning	2004-10-11 23:28:47.000000000 -0500
> +++ 2.6.9-rc4-mm1-nathanl/kernel/cpu.c	2004-10-11 23:34:36.000000000 -0500
> @@ -129,7 +129,8 @@ int cpu_down(unsigned int cpu)
>  	__cpu_die(cpu);
>  
>  	/* Move it here so it can run. */
> -	kthread_bind(p, smp_processor_id());
> +	kthread_bind(p, get_cpu());
> +	put_cpu();

This doesn't do much more than suppress the warning.  If there was some
kind race there before, then it's still there but is now hidden.  

-- Dave


  parent reply	other threads:[~2004-10-12  6:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 20:45 [patch 0/5, 2.6.9-rc3] generic irq subsystem, description Ingo Molnar
2004-10-01 20:46 ` [patch 1/5, 2.6.9-rc3] generic irq subsystem, core Ingo Molnar
2004-10-01 20:47   ` [patch 2/5, 2.6.9-rc3] generic irq subsystem, x86 port Ingo Molnar
2004-10-01 20:48     ` [patch 3/5, 2.6.9-rc3] generic irq subsystem, x64 port Ingo Molnar
2004-10-01 20:48       ` [patch 4/5, 2.6.9-rc3] generic irq subsystem, ppc port Ingo Molnar
2004-10-01 20:49       ` [patch 5/5, 2.6.9-rc3] generic irq subsystem, ppc64 port Ingo Molnar
     [not found]   ` <20041001143332.7e3a5aba.akpm@osdl.org>
     [not found]     ` <Pine.LNX.4.61.0410091550300.2870@musoma.fsmlabs.com>
2004-10-11  8:19       ` [PATCH] i386 CPU hotplug updated for -mm Zwane Mwaikambo
2004-10-12  5:59         ` Nathan Lynch
2004-10-12  6:04           ` Ingo Molnar
2004-10-12 14:16             ` Nathan Lynch
2004-10-12 14:38               ` Zwane Mwaikambo
2004-10-12  6:23           ` Dave Hansen [this message]
2004-10-12 14:47           ` Zwane Mwaikambo
2004-10-18 15:10         ` Pavel Machek
2004-10-21 14:47           ` Zwane Mwaikambo

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=1097562219.8085.732.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nathanl@austin.ibm.com \
    --cc=rusty@rustcorp.com.au \
    --cc=zwane@linuxpower.ca \
    /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