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] [day] [month] [year] [list]
Date:	Fri, 18 Jul 2008 17:08:37 -0600
From:	Alex Chiang <achiang@...com>
To:	Matthew Wilcox <matthew@....cx>, Andi Kleen <andi@...stfloor.org>,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	linux-acpi@...r.kernel.org
Subject: Re: [PATCH 01/14] Introduce cpu_enabled_map and friends

* Russell King <rmk+lkml@....linux.org.uk>:
> On Tue, Jul 15, 2008 at 01:15:15PM -0600, Alex Chiang wrote:
> > * Russell King <rmk+lkml@....linux.org.uk>:
> > > 
> > > How about having smp_init() call into arch code to query whether
> > > it should bring up a not-already-online CPU?  Architectures that
> > > want to do something special can then make the decision there and
> > > everyone else can define the test completely away.
> > 
> > So this is exactly what I'm doing. The ia64 patch has this hunk:
> > 
> > @@ -820,6 +824,9 @@ __cpu_up (unsigned int cpu)
> >         if (cpu_isset(cpu, cpu_callin_map))
> >                 return -EINVAL;
> > 
> > +       if (!cpu_isset(cpu, cpu_enabled_map))
> > +               return -EINVAL;
> > +
> >         per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
> >         /* Processor goes to start_secondary(), sets online flag */
> >         ret = do_boot_cpu(sapicid, cpu);
> > 
> > That was the easiest, most-straightforward solution I could think
> > of. If you have an idea for a version with lower taxes (doesn't
> > touch all the archs or can be #define'd out), I'm happy to hear
> > it.
> 
> I think I did make a suggestion in the bit you quote from me above.
> 
> Let me be more explicit:

Thanks, sorry for being dense.

> static void __init smp_init(void)
> {
>         unsigned int cpu;
> 
>         /* FIXME: This should be done in userspace --RR */
>         for_each_present_cpu(cpu) {
>                 if (num_online_cpus() >= setup_max_cpus)
>                         break;
> -		if (!cpu_online(cpu))
> +		if (smp_cpu_enabled(cpu) && !cpu_online(cpu))
>                         cpu_up(cpu);
>         }
> 
>         /* Any cleanup work */
>         printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
>         smp_cpus_done(setup_max_cpus);
> }
> 
> and have architectures provide 'smp_cpu_enabled(cpu)' which can either
> be a function, inline function or a macro (and therefore possible to be
> completely eliminated.)

Yup, this is nicer. I'll try this.

/ac

--
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