Received: by 10.213.65.68 with SMTP id h4csp2778543imn; Mon, 9 Apr 2018 08:54:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx486cfrSMJaP3QKk58822AO/aPcTjKARUAovDjM+a/qrSc7e2dF//69ta/B/7eptP8mGQq2P X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr39520108plb.54.1523289249431; Mon, 09 Apr 2018 08:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523289249; cv=none; d=google.com; s=arc-20160816; b=N9QcJYvXJiRM96SwRdWFSouNX7UAGo1ISeFOoUa37r8uKEqh97M3S1IeH9QVzEsjZJ /gMrnKH+icBRlM/Oe3Xx/Ss9aUHBllqmV22ITBeWoZsFOZ///nQklbU6LrUr4vmUki5C q1akcIvMvC04lWiOeq46GYfC3K54NS7qOLUc7L/UWUFc6UR6uPLTlFMIH7Jqf7EmYLKc f9UYuOTgPR9mWfePNhnLBCmadILECoY0y4mf+f2gIfQu9T3oHAulyy1itL6g71WiZ14d xtrXP6YUO2+E13TgGllcPlXmS7g/FpKOEOPXde99TkjbqdfHEB19YFuOJPoHgelMkVNQ oPnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=dlgteKCGZTClmaWiiJwT7oraYWQ17qGwk0FWja56UhA=; b=k8v1O3Q+bCRTG9Mde6Jalmt7bjluuxnsFHuCArD78V6S4RdjWpB34fpf7BZcvI58s6 CLfzIimzaKkkNTTRgj4AppuzikWeQyfOm0JEQRqhpCtDcBfbzDM9yqxqhjgg+ePdfzAt voCwWYACUEK+FjXED0cdQ2704DXVG2aAkpGp6/7xny/CbMBtO8TUwXf2K1kqgcb/5z/H SJzLx8sFJoqmm43mq1ApFC5ehccVMsiNQ7Sd+6Rs3iQou5H7AFVxX031VJRXvkwrf4MP /wW7x849oAz8NWEGa0WGE/opkhgbOiZheqqMKCG3gk+Luv6x/5BxRjFq+A7lXjASRTfb 1XBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si449613pfn.62.2018.04.09.08.53.32; Mon, 09 Apr 2018 08:54:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753062AbeDIPtS (ORCPT + 99 others); Mon, 9 Apr 2018 11:49:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:56647 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751902AbeDIPtR (ORCPT ); Mon, 9 Apr 2018 11:49:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8CE55AEEE; Mon, 9 Apr 2018 15:49:16 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 5C16E1E0A24; Mon, 9 Apr 2018 17:49:16 +0200 (CEST) Date: Mon, 9 Apr 2018 17:49:16 +0200 From: Jan Kara To: Jia-Ju Bai Cc: jack@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: quota: Replace GFP_ATOMIC with GFP_KERNEL in dquot_init Message-ID: <20180409154916.mp5jznkgvxk4a4ti@quack2.suse.cz> References: <1523284279-25940-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523284279-25940-1-git-send-email-baijiaju1990@gmail.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09-04-18 22:31:19, Jia-Ju Bai wrote: > 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 Thanks, I have added the patch to my tree. Honza > --- > 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 > > -- Jan Kara SUSE Labs, CR