Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3295401imm; Tue, 29 May 2018 04:54:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpICr5kLqFrEn70CTEumzSqAK7IqDcC+ZVFGtKqqAXmIoCnEz/ccIrbzlHJQAcwDwotJmNw X-Received: by 2002:a62:4353:: with SMTP id q80-v6mr17136899pfa.228.1527594877327; Tue, 29 May 2018 04:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527594877; cv=none; d=google.com; s=arc-20160816; b=UAOo3iCTH1cPEt33o8WzuqMP9jgQpYPEBT7uccnDF4Lu+NWer8OuF0VMMbMDRzSo8i zs48uR7ytq44+oTVpRO8HFZO2xkoloRJfKNU857TiylJCj8qOBepFlHi5DiX9I49sPCD 5iw/dyGC9o5Zp8t7Xiz0BZG6STY6HCBbRJtIG6GfFcErPItyiaqC6TnzkltOYr8QP6zy wciOQ72g/LQCqiHH1b11kD4Ms9rLjwyD60GhCZnKCVxYVNbQQlaEV6Tj2Vh2Cde/HeQb yB7FjRpDnLoJGPLTVxP+TUG1AnKmrCeWfVlRcrhlKA2snu7GVNlUle3C0TjlHatAdzDA wfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=teFwHQrrqm8x4ZLUQ/m1MOb9Wr76Q1wYl69r6/AK5Ac=; b=nhWZgcCl7G6hRcGX2Gh2VBWB5iK2RTa4z/BNjYSRV6fLgH1Te03oNA4I3RiUZQ/pqw aRoiGykMfQthCf4AiNGn6a4Ku23npZzQKgb6MA2Ar0IMWA1vqrJmC9OTX1ukIX+kEST9 TLj+3TScIMaRl0/s9hbMRMVmaSpCVcCU/BgFipePHai37YzXMJQxH7EJ4VtYGnPCC7lg S3DHs9h5KjnSg5REgQGToFGiGma9IrtH+pVAAz0Iw8tyrvYCdS9h5xAXf/5AWmC6ntA0 NbPj+NeyFUH8IUNjiPdOx0AzP274tyBEOGIvcSHBO6Q0HR+h4MArPYJJQOBlDBbO4gSY 30HA== 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 k1-v6si8751381pgr.13.2018.05.29.04.54.23; Tue, 29 May 2018 04:54:37 -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 S933554AbeE2LwP (ORCPT + 99 others); Tue, 29 May 2018 07:52:15 -0400 Received: from ms.lwn.net ([45.79.88.28]:34472 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933395AbeE2LwD (ORCPT ); Tue, 29 May 2018 07:52:03 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 9FBE42C0; Tue, 29 May 2018 11:52:01 +0000 (UTC) Date: Tue, 29 May 2018 05:51:58 -0600 From: Jonathan Corbet To: Michal Hocko Cc: Dave Chinner , Randy Dunlap , Mike Rapoport , LKML , , , Michal Hocko Subject: Re: [PATCH v2] doc: document scope NOFS, NOIO APIs Message-ID: <20180529055158.0170231e@lwn.net> In-Reply-To: <20180529082644.26192-1-mhocko@kernel.org> References: <20180524114341.1101-1-mhocko@kernel.org> <20180529082644.26192-1-mhocko@kernel.org> Organization: LWN.net X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 May 2018 10:26:44 +0200 Michal Hocko wrote: > Although the api is documented in the source code Ted has pointed out > that there is no mention in the core-api Documentation and there are > people looking there to find answers how to use a specific API. So, I still think that this: > +The traditional way to avoid this deadlock problem is to clear __GFP_FS > +respectively __GFP_IO (note the latter implies clearing the first as well) in doesn't read the way you intend it to. But we've sent you in more than enough circles on this already, so I went ahead and applied it; wording can always be tweaked later. You added the kerneldoc comments, but didn't bring them into your new document. I'm going to tack this on afterward, hopefully nobody will object. Thanks, jon --- docs: Use the kerneldoc comments for memalloc_no*() Now that we have kerneldoc comments for memalloc_no{fs,io}_{save_restore}(), go ahead and pull them into the docs. Signed-off-by: Jonathan Corbet --- Documentation/core-api/gfp_mask-from-fs-io.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/core-api/gfp_mask-from-fs-io.rst b/Documentation/core-api/gfp_mask-from-fs-io.rst index 2dc442b04a77..e0df8f416582 100644 --- a/Documentation/core-api/gfp_mask-from-fs-io.rst +++ b/Documentation/core-api/gfp_mask-from-fs-io.rst @@ -33,6 +33,11 @@ section from a filesystem or I/O point of view. Any allocation from that scope will inherently drop __GFP_FS respectively __GFP_IO from the given mask so no memory allocation can recurse back in the FS/IO. +.. kernel-doc:: include/linux/sched/mm.h + :functions: memalloc_nofs_save memalloc_nofs_restore +.. kernel-doc:: include/linux/sched/mm.h + :functions: memalloc_noio_save memalloc_noio_restore + FS/IO code then simply calls the appropriate save function before any critical section with respect to the reclaim is started - e.g. lock shared with the reclaim context or when a transaction context -- 2.14.3