public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
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: Tue, 19 Dec 2017 16:40:35 +0800	[thread overview]
Message-ID: <40ddf089-df5f-e6ae-6ec6-58849e6c9ceb@gmail.com> (raw)
In-Reply-To: <20171218090529.5782a91d@xeon-e3>


On 2017/12/19 1:05, Stephen Hemminger wrote:
> 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?

I think kcalloc can be used here.


Thanks,
Jia-Ju Bai

      reply	other threads:[~2017-12-19  8:41 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
2017-12-19  8:40   ` Jia-Ju Bai [this message]

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=40ddf089-df5f-e6ae-6ec6-58849e6c9ceb@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephen@networkplumber.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