From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
Christoph Lameter <cl@linux-foundation.org>,
akpm@linux-foundation.org, kosaki.motohiro@jp.fujitsu.com,
mel@csn.ul.ie, riel@redhat.com, linux-kernel@vger.kernel.org,
mingo@elte.hu, rientjes@google.com
Subject: Re: [PATCH 2/2] SLUB: Use GFP_PANIC for early-boot allocations
Date: Fri, 8 May 2009 20:49:07 +0400 [thread overview]
Message-ID: <20090508164907.GM6132@lenovo> (raw)
In-Reply-To: <1241800267.6311.2969.camel@laptop>
[Peter Zijlstra - Fri, May 08, 2009 at 06:31:07PM +0200]
| On Fri, 2009-05-08 at 20:15 +0400, Cyrill Gorcunov wrote:
| > [Peter Zijlstra - Fri, May 08, 2009 at 05:50:58PM +0200]
| > | On Fri, 2009-05-08 at 18:45 +0300, Pekka Enberg wrote:
| > |
| > | > On Fri, 2009-05-08 at 17:42 +0200, Peter Zijlstra wrote:
| > | > > BUG_ON((gfp & __GFP_PANIC) && (system_state != STATE_BOOTING));
| > | >
| > | > There's no technical reason not to use GFP_PANIC when system_state !=
| > | > STATE_BOOTING so I don't think it's needed. It's just that GFP_PANIC
| > | > (and BUG_ON) is IMHO too harsh for create_unique_id().
| > |
| > | Shouldn't we handle every allocation failure after booting?
| >
| > Definitely
| >
| > |
| > | I think it _is_ a bug to panic on allocation failures once we're
| > | running.
| > |
| >
| > But Peter I believe there was no suggestion to use GFP_PANIC everywhere
| > to get rid of error handling. But rather to use it in case if kmalloc is
| > followed by BUG_ON.
|
| Well, what I'm saying is that that either is a genuine bug we should
| fix, or its boot code, which is exactly what my assertion above tests
| for.
Yes, I agree and didn't argue against actually (but most probably I
was not precise in words). There is no protection of using it wrong
or buggy way (to eliminate error paths but just panic). By adding
STATE_BOOTING we seem to protect ourself from such a case but then
we better rename it to something like GFP_BOOT_PANIC maybe? Since
from plain GFP_PANIC it's not clear, hmm?
|
| I really believe GFP_PANIC usage outside of system_state ==
| STATE_BOOTING is a bug we should fix. Not create a better syntax for.
|
| What code outside of booting is allowed to bring down the kernel on an
| allocation failure?
|
-- Cyrill
next prev parent reply other threads:[~2009-05-08 16:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 15:10 Pekka Enberg
2009-05-08 15:23 ` Cyrill Gorcunov
2009-05-08 15:28 ` Christoph Lameter
2009-05-08 15:36 ` Pekka Enberg
2009-05-08 15:42 ` Peter Zijlstra
2009-05-08 15:45 ` Pekka Enberg
2009-05-08 15:50 ` Peter Zijlstra
2009-05-08 16:15 ` Cyrill Gorcunov
2009-05-08 16:31 ` Peter Zijlstra
2009-05-08 16:42 ` Christoph Lameter
2009-05-08 16:49 ` Cyrill Gorcunov [this message]
2009-05-09 8:30 ` Ingo Molnar
2009-05-08 15:42 ` Pekka Enberg
2009-05-09 8:30 ` Ingo Molnar
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=20090508164907.GM6132@lenovo \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
/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
all inboxes | Powered by JetHome®