public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de•ibm.com>
To: Nick Piggin <npiggin@suse•de>
Cc: Sachin Sant <sachinp@in•ibm.com>,
	Pekka Enberg <penberg@cs•helsinki.fi>,
	Stephen Rothwell <sfr@canb•auug.org.au>,
	linux-next@vger•kernel.org, linux-s390@vger•kernel.org
Subject: Re: Next June 29: Boot failure with SLQB on s390
Date: Mon, 29 Jun 2009 16:12:34 +0200	[thread overview]
Message-ID: <20090629141234.GF9321@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20090629115835.GA2308@wotan.suse.de>

On Mon, Jun 29, 2009 at 01:58:35PM +0200, Nick Piggin wrote:
>  n Mon, Jun 29, 2009 at 01:50:38PM +0200, Heiko Carstens wrote:
> > On Mon, Jun 29, 2009 at 12:39:43PM +0200, Nick Piggin wrote:
> > > On Mon, Jun 29, 2009 at 12:31:23PM +0200, Heiko Carstens wrote:
> > > > On Mon, Jun 29, 2009 at 03:14:40PM +0530, Sachin Sant wrote:
> > > > > I still have problems booting next with SLQB on a s390 box.
> > > > >
> > > > > Write protected kernel read-only data: 0x12000 - 0x446fff
> > > > > Experimental hierarchical RCU implementation.
> > > > > Experimental hierarchical RCU init done.
> > > > > console ÝttyS0¨ enabled
> > > > > Unable to handle kernel pointer dereference at virtual kernel address (null)
> > > 
> > > This could I suppose be due to failed allocation where the caller
> > > isn't expecting failure (or using SLAB_PANIC).
> > > 
> > > Did you manage to test with the prink debugging patch for SLQB that
> > > I sent for the power6 boot failure? I don't think I saw a reply from
> > > you but maybe I missed it?
> > 
> > Could you send me the debug patch as well? I can give it a quick run as well.
> 
> This is what I had. It is only helpful for the power6
> failure where there was a problem in an allocation from
> kmem_cache_create.

slqb returns ZERO_SIZE_PTR instead of NULL for large size requests it cannot
handle.
The patch below would fix it. But I think its too ugly. So I leave it up to
Nick to come up with a real and nice patch ;)

diff --git a/include/linux/slqb_def.h b/include/linux/slqb_def.h
index 7b4a601..9d03485 100644
--- a/include/linux/slqb_def.h
+++ b/include/linux/slqb_def.h
@@ -187,7 +187,7 @@ static __always_inline int kmalloc_index(size_t size)
 	if (unlikely(!size))
 		return 0;
 	if (unlikely(size > 1UL << KMALLOC_SHIFT_SLQB_HIGH))
-		return 0;
+		return -1;
 
 	if (unlikely(size <= KMALLOC_MIN_SIZE))
 		return KMALLOC_SHIFT_LOW;
@@ -219,7 +219,7 @@ static __always_inline int kmalloc_index(size_t size)
 	if (size <= 512 * 1024) return 19;
 	if (size <= 1024 * 1024) return 20;
 	if (size <=  2 * 1024 * 1024) return 21;
-	return -1;
+	return -2;
 }
 
 #ifdef CONFIG_ZONE_DMA
@@ -239,8 +239,12 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
 	int index;
 
 	index = kmalloc_index(size);
-	if (unlikely(index == 0))
-		return ZERO_SIZE_PTR;
+	if (unlikely(index <= 0)) {
+		if (index == 0)
+			return ZERO_SIZE_PTR;
+		if (index == -1)
+			return NULL;
+	}
 
 	if (likely(!(flags & SLQB_DMA)))
 		return &kmalloc_caches[index];

  parent reply	other threads:[~2009-06-29 14:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29  6:48 linux-next: Tree for June 29 Stephen Rothwell
2009-06-29  9:44 ` Next June 29: Boot failure with SLQB on s390 Sachin Sant
2009-06-29 10:31   ` Heiko Carstens
2009-06-29 10:39     ` Nick Piggin
2009-06-29 11:50       ` Heiko Carstens
2009-06-29 11:58         ` Nick Piggin
2009-06-29 13:09           ` Heiko Carstens
2009-06-29 14:12           ` Heiko Carstens [this message]
2009-06-30  7:34             ` Nick Piggin
2009-06-30  9:06             ` Nick Piggin
2009-06-30  9:20               ` Pekka Enberg
2009-06-30  9:27                 ` Nick Piggin
2009-06-30  9:30                   ` Pekka Enberg
2009-06-30 10:09               ` Heiko Carstens
2009-06-30 10:29                 ` Nick Piggin
2009-06-30 10:57                   ` Pekka Enberg
2009-06-30  5:33       ` Sachin Sant
2009-06-30  8:34         ` Nick Piggin
2009-06-30 10:56           ` Sachin Sant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090629141234.GF9321@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de$(echo .)ibm.com \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux-s390@vger$(echo .)kernel.org \
    --cc=npiggin@suse$(echo .)de \
    --cc=penberg@cs$(echo .)helsinki.fi \
    --cc=sachinp@in$(echo .)ibm.com \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox