lkml.org 
[lkml]   [2006]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.16-mm2 4/4] sched_domain: Allocate sched_group structures dynamically
Srivatsa Vaddagiri wrote:
> On Sun, Apr 02, 2006 at 11:39:30AM +1000, Nick Piggin wrote:
>
>>Srivatsa Vaddagiri wrote:
>>
>>>+ if (!sched_group_phys) {
>>>+ sched_group_phys
>>>+ = kmalloc(sizeof(struct sched_group) *
>>>NR_CPUS,
>>>+ GFP_KERNEL);
>>>+ if (!sched_group_phys) {
>>>+ printk (KERN_WARNING "Can not alloc phys
>>>sched"
>>>+ "group\n");
>>>+ goto error;
>>>+ }
>>>+ sched_group_phys_bycpu[i] = sched_group_phys;
>>>+ }
>>
>>Doesn't the last assignment have to be outside the if statement?
>
>
> I dont think so. The assignment can happen once (when we allocate
> successfully) and not every time in the for loop?
>

Then after you have allocated sched_group_phys, subsequent cpus
in cpu_map will have their sched_group_phys_bycpu[] entry
uninitialised, by the looks?

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com

-
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: 2006-04-03 14:39    [W:0.047 / U:1.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site