[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLEdSr983jQ00_YuSWr3=pfmQHbebX87347K6v1HoCiyLw@mail.gmail.com>
Date: Tue, 14 Feb 2012 22:58:08 +0200
From: Pekka Enberg <penberg@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Christoph Lameter <cl@...ux.com>, Xi Wang <xi.wang@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Jesper Juhl <jj@...osbits.net>, Jens Axboe <axboe@...nel.dk>,
linux-kernel@...r.kernel.org, Matt Mackall <mpm@...enic.com>,
David Rientjes <rientjes@...gle.com>
Subject: Re: Uninline kcalloc
On Tue, Feb 14, 2012 at 10:45 PM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Tue, 14 Feb 2012 13:33:40 -0600 (CST)
> Christoph Lameter <cl@...ux.com> wrote:
>
>> Subject: Uninline kcalloc
>>
>> kcalloc is not used in performance critical ways. So it does not need to
>> be inline. If we would add diagnostics to track the overflow occurrences
>> then such code would be replicated at all call sites in the kernel.
>
> Uninlining kcalloc() seems reasonable. But if we're going to uninline
> kcalloc() then we also should uninline kmalloc_array().
Well, kcalloc() used to be uninline and we made it inline on purpose
at some point. I don't have a git tree here so I can't check. IIRC it
had something to do with kernel text size reduction.
> And yes, it's still called kmalloc_array() in my tree. I've been
> following this discussion for N days waiting for a reason for changing
> the original patch and I ain't seen one yet.
Me neither. I don't think Christoph's SAFE_ARRAY_SIZE() suggestion
makes much sense, really. It's more verbose, less obvious API, and
doesn't really deal with the overflow case cleanly.
Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists