Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937051AbdLRRFh (ORCPT ); Mon, 18 Dec 2017 12:05:37 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44779 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935722AbdLRRFc (ORCPT ); Mon, 18 Dec 2017 12:05:32 -0500 X-Google-Smtp-Source: ACJfBovBeR3SsCTibk3w4bXG/zt19D5DJqpWbcWf4N3Rgj3p4ePZ7h2I7ERoaf44vIfd4q8TNt15tg== Date: Mon, 18 Dec 2017 09:05:29 -0800 From: Stephen Hemminger To: Jia-Ju Bai 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 Message-ID: <20171218090529.5782a91d@xeon-e3> In-Reply-To: <1513587772-8039-1-git-send-email-baijiaju1990@gmail.com> References: <1513587772-8039-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 969 Lines: 30 On Mon, 18 Dec 2017 17:02:52 +0800 Jia-Ju Bai 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 > --- > 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?