[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070130164707.GC2092@linux.vnet.ibm.com>
Date: Tue, 30 Jan 2007 08:47:07 -0800
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Gautham R Shenoy <ego@...ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>, Andrew Morton <akpm@...l.org>,
dipankar@...ibm.com, Gautham Shenoy <ego@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, vatsa@...ibm.com
Subject: Re: Fw: Re: [mm PATCH 4/6] RCU: (now) CPU hotplug
On Tue, Jan 30, 2007 at 07:32:27PM +0530, Gautham R Shenoy wrote:
> On Mon, Jan 29, 2007 at 06:45:49PM -0800, Paul E. McKenney wrote:
> >
> > static int _cpu_down(unsigned int cpu)
> > {
> > int err;
> > struct task_struct *p;
> > cpumask_t old_allowed, tmp;
> >
> > if (num_online_cpus() == 1)
> > return -EBUSY;
> >
> > if (!cpu_online(cpu))
> > return -EINVAL;
> >
> > if (freeze_processes()) {
> > err = -EBUSY;
> > goto out_freeze_notify_failed;
> > }
> > err = raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
> > (void *)(long)cpu);
> > if (err == NOTIFY_BAD) {
> > printk("%s: attempt to take down CPU %u failed\n",
> > __FUNCTION__, cpu);
> > err = -EINVAL;
> > goto out_freeze_notify_failed;
> > }
> >
> > /* Ensure that we are not runnable on dying cpu */
> > old_allowed = current->cpus_allowed;
> > tmp = CPU_MASK_ALL;
> > cpu_clear(cpu, tmp);
> > set_cpus_allowed(current, tmp);
> >
> > mutex_lock(&cpu_bitmask_lock);
>
> We won't be needing this lock either, since it forms the core of
> the unpopular lock_cpu_hotplug :-)
;-)
> > p = __stop_machine_run(take_cpu_down, NULL, cpu);
> > mutex_unlock(&cpu_bitmask_lock);
>
> Looks good.
>
> I'm wondering if we'll need to try_to_freeze in the fork and exit code
> as well :?
Quite possibly -- if you check into that, I will look at PF_NOFREEZE.
Fair enough?
Thanx, Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists