Re: [PATCH 2.6.16-mm2 4/4] sched_domain: Allocate sched_group structures dynamically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


-- 
Regards,
vatsa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux