From patchwork Tue May 29 11:51:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Corbet X-Patchwork-Id: 10435071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD001603B5 for ; Tue, 29 May 2018 11:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF9C3286F3 for ; Tue, 29 May 2018 11:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4509286F7; Tue, 29 May 2018 11:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E9CB286F3 for ; Tue, 29 May 2018 11:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933535AbeE2LwO (ORCPT ); Tue, 29 May 2018 07:52:14 -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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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