lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Jan 2007 19:32:27 +0530
From:	Gautham R Shenoy <ego@...ibm.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.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 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@...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

Powered by Openwall GNU/*/Linux Powered by OpenVZ