public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, cl@linux-foundation.org,
	kamezawa.hiroyu@jp.fujitsu.com, lizf@cn.fujitsu.com,
	mingo@elte.hu, yinghai@kernel.org
Subject: Re: [GIT PULL v2] Early SLAB fixes for 2.6.31
Date: Tue, 16 Jun 2009 06:57:04 +0200	[thread overview]
Message-ID: <20090616045704.GC28596@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0906151329310.24256@sister.anvils>

On Mon, Jun 15, 2009 at 01:38:12PM +0100, Hugh Dickins wrote:
> On Mon, 15 Jun 2009, Nick Piggin wrote:
> > On Mon, Jun 15, 2009 at 08:45:27PM +1000, Benjamin Herrenschmidt wrote:
> > > On Mon, 2009-06-15 at 12:27 +0200, Nick Piggin wrote:
> > > > Init code doesn't deserve to be more lazy than anybody else, and
> > > > part of the reason why such a core piece of code is so crufty
> > > > is exactly because people have been lazy there.
> > > 
> > > I think the main problem isn't necessarily init code per se, but the
> > > pile of -common- code that can be called both at init time and later.
> > 
> > Just seems bogus argument. Everwhere else that does this (ie.
> > allocations that are called from multiple allocation contexts)
> > passes correct gfp flags down.
> 
> Fair enough that you jealously defend SL?B code from onslaught, but
> FWIW I strongly agree with Ben on all this.  I cannot see the point
> of the pain of moving around SL?B versus bootmem, if we immediately
> force such a distinction (differently dressed) upon their users again.

Well, it is a good idea for other reasons too, not just to
relieve the author of the distinction.

But the distinction now is much smaller. It is not a case of
allocfn()
{
  if (system_state == something crazy)
   alloc_bootmem
  else
   kmalloc
}

freefn()
{
 if (object was kmalloced)
  kfree
}

It is now this:
allocfn(gfp)
{
 kmalloc(gfp)
}

> I fully agree with Ben that it's the job of the allocator to provide
> a service, and part of that job to understand its own limitations at
> different stages of running.

Yes but that's heavily qualified. As I said, we already require
a lot of knowledge of context passed in to it. I have no interest
in adding code to make *early boot* code not have to care about
that, especially because everybody else certainly has to know
whether they are calling the allocator with interrupts disabled
or a lock held etc.

To be clear about this: the allocator is fully servicable and
no different to normal system running at this point. The
difference for example is that code runs with interrupts off
but incorrectly uses GFP_KERNEL for allocations. This is a
blatent bug in any other kernel code, I don't know why boot
code is OK to be horrible and wrong and work around it with
the equally horrible system_state (and this gfp mask which is
just system_state under another name).

I just don't want to use this slab fix in question to be a
license to throw away and forget all about any context information
in the early boot code because someone asserts "it will make the
code better".  I'm fine with the slab change for now, but let's
try to retain context information as well.

If somebody comes up with a patch to remove thousands of lines
of boot code by ignoring context, then I might concede the
point and we could remove the context annotations.


  parent reply	other threads:[~2009-06-16  4:57 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12 13:25 [GIT PULL] Early SLAB fixes for 2.6.31 Pekka J Enberg
2009-06-12 13:38 ` Benjamin Herrenschmidt
2009-06-12 13:45   ` Pekka Enberg
2009-06-12 14:30     ` Christoph Lameter
2009-06-12 16:16 ` [GIT PULL v2] " Pekka J Enberg
2009-06-12 17:30   ` Christoph Lameter
2009-06-12 21:46     ` Benjamin Herrenschmidt
2009-06-15  6:46       ` Nick Piggin
2009-06-15  9:10         ` Pekka Enberg
2009-06-15  9:38           ` Nick Piggin
2009-06-15 14:43       ` Christoph Lameter
2009-06-14  7:12     ` Pekka J Enberg
2009-06-15 14:55       ` Christoph Lameter
2009-06-15 14:58         ` Pekka Enberg
2009-06-15 15:05           ` Christoph Lameter
2009-06-15 15:11             ` Pekka Enberg
2009-06-15 15:27               ` Pekka Enberg
2009-06-15 15:51                 ` Christoph Lameter
2009-06-15 15:57                   ` Pekka Enberg
2009-06-15 16:08                     ` Christoph Lameter
2009-06-15 17:15                 ` Linus Torvalds
2009-06-15 18:19                   ` Pekka Enberg
2009-06-15 15:48               ` Christoph Lameter
2009-06-15  8:18   ` Heiko Carstens
2009-06-15  8:26     ` Nick Piggin
2009-06-15  8:32       ` Pekka Enberg
2009-06-15  8:52         ` Nick Piggin
2009-06-15  9:08           ` Pekka Enberg
2009-06-15 10:20             ` Heiko Carstens
2009-06-15 10:21               ` Pekka Enberg
2009-06-15 10:31                 ` Nick Piggin
2009-06-15 10:36                   ` Pekka Enberg
2009-06-15  9:10     ` Pekka Enberg
2009-06-15  9:41       ` Nick Piggin
2009-06-15  9:48         ` Pekka Enberg
2009-06-15  9:59           ` Nick Piggin
2009-06-15  9:51         ` Benjamin Herrenschmidt
2009-06-15  9:57           ` Pekka Enberg
2009-06-15 10:27             ` Nick Piggin
2009-06-15 10:45               ` Benjamin Herrenschmidt
2009-06-15 11:23                 ` Nick Piggin
2009-06-15 12:38                   ` Hugh Dickins
2009-06-15 13:07                     ` Pekka Enberg
2009-06-16  4:57                     ` Nick Piggin [this message]
2009-06-16  5:28                       ` Benjamin Herrenschmidt
2009-06-16  5:36                         ` Nick Piggin
2009-06-16 15:12                           ` Christoph Lameter
2009-06-16 15:59                             ` Nick Piggin
2009-06-15 21:31                   ` Benjamin Herrenschmidt
2009-06-16  4:46                     ` Nick Piggin
2009-06-16  5:18                       ` Benjamin Herrenschmidt
2009-06-16  5:29                         ` Nick Piggin
2009-06-16 18:45                       ` Linus Torvalds
2009-06-17  7:47                         ` Nick Piggin
2009-06-17 16:01                           ` Linus Torvalds
2009-06-17 16:17                             ` Nick Piggin
2009-06-17 21:39                             ` Benjamin Herrenschmidt
2009-06-15 10:12           ` Nick Piggin
2009-06-15 10:39             ` Benjamin Herrenschmidt
2009-06-15 11:22               ` Nick Piggin
2009-06-15 11:28                 ` Nick Piggin
2009-06-15 11:38                   ` Nick Piggin
2009-06-15 21:37                     ` Benjamin Herrenschmidt
2009-06-16  4:42                       ` Nick Piggin
2009-06-15 21:32                   ` Benjamin Herrenschmidt
2009-06-16 15:08                     ` Christoph Lameter
2009-06-16 19:10                       ` Linus Torvalds
2009-06-16 19:23                         ` Christoph Lameter
2009-06-16 19:33                           ` Linus Torvalds
2009-06-16 19:48                             ` Christoph Lameter
2009-06-17  5:18                             ` Pekka Enberg
2009-06-17 16:45                               ` Linus Torvalds
2009-06-18  2:00                                 ` Benjamin Herrenschmidt
2009-06-18  3:24                                   ` Benjamin Herrenschmidt
2009-06-18  6:01                                     ` Pekka Enberg
2009-06-18  8:52                                       ` Benjamin Herrenschmidt
2009-06-16 21:58                         ` Benjamin Herrenschmidt
2009-06-16 22:06                           ` Linus Torvalds
2009-06-16 22:51                             ` Benjamin Herrenschmidt

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=20090616045704.GC28596@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux-foundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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