From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
sthemmin@microsoft.com, devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hv: Fix unnecessary sleeping in hv_synic_alloc
Date: Mon, 18 Dec 2017 16:58:20 +0800 [thread overview]
Message-ID: <55fd96a5-84f1-0b0a-c8b7-601a96f387e6@gmail.com> (raw)
In-Reply-To: <87r2rs76wr.fsf@vitty.brq.redhat.com>
On 2017/12/18 16:54, Vitaly Kuznetsov wrote:
> Jia-Ju Bai <baijiaju1990@gmail.com> writes:
>
>> 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;
> Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>
> The subject line is not very accurate: GFP_KERNEL you switch too is the
> one supporting 'sleep' when there's not enough memory, not
> GFP_ATOMIC so you don't actually "Fix unnecessary sleeping". I'd suggest
> you use something like "hyper-v: use GFP_KERNEL for hv_context.hv_numa_map"
>
Thanks for you suggestion :)
Okay, I found my description is not correct, too, sorry.
I will revise it and resubmit the patch.
Thanks,
Jia-Ju Bai
prev parent reply other threads:[~2017-12-18 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 8:11 Jia-Ju Bai
2017-12-18 8:54 ` Vitaly Kuznetsov
2017-12-18 8:58 ` 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=55fd96a5-84f1-0b0a-c8b7-601a96f387e6@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=sthemmin@microsoft.com \
--cc=vkuznets@redhat.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®