All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugobjects: Use GFP_ATOMIC to allocate when initializing
Date: Sun, 1 Apr 2012 10:17:06 +0800	[thread overview]
Message-ID: <20120401021706.GA21615@zhy> (raw)
In-Reply-To: <1333228972-4594-1-git-send-email-levinsasha928@gmail.com>

On Sat, Mar 31, 2012 at 05:22:52PM -0400, Sasha Levin wrote:
> During the init stage, we have only 1 cpu and run with IRQs disabled,

debug_objects_mem_init() is called after local_irq_enable() in
start_kernel()

> we can't allocate with GFP_KERNEL.
> 
> This also fixes the related warning on boot.

Not sure how you get that.

Thanks,
Yong


> 
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
>  lib/debugobjects.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/debugobjects.c b/lib/debugobjects.c
> index 0ab9ae8..ece5e06 100644
> --- a/lib/debugobjects.c
> +++ b/lib/debugobjects.c
> @@ -1020,7 +1020,7 @@ static int __init debug_objects_replace_static_objects(void)
>  	int i, cnt = 0;
>  
>  	for (i = 0; i < ODEBUG_POOL_SIZE; i++) {
> -		obj = kmem_cache_zalloc(obj_cache, GFP_KERNEL);
> +		obj = kmem_cache_zalloc(obj_cache, GFP_ATOMIC);
>  		if (!obj)
>  			goto free;
>  		hlist_add_head(&obj->node, &objects);
> -- 
> 1.7.8.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Only stand for myself

  reply	other threads:[~2012-04-01  2:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 21:22 [PATCH] debugobjects: Use GFP_ATOMIC to allocate when initializing Sasha Levin
2012-04-01  2:17 ` Yong Zhang [this message]
2012-04-01 17:36 ` Thomas Gleixner
2012-04-01 17:53   ` Sasha Levin
2012-04-02  9:12     ` Thomas Gleixner
2012-04-02 18:35       ` Peter Zijlstra
2012-04-02 18:38         ` Pekka Enberg
2012-04-02 19:05         ` Sasha Levin

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=20120401021706.GA21615@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.