Messages in this thread | | | Date | Mon, 27 Mar 2006 13:18:26 -0800 | From | "Siddha, Suresh B" <> | Subject | Re: [PATCH 2.6.16-mm1 2/2] sched_domains: Allocate sched_groups dynamically |
| |
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |