lkml.org 
[lkml]   [2008]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vmallocinfo: Add NUMA informations
On Mon, 9 Jun 2008 07:16:48 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:

> On Tue, 3 Jun 2008, Andrew Morton wrote:
>
> > > + if (NUMA_BUILD) {
> > > + unsigned int *counters, nr;
> > > +
> > > + counters = kzalloc(nr_node_ids * sizeof(unsigned int),
> >
> > This is kcalloc(). If you like that sorts of thing - I think kcalloc()
> > is pretty pointless personally.
>
> Same here. I think its generally ignored. I tried to remove it at some
> point in the past. If we want kcalloc then we also need kczalloc.

kcalloc() zeroes the returned memory - it's like calloc().

> It would
> be best to keep the interface simple.

yup. Oh well, it's not a big deal.

Except the inlined

if (n != 0 && size > ULONG_MAX / n)
return NULL;

is a bit bloaty/inefficient. I expect that it's often the case that
one of `n' and `size' is not a compile-time constant.

otoh, there's one good thing about kcalloc: it actually checks for
multiplicative overflows, whereas the open-coded version often forgets
to do that.



\
 
 \ /
  Last update: 2008-06-09 23:07    [W:0.124 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site