[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705151642530.3886@schroedinger.engr.sgi.com>
Date: Tue, 15 May 2007 16:45:22 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: mroos@...ux.ee, David Miller <davem@...emloft.net>,
sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: slab hang on boot
On Tue, 15 May 2007, Andrew Morton wrote:
> On Mon, 14 May 2007 16:46:17 -0700 (PDT)
> Christoph Lameter <clameter@....com> wrote:
>
> > @@ -86,6 +87,9 @@ static inline int kmalloc_index(int size
> > */
> > WARN_ON_ONCE(size == 0);
> >
> > + if (size >= (1UL << KMALLOC_SHIFT_HIGH))
> > + return -1;
> > +
>
> I don't quite understand why we did this. The subsequent logic in
> kmalloc_index() should return -1 for this `size' anyway. If it doesn't,
> it's bust, isn't it?
KMALLOC_SHIFT_HIGH is not a constant but may be less than 25.
> Also, afaict kmalloc_slab() will totally mishandle the -1 return value and
> will return a garbage kmem_cache*, via
>
> return &kmalloc_caches[index];
It does an
if (index < 0)
before getting to that statement.
> Could you double-check it all please?
It was already checked.
-
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