Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6366361ybe; Wed, 18 Sep 2019 02:13:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzSz9RciO8E0ZCUuJmeUTTo/AGxMApwKUhJ31bOdqswDddiYtGDdFu1KEoAi96U+HCR8pw X-Received: by 2002:a50:8a9d:: with SMTP id j29mr9293968edj.283.1568797983076; Wed, 18 Sep 2019 02:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568797983; cv=none; d=google.com; s=arc-20160816; b=Ut98zdfHEOdBQCiwfGQYLgPGT4s8/cLy7oH7QcCcu3xNpYn3cKtP3ocDuE+H8Em0lF 23kkyXxD2wMfPC4JwyFR0FVpno1kel8D4bmUIs5IfK90HeeoNvC4kLHpiFPVwdujTLm+ sUXNq1SS8fF2np1On9w9Yqt9DGxjVxfztStszNnf9nagjrofDbHzoNwesiMwCTwBbNhb rcUPhjYxx4UZi7BhAaSs0aplXtQKmFENX7MCZVT8wd9FLLHM5MoFIi9vLXcvUA/HVcrq CnxSnKlb6zUsz67aYK8bsLziYijTudeIUiZedGecuhfq9mBsngMIbAplshmfoe57lmXc bOWw== 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; bh=xyKDS82JdnL2GNFWCXsoqnR92MmiXQmYm9j7jonYtxY=; b=QbMrQ5I2mQKQK56bk4wAaQZ8DNU4u48gKLHmrDLP3kwj8TF/esrYOn7VYhdW4Wfd/b 2dmFAAyOdJk9F668PyoVJeKVn1AmuR+ARAms/OtafeQPKRLhKm9cFEHZbW8wFWvxuHUk p7lAphmMHIhtjUKngFhGtseOA9qEDPzhhljCIplnmvkWQvLp6yq+g8IVTB9gV9U0+4pz HKBpI38eTncFHd6wZukSAmF7g45JISsdjKdiVRGph5/rozyJ9KTBW2nzBVkkgiB7aDSy YkbRxGPJgYSWFJonpffuTL5SlEDmU5sX1cx8TRKeBpVATfSnzb/0G5rizg7Pma9RGwjA EIzw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si537683edq.65.2019.09.18.02.12.38; Wed, 18 Sep 2019 02:13:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728905AbfIRHZq (ORCPT + 99 others); Wed, 18 Sep 2019 03:25:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:36264 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728599AbfIRHZp (ORCPT ); Wed, 18 Sep 2019 03:25:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2E9AAAD26; Wed, 18 Sep 2019 07:25:43 +0000 (UTC) Date: Wed, 18 Sep 2019 09:25:42 +0200 From: Michal Hocko To: xiubli@redhat.com Cc: mingo@redhat.com, peterz@infradead.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] memalloc_noio: update the comment to make it cleaner Message-ID: <20190918072542.GC12770@dhcp22.suse.cz> References: <20190917232820.23504-1-xiubli@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917232820.23504-1-xiubli@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 18-09-19 04:58:20, xiubli@redhat.com wrote: > From: Xiubo Li > > The GFP_NOIO means all further allocations will implicitly drop > both __GFP_IO and __GFP_FS flags and so they are safe for both the > IO critical section and the the critical section from the allocation > recursion point of view. Not only the __GFP_IO, which a bit confusing > when reading the code or using the save/restore pair. Historically GFP_NOIO has always implied GFP_NOFS as well. I can imagine that this might come as an surprise for somebody not familiar with the code though. I am wondering whether your update of the documentation would be better off at __GFP_FS, __GFP_IO resp. GFP_NOFS, GFP_NOIO level. This interface is simply a way to set a scoped NO{IO,FS} context. > Signed-off-by: Xiubo Li > --- > include/linux/sched/mm.h | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h > index 4a7944078cc3..9bdc97e52de1 100644 > --- a/include/linux/sched/mm.h > +++ b/include/linux/sched/mm.h > @@ -211,10 +211,11 @@ static inline void fs_reclaim_release(gfp_t gfp_mask) { } > * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope. > * > * This functions marks the beginning of the GFP_NOIO allocation scope. > - * All further allocations will implicitly drop __GFP_IO flag and so > - * they are safe for the IO critical section from the allocation recursion > - * point of view. Use memalloc_noio_restore to end the scope with flags > - * returned by this function. > + * All further allocations will implicitly drop __GFP_IO and __GFP_FS > + * flags and so they are safe for both the IO critical section and the > + * the critical section from the allocation recursion point of view. Use > + * memalloc_noio_restore to end the scope with flags returned by this > + * function. > * > * This function is safe to be used from any context. > */ > -- > 2.21.0 -- Michal Hocko SUSE Labs