lkml.org 
[lkml]   [2007]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: Re: [mm PATCH 4/6] RCU: (now) CPU hotplug
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 :?

Thanks and Regards
gautham.
--
Gautham R Shenoy
Linux Technology Center
IBM India.
"Freedom comes with a price tag of responsibility, which is still a bargain,
because Freedom is priceless!"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-30 15:05    [from the cache]
©2003-2011 Jasper Spaans