Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757709AbdLRIJE (ORCPT ); Mon, 18 Dec 2017 03:09:04 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:38877 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbdLRIJC (ORCPT ); Mon, 18 Dec 2017 03:09:02 -0500 X-Google-Smtp-Source: ACJfBot0JrarfHhCAxRH5Rq3uFYOD5PVbuMVP9IlyFDz0sDenqCV4ypRKal53WafF7ZYuGKSpQqr9g== From: Jia-Ju Bai To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] hv: Fix unnecessary sleeping in hv_synic_alloc Date: Mon, 18 Dec 2017 16:11:35 +0800 Message-Id: <1513584695-6742-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 763 Lines: 26 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; -- 1.7.9.5