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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 9AF57C4743C for ; Wed, 23 Jun 2021 12:17:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2661961002 for ; Wed, 23 Jun 2021 12:17:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2661961002 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 00E076B0011; Wed, 23 Jun 2021 08:17:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED92B6B0036; Wed, 23 Jun 2021 08:17:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D529E6B006C; Wed, 23 Jun 2021 08:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 971D26B0011 for ; Wed, 23 Jun 2021 08:17:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BF7AD1811CE2D for ; Wed, 23 Jun 2021 12:17:03 +0000 (UTC) X-FDA: 78284887926.01.96D6D24 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id A65FCE0004DB for ; Wed, 23 Jun 2021 12:17:01 +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=UZNtU7hYcqZpBzA1yCiqhGXNHHIoefG0OGqkF1QWY0U=; b=EneXs4ZyYT6XLmV/Zea7qgUKKt ruGkYX2+qqFBxvY2oAteLxRUuN7icF98hCE7dvLsRV1iPYZZntb+7EC15pwNLpyGCT6AoeaS9LH2V EGmItigKyXvQuzliOYAXioxwDFNS1SvAouwRCEvHEbsHEEZFQ9JcHO29vXEdjeO4dApZqkmMSb4I1 Bq+N8q2TxmxXgrmj1pzxq3de4Q9qb5n1H5x9eaX+qhVl+Hn3cfMwobdJiy/RaSdV+xTbwuVyetn+5 sDv+fWx72sY1KwIMvyirZaRNlQktbrPI6u9e0BXDwQ2yMDF3yTptUBVTb+2+sVHHkGoulAIh/jSpd K6hbJ0iQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw1nP-00FOtj-TT; Wed, 23 Jun 2021 12:16:13 +0000 Date: Wed, 23 Jun 2021 13:15:55 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 46/46] mm/filemap: Add FGP_STABLE Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-47-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EneXs4Zy; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: A65FCE0004DB X-Stat-Signature: fqnibit6m1oedhrnpnkbpitaqxrcuyqb X-HE-Tag: 1624450621-477406 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 Wed, Jun 23, 2021 at 01:43:30PM +0200, Christoph Hellwig wrote: > On Tue, Jun 22, 2021 at 01:15:51PM +0100, Matthew Wilcox (Oracle) wrote: > > Allow filemap_get_folio() to wait for writeback to complete (if the > > filesystem wants that behaviour). This is the folio equivalent of > > grab_cache_page_write_begin(), which is moved into the folio-compat > > file as a reminder to migrate all the code using it. This paves the > > way for getting rid of AOP_FLAG_NOFS once grab_cache_page_write_begin() > > is removed. > > We actually should kill FGP_NOFS as well by switching everything over > to memalloc_nofs_{save, restore} eventually, given how error prone > all these manual flags settings are. Well, yes, but it's been four years and we still have over 1100 uses of GFP_NOFS. Until someone takes on that Augean Stables, we're going to need FGP_NOFS. I added that context to the readahead path in f2c817bed58d, but of course that doesn't let me remove any uses of GFP_NOFS. > > diff --git a/mm/folio-compat.c b/mm/folio-compat.c > > index 78365eaee7d3..206bedd621d0 100644 > > --- a/mm/folio-compat.c > > +++ b/mm/folio-compat.c > > @@ -115,6 +115,7 @@ void lru_cache_add(struct page *page) > > } > > EXPORT_SYMBOL(lru_cache_add); > > > > +noinline > > struct page *pagecache_get_page(struct address_space *mapping, pgoff_t index, > > int fgp_flags, gfp_t gfp) > > How did that sneak in here? Without it, pagecache_get_page() gets inlined by grab_cache_page_write_begin() which is just too much code.