public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map
Date: Mon, 18 Dec 2017 09:05:29 -0800	[thread overview]
Message-ID: <20171218090529.5782a91d@xeon-e3> (raw)
In-Reply-To: <1513587772-8039-1-git-send-email-baijiaju1990@gmail.com>

On Mon, 18 Dec 2017 17:02:52 +0800
Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> The kzalloc function is called with GFP_ATOMIC.
> But according to driver call graph, it is not in atomic context,
> namely no spinlock is held nor in an interrupt handler.
> 
> This GFP_ATOMIC is unnecessary, and replace with GFP_KERNEL.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
>  drivers/hv/hv.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
> index 8267439..b0d025a 100644
> --- a/drivers/hv/hv.c
> +++ b/drivers/hv/hv.c
> @@ -150,7 +150,7 @@ int hv_synic_alloc(void)
>  	int cpu;
>  
>  	hv_context.hv_numa_map = kzalloc(sizeof(struct cpumask) * nr_node_ids,
> -					 GFP_ATOMIC);
> +					 GFP_KERNEL);
>  	if (hv_context.hv_numa_map == NULL) {
>  		pr_err("Unable to allocate NUMA map\n");
>  		goto err;

Thanks, for fixing this.
While you are at it; wouldn't it make sense to use kcalloc here?

  reply	other threads:[~2017-12-18 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  9:02 [PATCH V2] hyper-v: use GFP_KERNEL for hv_context.hv_numa_map Jia-Ju Bai
2017-12-18 17:05 ` Stephen Hemminger [this message]
2017-12-19  8:40   ` Jia-Ju Bai

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=20171218090529.5782a91d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=baijiaju1990@gmail.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.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