Re: [PATCH] cpuset and sched domains: sched_load_balance flag

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

 



Thanks for the review, Randy.  Good comments.

> > Acked-by: Paul Jackson <[email protected]>
> 
> Are there some attributions missing, else S-O-B ?

Yup - I should have written this line as:

	Signed-off-by: Paul Jackson <[email protected]>

> > +static int cpusets_overlap(struct cpuset *a, struct cpuset *b)
> 
> inline ?

It makes no difference to the code generated.  I tend to leave
out 'compiler optimization' hint words if I don't need them to
get the compiler to optimize.  In this case, of a single use
file static routine, the compiler inlines anyway.

> > +	q = NULL; csa = NULL; doms = NULL;
> 
> That's not kernel style.  Use either (Andrew would say the second one):
> 
> 	q = csa = doms = NULL;
> 
> or
> 	q = NULL;
> 	csa = NULL;
> 	doms = NULL;

You're right - and Andrew would be right as well, since the form:

	q = csa = doms = NULL;

generates a compiler warning, as not all three pointers are the
same type.

So three lines of code it must be.

> > +	if (q && !IS_ERR(q))
> > +		kfree(q);
> > +	if (csa)
> 
> Don't need the conditional: kfree(NULL) is OK.

Yup - you're right - about the 'csa' check.

However the if(q ...) check is needed, because I have another bug
here.  I allocated 'q' using kfifo_alloc(), so must free using
kfifo_free (or else leak the kfifo buffer memory.)  Calls to
kfifo_free() have to guard against NULL pointers before the call.

Thanks, Randy!

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.925.600.0401
-
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