lkml.org 
[lkml]   [2006]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2006-03-27 23:21    [W:0.147 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site