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: 10435067 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 46662603B5 for ; Tue, 29 May 2018 11:52:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3728A286DE for ; Tue, 29 May 2018 11:52:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B2D9286F6; Tue, 29 May 2018 11:52:06 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8077E286DE for ; Tue, 29 May 2018 11:52:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 721C16B000D; Tue, 29 May 2018 07:52:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6D1DF6B000E; Tue, 29 May 2018 07:52:04 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59A166B0010; Tue, 29 May 2018 07:52:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 1A0296B000D for ; Tue, 29 May 2018 07:52:04 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id 89-v6so9186041plb.18 for ; Tue, 29 May 2018 04:52:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:in-reply-to:references:organization :mime-version:content-transfer-encoding; bh=teFwHQrrqm8x4ZLUQ/m1MOb9Wr76Q1wYl69r6/AK5Ac=; b=TZELJIcwN3v1U9FzfW4NrR9Djg+nFChZrM9X0UjB1aDrfvyUynitK+6GAsmqrPRRcn 6ri8LL/KBQggZVv91KJm6+aPQ2Nkxblsg4Ys5bPpszAdwMOGROhwAMwZC7ssSXyDIn4q JDPnSu5KXJL1UYAFiUNwYwtp1Rguyk2y0Sp/9gLKSY5M3C9oKXOz0KBftwAjANbr8FgW zU+KcEdus7iK90O8DYTni4ql4V2bsV2c5VrUSdcNsH9qi1ArY0AxO7ES1QYVXivWcYIY D8nFUPzdzfOTRmT6HTiUrKnb80wnmbqIsxD7O6ubDB6crl4kN2hHzDC3hm9vZ6dLWcGl +rcQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of corbet@lwn.net designates 45.79.88.28 as permitted sender) smtp.mailfrom=corbet@lwn.net X-Gm-Message-State: ALKqPwcPhJEDDM6Ub7cTF9zEuapobSoJT56Gk+jGeIdqpEEScd4s/yVe 3pgN/+eTneo9W1WYJ8N2d/GKM+IbkKaognlsowQo4l4V8B1APelpBivUeNFIM1myXBoRIlEX6QX 7mo9IIeseeh7v4RbfmImTJFhJZ68U1cJ0Wg3sm8csSHG+N4yp23mcbudVO5w1aCVqRQ== X-Received: by 2002:a62:c95c:: with SMTP id k89-v6mr16963828pfg.47.1527594723778; Tue, 29 May 2018 04:52:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoP/1JRhdeAleCpL06vAXZ065AXBv8mXonNwEIhtSGQ5/dLGHeRisaA5JF2fkrJWCWvqOzt X-Received: by 2002:a62:c95c:: with SMTP id k89-v6mr16963805pfg.47.1527594723195; Tue, 29 May 2018 04:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527594723; cv=none; d=google.com; s=arc-20160816; b=nn5g5JTNlgZYKgscqt2Qb2JO/TI8tX0dEnDtPNDEtVwGlK61mEwCJQL/gHQEJ03xjy FBQdrx5Thloi1JcQFSNfciyY9kcEcnS3U1EU3HDMRA94F0YwE5qTI1w2xLMBE6h4OjmB 31pacPOcLWm2hFNrxQOfK5JGyU1NByKSZKNcjxqv2WJLJ3e1BPoiywD+dJcPVl95xxAx MsLF1We9EjpGJECyYFNRTtiAC9iE3LF1yBIZlVgllTtZN4LnFNquUXUAQVRCf97e8j/+ rYs849cmnceT+ULZ4t9FbNdB+p8U9MFD0J3VDupLoXMvMOLTkRSpV4RB+bi90FR5UnOl jGqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=gVtEYaDyWJOEzrhvpQn9tCzu/SvD35vwXsIzrZmHWpdCddaojdCqZqzLmAdr9gA/Ql wYNqfzQTRqEcTNd+QPvKME4V1cq9IYGxNULnPCl9vNO5jOIX7wTG86Pv84qyE0t3AJoz vF4xw3StJmGaqIsefTUVREIteZQfgF8lR6w++KoGJuIVNMFktsax7yreUyfB8zrIfr/C afWPdkhuTwaJb5W4IOQ78+MJmMfNRnBMoFagYZK/FL+pbyq9Vomffb+HHCzwYWnLHgZl ttQoWPHZQnndoDmpQ1YZhBwjWi+/2nLcvpalyHWuFyK8VmD6RtNcUUuKfI5yRtmTfOT2 UDEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of corbet@lwn.net designates 45.79.88.28 as permitted sender) smtp.mailfrom=corbet@lwn.net Received: from ms.lwn.net (ms.lwn.net. [45.79.88.28]) by mx.google.com with ESMTPS id q19-v6si4079098pgn.392.2018.05.29.04.52.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 04:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of corbet@lwn.net designates 45.79.88.28 as permitted sender) client-ip=45.79.88.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of corbet@lwn.net designates 45.79.88.28 as permitted sender) smtp.mailfrom=corbet@lwn.net 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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