From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D6ADC433E0 for ; Mon, 29 Jun 2020 12:18:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1976323B23 for ; Mon, 29 Jun 2020 12:18:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OTvKQIU8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1976323B23 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 96C626B0025; Mon, 29 Jun 2020 08:18:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91C056B0027; Mon, 29 Jun 2020 08:18:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 858A96B0028; Mon, 29 Jun 2020 08:18:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 677F76B0025 for ; Mon, 29 Jun 2020 08:18:24 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A894D181AC9C6 for ; Mon, 29 Jun 2020 12:18:23 +0000 (UTC) X-FDA: 76982152086.06.gold73_161387726e6f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 7A6951003BACB for ; Mon, 29 Jun 2020 12:18:23 +0000 (UTC) X-HE-Tag: gold73_161387726e6f X-Filterd-Recvd-Size: 2770 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 12:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IEJE4pzTKwBckHnN8MJnYUJtj55RnUgeieprz/ielos=; b=OTvKQIU8NCpuynReFPzOX7sxPG BTVSLs55stmmHraBnRi26uem12+KaQj+V1eI4nr9kOJ5204WgoR9TEDgeWykyEJEGueWoT6zz5Lyn JyMjdjzxZuirLVi32k2alVYtkO02n8ePgQVbFBstHngo7UtOTcHEWnd01Xa0KUNi7R5ILAv29WWix tUNoRbV17Am92l88NVeSasyGJGdEcZ5maoj/2ZG1Jln2bvXxkxbcWyGOMifdiAetgP2Q5beo1uiI6 qdSwFTgXdx9bahX+TOjD8VzRMT30ZHxxZY9z+GPv0FVIiW1r26VCh5KcPfDwcqQWEqgWK0thaROa6 a2mxmwPQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpsjo-00026M-RY; Mon, 29 Jun 2020 12:18:16 +0000 Date: Mon, 29 Jun 2020 13:18:16 +0100 From: Matthew Wilcox To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, Mikulas Patocka , Jens Axboe , NeilBrown Subject: Re: [PATCH 6/6] mm: Add memalloc_nowait Message-ID: <20200629121816.GC25523@casper.infradead.org> References: <20200625113122.7540-1-willy@infradead.org> <20200625113122.7540-7-willy@infradead.org> <20200629050851.GC1492837@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629050851.GC1492837@kernel.org> X-Rspamd-Queue-Id: 7A6951003BACB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: On Mon, Jun 29, 2020 at 08:08:51AM +0300, Mike Rapoport wrote: > > @@ -886,8 +868,12 @@ static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client > > return NULL; > > > > if (dm_bufio_cache_size_latch != 1 && !tried_noio_alloc) { > > + unsigned noio_flag; > > + > > dm_bufio_unlock(c); > > - b = alloc_buffer(c, GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN); > > + noio_flag = memalloc_noio_save(); > > I've read the series twice and I'm still missing the definition of > memalloc_noio_save(). > > And also it would be nice to have a paragraph about it in > Documentation/core-api/memory-allocation.rst Documentation/core-api/gfp_mask-from-fs-io.rst:``memalloc_nofs_save``, ``memalloc_nofs_restore`` respectively ``memalloc_noio_save``, Documentation/core-api/gfp_mask-from-fs-io.rst: :functions: memalloc_noio_save memalloc_noio_restore Documentation/core-api/gfp_mask-from-fs-io.rst:allows nesting so it is safe to call ``memalloc_noio_save`` or