Re: [PATCH] vmallocinfo: Add NUMA informations

From: Pekka Enberg
Date: Mon Jun 09 2008 - 17:14:43 EST


On Tue, Jun 10, 2008 at 12:05 AM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> 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.

I think it was out-of-line at first but then somebody made it inline
as an optimization...

On Tue, Jun 10, 2008 at 12:05 AM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> otoh, there's one good thing about kcalloc: it actually checks for
> multiplicative overflows, whereas the open-coded version often forgets
> to do that.

Yes. That's why we did kcalloc() in the first place. kzalloc() (aka
akpmalloc) came in much later.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/