lkml.org 
[lkml]   [2009]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PULL] x86 cpumask work

* Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Sunday 15 March 2009 16:30:44 Ingo Molnar wrote:
> >
> > > } else if (check_c1e_idle(c)) {
> > > printk(KERN_INFO "using C1E aware idle routine\n");
> > > - alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
> > > - cpumask_clear(c1e_mask);
> > > + /* c1e_mask can only be NULL during boot of first cpu. */
> > > + if (c1e_mask == NULL) {
> > > + alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
> >
> > Sigh, there are two bugs here:
> >
> > 1) what if the GFP_KERNEL allocation fails?
>
> As the comments says, it can only be NULL during boot of the first CPU.
>
> start_kernel -> check_bugs -> identify_boot_cpu -> identify_cpu
> -> select_idle_routine.
>
> Did you want me to panic if it fails?

Ah, ok. But i think it's very unobvious to embedd a "once per
bootup" dynamic allocation like that. Please put it into a
separate init routine instead. That way select_idle() [which
runs during every CPU hotplug event] wont have this allocation.

Ingo


\
 
 \ /
  Last update: 2009-03-16 09:51    [W:0.098 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site