[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200903161333.16632.rusty@rustcorp.com.au>
Date: Mon, 16 Mar 2009 13:33:16 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Mike Travis <travis@....com>
Subject: Re: [PULL] x86 cpumask work
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?
> 2) this code is called with interrupts disabled, so a
> GFP_KERNEL allocation can be lethal.
I don't see that in my analysis of the code.
> c1e_mask should stay a static cpumask...
>
> Why do we convert static, standalone masks to cpumask_var?
Because we can't undefine struct cpumask while there are any left. If we
really want to we can make it a bitmap, but that's not a good thing to
encourage.
Hope that clarifies,
Rusty.
--
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