lkml.org 
[lkml]   [2005]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: CPU hotplug on i386
Hi again-

On Wed, Mar 16, 2005 at 02:21:52PM +0100, Pavel Machek wrote:
> + int cpu, error;
> + cpus_clear(frozen_cpus);
> + printk("Freezing cpus...\n");
> + for_each_online_cpu(cpu) {
> + if (!cpu)
> + continue;
> + cpu_set(cpu, frozen_cpus);
> + error = cpu_down(cpu);
> + if (!error)
> + continue;
> + printk("Error taking cpu %d down: %d\n", cpu, error);
> + panic("Too many cpus");
> }
> - printk("ok\n");
> + BUG_ON(smp_processor_id() != 0);
> }
>
> void enable_nonboot_cpus(void)
> {
> - printk("Restarting CPUs");
> - atomic_set(&freeze, 0);
> - while (atomic_read(&cpu_counter)) {
> - cpu_relax();
> - barrier();
> + int cpu, error;
> + printk("Thawing cpus...\n");
> + for_each_cpu_mask(cpu, frozen_cpus) {
> + if (!cpu)
> + continue;
> + error = cpu_up(cpu);
> + if (!error)
> + continue;
> + printk("Error taking cpu %d up: %d\n", cpu, error);
> + panic("Not enough cpus");
> }

If you're going to depend on CONFIG_HOTPLUG_CPU for swsusp on smp, why
not offline the non-boot cpus from userspace? Same goes for onlining
additional cpus during resume.

Nathan
-
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: 2005-03-22 14:11    [W:0.098 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site