From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761164AbXEOXph (ORCPT ); Tue, 15 May 2007 19:45:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760792AbXEOXpY (ORCPT ); Tue, 15 May 2007 19:45:24 -0400 Received: from netops-testserver-4-out.sgi.com ([192.48.171.29]:38862 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760748AbXEOXpW (ORCPT ); Tue, 15 May 2007 19:45:22 -0400 Date: Tue, 15 May 2007 16:45:22 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Andrew Morton cc: mroos@linux.ee, David Miller , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: slab hang on boot In-Reply-To: <20070515163321.744e2388.akpm@linux-foundation.org> Message-ID: References: <20070514.151148.45744375.davem@davemloft.net> <20070515163321.744e2388.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 May 2007, Andrew Morton wrote: > On Mon, 14 May 2007 16:46:17 -0700 (PDT) > Christoph Lameter 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.