Re: [PATCH 2.6.16-mm1 2/2] sched_domains: Allocate sched_groups dynamically
From: Siddha, Suresh B
Date: Mon Mar 27 2006 - 16:16:04 EST
On Sat, Mar 25, 2006 at 01:58:04PM +0530, Srivatsa Vaddagiri wrote:
> + if (!sched_group_phys && !alloc_phys_failed) {
> + 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");
> + alloc_phys_failed = 1;
> + }
> + sched_group_phys_bycpu[i] = sched_group_phys;
> + }
We can move this allocation outside the for loop and avoid the complexities
of alloc_phys_failed, alloc_core_failed..
thanks,
suresh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/