Received: by 10.213.65.68 with SMTP id h4csp2692668imn; Mon, 9 Apr 2018 07:35:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx48AYrHb7PUpniW6ZtMsD02cwvEifHtQZu3cGSPVguvz+WXmwuLadrKBXBmOCqNolJLNRJh6 X-Received: by 2002:a17:902:7e42:: with SMTP id a2-v6mr39117038pln.13.1523284549779; Mon, 09 Apr 2018 07:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523284549; cv=none; d=google.com; s=arc-20160816; b=YVCME6BEM7ui7jFh5xWE+9gSRBYmOI/L63kwQElDWTOZtZq4apO+pQWg7e3aYBZZB/ FyHR3HPD4Chj1iXd4P6lQQlzB4ejVZiF29mZCzpMyWnFfiV+ddjDtJ6xkYaavjJlUwhP hQjlh0+VoThvytVY49DFuuJ9P6RxXnKQjI4dILdyyMsIpI9b9Orsvw8M5J1h+7Ocnlza Ghho0h1J4XoMYWu3O03ngVUrIniKx0YeXte/Y2FA1eTIXriXNH8K1Mf3FtA7sj16v3rs O5/wpibUMDnXvpI5xC4GIVir/J0rb5J7WZ0xjv48kyLur07OEfe1rDuE2bYBGzCORBux U/pw== 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=MCJ6+WyZ1ULnsIHwWVwnooJvKRI+yslSyZ0grxMTFzg=; b=SNwByv1eJv59BzWXZrnYVqkBAEf7h5eF30Ikftzuo3VAS6sskaoTknaIE5Qj71AKsQ i4Lb7qQbsacJgNeiZ58Kbn/SiXlVYnkWFiw1m+hjDqRBIGO9OWSHeTUFbIWVuC6dkMEK QUPAqZ3ieS2hXcb8xNmxZtqZ/cTLo2v9plGXtbr/lUDBWInWdODV6AfJoH302P+8VKgf K60AWCOqwj12sufFV1YMuedB3eQUDnCB3Ar4oETZ5M/HkG9OE4K9gWFTSPgrHNfqr+ry MQJ8WKtWJWWGoYipZaHSzdYEqBP5cixDZRU2q2FjOwd+VjggqY6vzruUkANHqWdH1CHq f2Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TxdDD6s9; 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 f11-v6si409677plm.19.2018.04.09.07.35.12; Mon, 09 Apr 2018 07:35:49 -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=TxdDD6s9; 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 S1752718AbeDIObb (ORCPT + 99 others); Mon, 9 Apr 2018 10:31:31 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:35508 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298AbeDIOba (ORCPT ); Mon, 9 Apr 2018 10:31:30 -0400 Received: by mail-pl0-f65.google.com with SMTP id 61-v6so5264372plb.2 for ; Mon, 09 Apr 2018 07:31:30 -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=MCJ6+WyZ1ULnsIHwWVwnooJvKRI+yslSyZ0grxMTFzg=; b=TxdDD6s98DwwUGPJU2brKCDca3um4RcAEBQwxN+OvXRePOiQocd8x0kMnU95rXi+dc iEAc1pN8wu7vYFC1G0jjJ2LPHW1WZx8wEaB0JMrJSY13yZ6Gjp+TfrwokGjrUWo8Gjk/ TQ6SsL+E9ILF//KIHPDt85bIi/0fAjfThp7Kj6YKhhbdvMfIaya7aacSVuQy8MJuVteD Bn67+lbephAZQefJPp0suN7ARZ2ZqCFQQ5MohiRkSrYyAiA+0O0V9DxfHhSDM7PWkkDE EeGuy6yEfmPtnK7FOyKscxM1WuWqzqFK6KJDIgaWFkqVlK3pE2Pm9KAssD126HwGg3Gl nWaw== 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=MCJ6+WyZ1ULnsIHwWVwnooJvKRI+yslSyZ0grxMTFzg=; b=Iqq8M6b2Lg1Akf2ltLrcL6+yLgNQZeW8MQ2Alrjez9z4M/LUoQui22bcEcie2N6Yo9 mDeBl1ZBLRI5o0YwPqoyEyOJec/q7SakXJpPds4QDLTpVKjIozkKQfJ6CjhfzAdAbJSw rajMxs5SRv76IBx7y0EUiplyXF7R3d2rwCY9w5LNHhZLWKd+19h6T1/rZMAVRgSSHoye DBq5H2KHPQ1KsbxtbwF6FYq2123Lh3n2xDk9x5Q/6qVOdKfUQZifgFWsn5STfWh0zYUJ e0WBniV16w/SdZpauE1tNuJ3Gw3UoMPBsCS8lKxbpT8J2r+DRpiXMehpCfNHORq++8Uz 43Dw== X-Gm-Message-State: AElRT7GALygzpKbvGmkaec/Us1vTr6Q25wMbEwfVilt9TiXtkZKe2PxZ phgrCTxgKhCSUWVyFtql8gS1sg== X-Received: by 2002:a17:902:108a:: with SMTP id c10-v6mr39357287pla.22.1523284290120; Mon, 09 Apr 2018 07:31:30 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id f12sm1134002pgr.37.2018.04.09.07.31.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 07:31:29 -0700 (PDT) From: Jia-Ju Bai To: jack@suse.com Cc: linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] fs: quota: Replace GFP_ATOMIC with GFP_KERNEL in dquot_init Date: Mon, 9 Apr 2018 22:31:19 +0800 Message-Id: <1523284279-25940-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 dquot_init() is never called in atomic context. This function is only set as a parameter of fs_initcall(). Despite never getting called from atomic context, dquot_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 --- fs/quota/dquot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 8381db9..d6e111e 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2944,7 +2944,7 @@ static int __init dquot_init(void) NULL); order = 0; - dquot_hash = (struct hlist_head *)__get_free_pages(GFP_ATOMIC, order); + dquot_hash = (struct hlist_head *)__get_free_pages(GFP_KERNEL, order); if (!dquot_hash) panic("Cannot create dquot hash table"); -- 1.9.1