Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6380308ybe; Wed, 18 Sep 2019 02:29:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgUZdSpcELi2I3hA9T62LflrULIUxkskA0uzWZL89dvIyoZwMCnmjfTJJU/DrxEy6n5p/S X-Received: by 2002:a50:981b:: with SMTP id g27mr9218046edb.105.1568798985320; Wed, 18 Sep 2019 02:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568798985; cv=none; d=google.com; s=arc-20160816; b=0SpHSj/9htZHJ6SKNxzhtFmQpJqHD+qPLg++XneIYeyUp/H0vGd5kOpnaDjVfSoOGw wNtWMIKDFWnRmBtana8jaxum8ukbMwiSra9x/nNOmP6+lia7t7iX1XzfzVfFtsvs7u9H maKvZSmsgCd8Kd9GeNoOGsZcYIBPovGP5FQgmZeoEY+CLD+0hGJOuD1WbuRwI3QuizZU F+qakTryJlnttOWxi5A0TjWYQWu150yolTn/AjMtvUrRcgRK5AWQ0ndRxJu37Z1ZC10q 5v0zr1hMzi/Rig4br4CTk65sjD45WYpMoJDRpRcyT4VfwmkxQ9V4qB4WSN3Hk3VwzQBe /Wjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=OCJVbL9aA3idHeqqiDplT4j2hMALjz6K4f6YYAPuAj8=; b=I/0t+OnosG/NnHBL/XswkVV+uYxenOkhlmSlnm9jCr2GNeHPVHYwa8kbCbfejhT7eP kyMWjTRbser+oCBOfPBiu4jaesqvuZWdoGGSjA+Mm+tZZ9r3iBIlhETVfjlWGEc0XqMV i1wJRgHR3MEpoWsZOA3JzY6P6c6kmolikx1jWq75rdF2+OmBevqPnqFiM+YK8fSFhRUt kC7LBfjZg0N4rYggDrHcl8KWo4NERrQ9It1m3H7hc2DWM+0x5+1xg5YS/Vjq3IUqSa7v 3G7U3/xf5pHNTAtkXfD74Cn2/Iqu3TCcEvQ+dq6TJ9BNNdcvQEuVGnuoLb0TpMiuYoyt vNKg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si2462085ejb.393.2019.09.18.02.29.21; Wed, 18 Sep 2019 02:29:45 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728642AbfIRIC7 (ORCPT + 99 others); Wed, 18 Sep 2019 04:02:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51148 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728338AbfIRIC7 (ORCPT ); Wed, 18 Sep 2019 04:02:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D593230B2502; Wed, 18 Sep 2019 08:02:58 +0000 (UTC) Received: from [10.72.12.58] (ovpn-12-58.pek2.redhat.com [10.72.12.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3201600C8; Wed, 18 Sep 2019 08:02:56 +0000 (UTC) Subject: Re: [RFC PATCH] memalloc_noio: update the comment to make it cleaner To: Michal Hocko Cc: mingo@redhat.com, peterz@infradead.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org References: <20190917232820.23504-1-xiubli@redhat.com> <20190918072542.GC12770@dhcp22.suse.cz> From: Xiubo Li Message-ID: <315246db-ec28-f5e0-e9b3-eba0cb60b796@redhat.com> Date: Wed, 18 Sep 2019 16:02:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20190918072542.GC12770@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 18 Sep 2019 08:02:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/18 15:25, Michal Hocko wrote: > 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. Yeah, it true. > 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. The "Documentation/core-api/gfp_mask-from-fs-io.rst" is already very detail about them all. This fixing just means to make sure that it won't surprise someone who is having a quickly through some code and not familiar much about the detail. It may make not much sense ? Thanks, BRs Xiubo >> 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