Received: by 10.213.65.68 with SMTP id h4csp2669054imn; Mon, 9 Apr 2018 07:14:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iY4YFMZ26AmPB0qUTo+KZ3DAH48AwZUq27tJysMCBXzmonh1AT0YcdmP84X1E2+ZJ4qRM X-Received: by 10.98.36.76 with SMTP id r73mr29518929pfj.108.1523283291337; Mon, 09 Apr 2018 07:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523283291; cv=none; d=google.com; s=arc-20160816; b=RWcqGWIzlXkZnYL6TZMwKw6AX+hcV5PsSFHVSuGmMIStQh9384EIrEAZYok4qhAZvr wzwGvOlft+Y3KsoLFCclt+kvpFTLk/crgUZlwR3rtc1e7uzEq+1tRqHMLZ3X5kBZISQc 2Ss+YP+KtyNtSFwgFtF0bbcaYUGV9ss9hZBwRgec85/36lI2Ym941UqPvrIu/Iku1Px9 rMPUKkHq3zGpI8teu/ETrTU9+lK8Svdp82eoy8ioKDMNRrbVXaw78BJujCM7U9QIs3z2 A6azKXuRWhONlR83F+zeDIdaGtQWqrNOxcpqMHi0wMCdJjcwKFsdOjJzD5Yblrzq2G2X 3+SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=7uxY8HMSNW3BRlMmqQ8Y3QTCFhRRhA7z2A493cGzhiM=; b=ovoMxivb6OaNmf6t+jZCZOHnasowqg+oRTyn9uFV9xS8DSCrC54KQPgbn/dQ2UW6PK 1LiOZCIJqSM7fTUSSUVV/qRfIyEQBaRmQxrx6KVYig/eHe33/77esAlMD9lGmwkj2Mz2 fpHNrnJtPXTesqeH53Ty2O4a2lCvIejuJqUuDuTltV9X4gjQr61x5puxBA+efj1Cxqso dVRg9sYrbVt8cY+9iKePaQLvyUkjsaCq9Sw+04gnx1IbeVL9PHZ2DuWUZu9JBGKv9ftP mgoJ/Rw3mqSGMayr+KFyDhBHvuCUpxbPPbCI282rRPQ55UbHqp/BZShhBxqpb9c8s608 buJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g5CbG/IY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97-v6si360597plm.548.2018.04.09.07.14.14; Mon, 09 Apr 2018 07:14:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g5CbG/IY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbeDIOKr (ORCPT + 99 others); Mon, 9 Apr 2018 10:10:47 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38057 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbeDIOKp (ORCPT ); Mon, 9 Apr 2018 10:10:45 -0400 Received: by mail-pf0-f193.google.com with SMTP id y69so5827657pfb.5; Mon, 09 Apr 2018 07:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=7uxY8HMSNW3BRlMmqQ8Y3QTCFhRRhA7z2A493cGzhiM=; b=g5CbG/IYwQV2fw4cKZ4jS+qYIJpFSsM8S20D4/MHGrJQkktjncJuQdpYGtEzB9H/7d UoU/91J+FJXFKj5OtiLx9fJnOGOZtm0vN1cWVcfqFlCXevE8ZOofToNNANys4vxCwIcv k6eGxmD7telJMHqKaHuTJJA9iO3sRzL8pEMLR0gAOrjVE3xC07dh1xikLoGAdxSnSt4m KUY5wSEC2X3xSUwvQsfIyXimXiDi42I1eDOvPUSio9Q9uexeiaTFONZLTM7I7ZEWOxdK 4qbaah29c198wd88NU47Z8nr1GCV07KB2djQ319AF9zMn9XKF5Kxpki6Z3Lj20WyJVFr 48Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7uxY8HMSNW3BRlMmqQ8Y3QTCFhRRhA7z2A493cGzhiM=; b=KJb6+jAZg9Ba6hOUmwRoBYq2wilVD5sEQIky0TOB0i/JKf8qdf+syJnkcnmyHK2BXv W1PPFyIp3Q+1szGrxeoo6YKr8Fw2bAh9MIDC+lXUVx1Vhogqmu3uNkiHI/1TsOCUEO+v 3EPI7Rs6ue/aARuUTxGJz6S2c+R5mhv/GNKZpIiA7Oga8xD9PKe1c7uKfA+RiBKYHdZh spZ9vZg8MEAbdLKZ7TYzaKeXSwToawFEVAFdyf3ZxplX0eMpRmK1TDyMrHLQuN0tcRbZ cG8zOJkcEz71GTZonnbaXvFY+kgR/Bvkl8rXCgHjJvHEC+o/qWAQzMgsa/YuAbPDxLnZ ZTYg== X-Gm-Message-State: AElRT7G8yuIq/cQhp+1rTh8JFKgoNKIaCO2Vlpfq3US06JE70GgzzVH0 64jbwKXKORf6laTSBHKYVeY= X-Received: by 10.101.83.199 with SMTP id z7mr20562758pgr.165.1523283044994; Mon, 09 Apr 2018 07:10:44 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id g11sm1027861pgu.56.2018.04.09.07.10.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 07:10:44 -0700 (PDT) From: Jia-Ju Bai To: davem@davemloft.net, kafai@fb.com, weiwan@google.com, dsa@cumulusnetworks.com, johannes.berg@intel.com, fw@strlen.de Cc: linux-decnet-user@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: decnet: Replace GFP_ATOMIC with GFP_KERNEL in dn_route_init Date: Mon, 9 Apr 2018 22:10:35 +0800 Message-Id: <1523283035-25639-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dn_route_init() is never called in atomic context. The call chain ending up at dn_route_init() is: [1] dn_route_init() <- decnet_init() decnet_init() is only set as a parameter of module_init(). Despite never getting called from atomic context, dn_route_init() calls __get_free_pages() with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, to avoid busy waiting and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- net/decnet/dn_route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 0bd3afd..59ed12a 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -1898,7 +1898,7 @@ void __init dn_route_init(void) while(dn_rt_hash_mask & (dn_rt_hash_mask - 1)) dn_rt_hash_mask--; dn_rt_hash_table = (struct dn_rt_hash_bucket *) - __get_free_pages(GFP_ATOMIC, order); + __get_free_pages(GFP_KERNEL, order); } while (dn_rt_hash_table == NULL && --order > 0); if (!dn_rt_hash_table) -- 1.9.1