From patchwork Wed Oct 2 04:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B0CFCF3194 for ; Wed, 2 Oct 2024 04:01:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 178CE44017B; Wed, 2 Oct 2024 00:01:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10327440175; Wed, 2 Oct 2024 00:01:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBEEF44017B; Wed, 2 Oct 2024 00:01:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AFCCC440175 for ; Wed, 2 Oct 2024 00:01:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1D7F51C4D80 for ; Wed, 2 Oct 2024 04:01:26 +0000 (UTC) X-FDA: 82627312572.16.C046331 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf19.hostedemail.com (Postfix) with ESMTP id 64EDE1A0011 for ; Wed, 2 Oct 2024 04:01:24 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=mciO33gZ; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841590; a=rsa-sha256; cv=none; b=weqhUZWV1FIqk6X0gicjwzsj3QfZNWCswVYcYaKCr5/O+KyJLUfVc+zYoK8TLWSktfzaWr 3XcVGv9HTD4uSjOar3C/kKOD3q+kRl9vxayPekRItGbZXMA2vkZMS2OEg5uiYTJPo3Ocuo 1wVfsEbAaPEUjlfv84xiQ7Tj2v5bpwo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=mciO33gZ; dmarc=none; spf=none (imf19.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841590; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IS+o70XI9H6xAbtwLOTIZ3eCVSzAnaR0y6//eiVhID0=; b=FMN6R03FDp/JT+9BMCVSbIbHVJx5xemI1WX4vhhKvbFF8zH3vJqPdqIhqvdT32h/PmeosD wDKGYWM5qhyV7JxsOMvj7HShLlVeYvOn4O3QMIItAoiRX5veFRxZM62CSkQGM9HcR2Uq3X k864x2LTpp8wEiyxq9sLa5AwT6sksfU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=IS+o70XI9H6xAbtwLOTIZ3eCVSzAnaR0y6//eiVhID0=; b=mciO33gZCfuz25EaGN6Yu3qDbL /m9SVAj5Ircnf11Vk607Z4G9g5Js9S8IjTN2R7t8FZgM/oR+jMao/T7iU2DyEvno2TcH60m6VyJzU 0bkX9v75/BiT15C/N3HU8JmwDW9u9VoZj8cwfbPCFr/zEReWz7/8sIweOFzi6K+XuT4cnNlhNvpdd 3dMtYf9wyJNc5D/YmZwM9h0ZduNNRPpB8V5rbKVH0pSAxO8iLf8sYNpZklbGLALAYNZqBnk/NmBEe zkqpZHVfwhfFgtc2+dr0xsg3/YHdczfTERn/MuHIkZHFNftHqgxFN53cpGhUt1rbJ018C6hgqBrHi Znk/b9xw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8T-2ivo; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/6] fs: Move clearing of mappedtodisk to buffer.c Date: Wed, 2 Oct 2024 05:01:03 +0100 Message-ID: <20241002040111.1023018-2-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 64EDE1A0011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 5i36zmmgkwaedrcrsyhiaq3955b988bu X-HE-Tag: 1727841684-393928 X-HE-Meta: U2FsdGVkX1+SbPWbg4Pv7XUhk+2cez8+zeKQDoI9iEe5CoFgZLkdpNRisxjKO+40Zx+QRFciO/S+GOoe38ylG+891PfHgf4VED0qdU/Rb0yn1mSlCS6T/Edey8FrCH5cE3A55ghobZlZoRrojycoI3DZziFSaYEO7dixVnIFNomYkd6MHC+VclP56neMU4fS4whTNv7QFrBYMqawwtH1mJRCY1OXBsr6pZADUFXeRwX8Oc4sl3lB/sKBV5sAu2nqU9nLzc0wL2J42JBRaILZGRfx9c8G1/aDt5Wm9H8iOQZuEyibk7yRW+7Ut5fi5LX1Ozbpeu/fLhi1gu/h2A2Eq8r25fu7kstm/hAG44Hspyb1GbyyxIE7B1Ud+HrRmSKxTbXEX3VWa3rkvRaGYzcSW7kbwTKxZCq7nAmAn3lFr87N+sKEh7nPZw8CPFvak+VS6Y4RgVJdoJemGI4MylVRUtnTIhLlZWpYhW7sSPLPGfv8n9FfNaJD/dqx7DhWx6JjDTAFSx7kSAn5dt9WCc9mkpw3LYz3pGdP8RiutCP12yXjjwxf4rb5MyjOXP+sdXd4gDFSFO9e1+4o9JT0MJ+jMRQGl9KDhw3H3IiQtx8MCWWI246y7W2VMoZZxMK5PTgX4yjhfFlJG8gxVbkdrFhV+o764NZqjIbRQKRxDI/OChzR0j/YMv+K7wxOFFrR3CNyRZQYGVsqHAwqt76FcvGJn+lZPd8OsH+iw1vHTQ2lg7uctov4H68SLp2VJZj1cBUmFHceigAcTp1F7uFiMXfHIvF1rk+CZqfKi09o/F20G98cUm7iAMAPcAtyx3Rava0sDmWOcYpIVNzBj4XtipDRHetg6rB9+9rntiAw7IRWESLY4fha2xv47uogMh1jhfMn42KKAFJBVxjRAHaSkuR3Xhb/xZ2bRKSJ2/hrO27pvbmoJPE7Rj1GBp2Wq+4xQxdRRb7FtH0Nc0QlyWL6m9u 83F0QLUf mlByiF5gTfio+WD8Cd8bo5CjPiYQJcv090Cvj0hS+3jtBPaTxx+OTsyyWZ7L4XPtLATQuC+kryUxcUr5umIsRwAxaVqrxbiDMU2g1chL8mE/cLsCcHdnJFZfP+HBIgSHMS2ijyCiJ4qP3FzjRYHt/4K8lwelzUCT7EUAUnXl7mGTK9r7qVQ9FeN2saezr5+nmD5qHWWARJHgh9fZp3Am0fIV2nAjMkB0OMsAAknzUxAPEH00= 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: List-Subscribe: List-Unsubscribe: The mappedtodisk flag is only meaningful for buffer head based filesystems. It should not be cleared for other filesystems. This allows us to reuse the mappedtodisk flag to have other meanings in filesystems that do not use buffer heads. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- fs/buffer.c | 1 + mm/truncate.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 1fc9a50def0b..35f9af799e0a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1649,6 +1649,7 @@ void block_invalidate_folio(struct folio *folio, size_t offset, size_t length) if (length == folio_size(folio)) filemap_release_folio(folio, 0); out: + folio_clear_mappedtodisk(folio); return; } EXPORT_SYMBOL(block_invalidate_folio); diff --git a/mm/truncate.c b/mm/truncate.c index 0668cd340a46..870af79fb446 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -166,7 +166,6 @@ static void truncate_cleanup_folio(struct folio *folio) * Hence dirty accounting check is placed after invalidation. */ folio_cancel_dirty(folio); - folio_clear_mappedtodisk(folio); } int truncate_inode_folio(struct address_space *mapping, struct folio *folio) From patchwork Wed Oct 2 04:01:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A02BACF3195 for ; Wed, 2 Oct 2024 04:01:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA2D2440178; Wed, 2 Oct 2024 00:01:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A273F440175; Wed, 2 Oct 2024 00:01:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A606440178; Wed, 2 Oct 2024 00:01:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 586EE440175 for ; Wed, 2 Oct 2024 00:01:21 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EFD4B1C71AB for ; Wed, 2 Oct 2024 04:01:20 +0000 (UTC) X-FDA: 82627312320.01.A659001 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 5061820004 for ; Wed, 2 Oct 2024 04:01:19 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DMtIe9YM; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841640; a=rsa-sha256; cv=none; b=udQNR3kGn5cJcJhHl37+hSYa/4aYtuj+aQlM6ZEpoAZRUguGw5L8hUjHh2CodHxZINaDHg zGGeGhWwzmzr0c6LFMCOJ8L8kUGdHUZKk6LQ8y5CIOvapfQaVcRMH1qDEBfK3dzADbC57u 1p/QC60g7LlBa+mlqyggn4DLKp52I2E= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DMtIe9YM; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841640; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jm1g6XtuabKqm9/JIMlSTf6MikBfRVYmTm8EFY+uDyU=; b=6WeT/cWXjwJoSx0HjRXrBrsn9dJjWF4mGKL6gG6QLrtxyjMkivGUQZQVvUhadJTGn43twD mVHhEvFrsPmmt/YoOoVwxmELcVLoxESThrBFe9dnm4NMn7c31JotK5M6zcdCDvPQeocc7d of0rnSC80cmOayvczeyW5YSAJz7VK+4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=jm1g6XtuabKqm9/JIMlSTf6MikBfRVYmTm8EFY+uDyU=; b=DMtIe9YMNkx31KhDVNPCTySp1x pXXraeUTSuORncN9UhAdmxtUQ8bt5st5ctV3seN3YE7qCDfDzL4HB/QqvtEKCX39BJsrmELrtr9CW +daJ720l9aLvJ+RMK24+79cTk7PD65qaKAH4Nro1VTW/YpcPpQyGtYM84yUXydyromE3/CWfGIqK+ qzi7b9t6ZKLHb4eEcCBeMInvSa9UrrrhU7bkWlLrtmGFsP0FY5SICdK90ofGWBi1/tqbEKqi6UVtW vGSOo0uqu+hPAYjEEF0SufgLYzBJCCJCZmTDGy0+965MEKyevWlEI6vUfAYGk8H9b4bbrKctu1ltA kxEmSWBg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8V-3AQG; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/6] nilfs2: Convert nilfs_copy_buffer() to use folios Date: Wed, 2 Oct 2024 05:01:04 +0100 Message-ID: <20241002040111.1023018-3-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 5061820004 X-Rspamd-Server: rspam01 X-Stat-Signature: cj7kwcngoz9h15oyicntzc857jmbir5o X-HE-Tag: 1727841679-381552 X-HE-Meta: U2FsdGVkX19HUAbNArzIu/v1gd7MFKopjP59oTqcCjyFx5RFRyo/ayeUl1kqBUrZfBwP1gC/16A5natTMTwyZgsX+R0lVhmofEwuzZk1adYpNu1CcdPusvm4UBMEE7Um7n5N1VPnK4AOqyurpMD6MHhXVNDZh/oCEqlbGK6hGgaPZxxpTA+g+h50MmecL8HPNFWND9wgqvN9VgnPET2XbuQiTnbWj80dy3diBXdwhrIXFEbyFV23rUGv2pfB0UCH4TsWwgP0YuvbbSTyOCHgx4bNmW4XfH+lguIRLggL7t8xpifdYQs/N/xUsswFsK5/QImQ2rGqcbfTs953FpoVGIzlS2bOg5kH/pP9IINWLON3+01Z/EQ2qzoYylWJuzjkBYdh2FQ+BNH7vAauWkXIA/ZaAWjzAnfAyiGEkcZtnlwjrhvQZn6ktVBuvWQcP857u+0D0Siu5lTJreYG7o8aE9TprypNGsjNkgiVL95lakH93mz7Gw9h/JPDWQ/UDCvPDhRN23WDO1GnTqnh+u1Ku+gRYp85QpAWl+XTeq3ES1SDbOzpUmUB9F/9/zoO4WcldbD19l96AUlEbTUNeJxmOIGOlKNmribRvgx391r30UfsuB1GlSsapAaP1JeZKGsNSkOtdSxk6hoXB4xxBsyTNibyAlunuLL/P+mDT0cHmtZ2yinDEtH2xuFK7L/Au1nmZ5wWxTWGILNn+G+A87BedMYdB4rY76+CT3nBTKSu8fgUDQWJZTu8bBQIGoLINd9s/2P+4gHZVD1ez70y17QT8auzfXp2zVgvcyWmm0Ern3ysqhAVqD4kVe9R+9VV5aV2gYzdlBrvEPnuyFUSP/rq5akX/FeKPwob88s1nNrx5DvHHPg1DEiD8IfnQpYQlMaTNNlEVB3FIt08Uxk0Dca7qrq2b2c+dRI+T6ft7v48G3O2HkVngiSW31lM2bgkrhxXP59uDd6SyDarWu7qpr4 t8q93+Lc PAAzvIMeIdD5NELwc2SbEvqrJ8S2LV2jRtFHYZ2JpdZxelMqX7IPtyI98VB+AN6Er006lY2gX91TKmEXbG8Mr6zVlJ0UEu9hmyk03d8L7TjPDQQaU4//sezBgNR0E6Gmd8G7Fq4PSHVIuwpPpv2+aGN3BAla2OFVLty/qSIndnlJ3mEr4kWBFMrf5qnT+AM2EIukMRqtGnk8Ed8y1KCLaAiIXXW48ADjAYRjp3M+/On9Adrpg0xI5ALe+SDdQmqiwPPkXCS4M/Yq0/HoeRQ8YAAr8yrBc/uWsA8+O 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: List-Subscribe: List-Unsubscribe: Use folio APIs instead of page APIs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi --- fs/nilfs2/page.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 9c0b7cddeaae..16bb82cdbc07 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c @@ -98,16 +98,16 @@ void nilfs_forget_buffer(struct buffer_head *bh) */ void nilfs_copy_buffer(struct buffer_head *dbh, struct buffer_head *sbh) { - void *kaddr0, *kaddr1; + void *saddr, *daddr; unsigned long bits; - struct page *spage = sbh->b_page, *dpage = dbh->b_page; + struct folio *sfolio = sbh->b_folio, *dfolio = dbh->b_folio; struct buffer_head *bh; - kaddr0 = kmap_local_page(spage); - kaddr1 = kmap_local_page(dpage); - memcpy(kaddr1 + bh_offset(dbh), kaddr0 + bh_offset(sbh), sbh->b_size); - kunmap_local(kaddr1); - kunmap_local(kaddr0); + saddr = kmap_local_folio(sfolio, bh_offset(sbh)); + daddr = kmap_local_folio(dfolio, bh_offset(dbh)); + memcpy(daddr, saddr, sbh->b_size); + kunmap_local(daddr); + kunmap_local(saddr); dbh->b_state = sbh->b_state & NILFS_BUFFER_INHERENT_BITS; dbh->b_blocknr = sbh->b_blocknr; @@ -121,13 +121,13 @@ void nilfs_copy_buffer(struct buffer_head *dbh, struct buffer_head *sbh) unlock_buffer(bh); } if (bits & BIT(BH_Uptodate)) - SetPageUptodate(dpage); + folio_mark_uptodate(dfolio); else - ClearPageUptodate(dpage); + folio_clear_uptodate(dfolio); if (bits & BIT(BH_Mapped)) - SetPageMappedToDisk(dpage); + folio_set_mappedtodisk(dfolio); else - ClearPageMappedToDisk(dpage); + folio_clear_mappedtodisk(dfolio); } /** From patchwork Wed Oct 2 04:01:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38FE3CF3194 for ; Wed, 2 Oct 2024 04:01:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B14A2440168; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9C4A440174; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 915A8440168; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5E05C440174 for ; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E28581619AB for ; Wed, 2 Oct 2024 04:01:17 +0000 (UTC) X-FDA: 82627312194.21.9D26C6F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 4F57F40003 for ; Wed, 2 Oct 2024 04:01:16 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p6MdfR+L; dmarc=none; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841655; a=rsa-sha256; cv=none; b=8LYraNOU0PD3GNrKYJknsXkUkqvCvADfmzlxZ3W8jTamfbvVZiWqTklGqvWZpi0UNls2vB 1H4NPwRoEtCFdE35riwxLtJHv9nL58k3JCWPuIh339ZqA6frpoWljT5PSuKid4XcOq3qzl hJnJ6lixbU1UCBvqZ95yyv0Dbq9v5cw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=p6MdfR+L; dmarc=none; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841655; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RZtLvBtTcdvfSoyXcG5LTLDVsxK5mD1QMTXUY1VvVY0=; b=KOogCl3MoDOa+brGgBzj8LWP5Vqcc4+OWB7rjr1nZ5JD7Kpp/WvjDRqXZ3a52qlGYOFrZw bS0ZWMoOY83ZI4kyLGvon1zMOkdgBlNW3RiUtsuXIbJK/oPrtlU3oJuS0Q53zA4U8Fce+h 8Iya187eJUvZZ8Ipw2k+6taj/98n1B4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=RZtLvBtTcdvfSoyXcG5LTLDVsxK5mD1QMTXUY1VvVY0=; b=p6MdfR+LNPnRPI/OEyTwrpvMUq tsBnav1lqFiVSXudJ8Zq6EKC3QZLrdtheHJ+BzBZMFXIf3JZ2DwCp9CgwNlEl07aevt6ZHFM73/sq zrCWD9jWC2LSHyoGCiX1lCu0e+sgAS0/UHNwXjeFvN7sGaAlPmDEREPK/mIpYafLU6h09isyY58vm Z33AkjNKYlB4QrcxeamNvEPDZqJBnd7JHpnx0juN7a15Q5nJQvEQFZL2RByf9UB7pzdycS+da/suk nPxxcinkIAWJl2+t1ZDs9CmWkDahoJDxIWsSZrKUnYwUH11I2LuMonIYZ005MzY13WJYRVa1AY3Mu THXtD+Gw==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8X-3Vr7; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/6] mm: Remove PageMappedToDisk Date: Wed, 2 Oct 2024 05:01:05 +0100 Message-ID: <20241002040111.1023018-4-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: n6zgksrs13donbh8xndjephopo99udih X-Rspamd-Queue-Id: 4F57F40003 X-Rspamd-Server: rspam02 X-HE-Tag: 1727841676-883940 X-HE-Meta: U2FsdGVkX1/alk5Iv/0uvk0bwWlevD0TSFZ9r+ATbGSXY00ZrK/qnO7MrDIGR7L/342Qa0ytc3QQ8XHsb1J9TozKHpK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7OIyIND70zhpNpPjHBMrXNe7OTSArav+WvUFIe+3n0STVNI= 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: List-Subscribe: List-Unsubscribe: All callers have now been converted to the folio APIs, so remove the page API for this flag. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- include/linux/page-flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 1b3a76710487..35d08c30d4a6 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -554,7 +554,7 @@ FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE) */ TESTPAGEFLAG(Writeback, writeback, PF_NO_TAIL) TESTSCFLAG(Writeback, writeback, PF_NO_TAIL) -PAGEFLAG(MappedToDisk, mappedtodisk, PF_NO_TAIL) +FOLIO_FLAG(mappedtodisk, FOLIO_HEAD_PAGE) /* PG_readahead is only used for reads; PG_reclaim is only for writes */ PAGEFLAG(Reclaim, reclaim, PF_NO_TAIL) From patchwork Wed Oct 2 04:01:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47794CF3195 for ; Wed, 2 Oct 2024 04:01:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4D92440179; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE83D440175; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEAF2440179; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 75BEA440175 for ; Wed, 2 Oct 2024 00:01:23 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 123D641865 for ; Wed, 2 Oct 2024 04:01:23 +0000 (UTC) X-FDA: 82627312446.16.D1827F7 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf01.hostedemail.com (Postfix) with ESMTP id 5E24440012 for ; Wed, 2 Oct 2024 04:01:21 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u39QsFMw; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841554; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Qu1H+yLukYt9YwYC/7ESpsAw9sOZjKm/rhqgTzGdqoU=; b=HO4qFEYwJSccqUolvmoGrKD+/ao9o5J+eC/y1/tExy3NhhoYbvfAsOOUjMLEu5HqVTFFtH IfgkaZt5BW9l++eh58RwFQEded80vCHGwqf+Dgyp/F1zOca6S3EOKn9ziXegz5oVbLYrIv 1dThJO88JT1a7753xnRJ37pkF/wVNcg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841554; a=rsa-sha256; cv=none; b=Up+dKcf9nzci+reU8qWNKNUjUlfByvGY2FIuTbNPkbD4mXNGaFcW3PP1kwvSAxy5mvjHDr UD8qb+gXnVy4tujddVXdXmTvwMYXttLM9R/eHNnIzvdEyUaHy5sW2Hu9ed/irNNwEuvBW4 OLxbrDKd6S4tluyCsKw8yWZVPanKSWw= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=u39QsFMw; spf=none (imf01.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Qu1H+yLukYt9YwYC/7ESpsAw9sOZjKm/rhqgTzGdqoU=; b=u39QsFMwQ6tIwNI7i/W1K+/pl+ GvSGrpVMvi9IWupEj7d7hKdghJKrM8TW/XKgZb3bkO1NguUXTBhUJB4Adxa6WXd0ajYBIGzZWnxhW H6BXWSuGXsM65J4L5JDKfv0k8YLxibiMMitHwY03iC2W9MLIjhWBnRauq01lxHeU4qd9vVJI0B1z2 asy96gxHMxcFadkiQTWxzRThGNp0i2aIXcGqBT3UxcxELkkZdMroPgTKm4jlnqW1VhLmrZIv1VoQL n+44yDwp5sIhB3WaWM6c4Rg1vTpmuHvSuUmpVzYMZR7W8Jw/e9xFD9YUU3PZANOA6b2Uj9TjSqD3B 2GXU3Phg==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY5-00000004I8Z-3vof; Wed, 02 Oct 2024 04:01:13 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/6] btrfs: Switch from using the private_2 flag to owner_2 Date: Wed, 2 Oct 2024 05:01:06 +0100 Message-ID: <20241002040111.1023018-5-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5E24440012 X-Stat-Signature: xd8sfxyt3pnyjghywkfzrr8i9g4fbps5 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1727841681-108078 X-HE-Meta: U2FsdGVkX1/vuJIpUbieTCtGPdYBG0LinHIw6QbhrQTvAQSJJbSH74JwC+m9r/lZWM1gwBfRKghxCbWtQHXiCpww4x15aHjYVVf6D/Ijox14dlkGWAIK41HNKJMKG8C+75FwTYhW0wk705FSPSnl/bRjkkACqpE9i7qCeH2sD9EVIFmgqig1A1KPmsrPp5N9dbEqRah2ZRGmERsc3Hm0S1NH7gqPC6pCNnr+8oW9wokYLI+UxiHktv/n/5gC0P1H19jT15zfvscq7rDjA5IlbTfHsMQN6ra6RWAhfZL7eQttsWz1lcoCAr1nj+mm7+hA+N73Rr+rv0ZnQ3f45kabbFEYEYB4dOyWHiK9CJTgit2uFhbMCBmxt8IE3ArerqqowV6hL07b0l6z0hPD3/GPPOLvqTrss0eLETQZML4sE2eYzcsaQzuN9A5VEwhN6hjhikxobEgtgvryuKevBdjTfKg2G9t966YsI0QFQhIt8eSaNbdI+NuK5J/ZFSo+85zpz7mLnJoIvv847Jval8VA8yE29RH14KA3c8UOHo315We8fuwRlWuIKqVWOu65QMDZOrJXWFSdBfGAk3gN764asKikg20e/tLsSHVWvJ54N9kyFKqPFW+sMsRjuQxptbt6AFBCj7dZdiXXCiFh6ZZyS7P+/RJq7CTuJhgoJWW7Z+i55weyeRyM1Rzs4sneigWNkY9VVit+MBHi5SEzqszYGwH3Ie64Qdr9fg53l6kvrwhNA3n+h8fMP4XYDnExhqbsREppT1tWCE8MCDljS60KNiVtcQyuFVRcJGEh4ZQf/LN28Rkd1+qVcjfE2GffIsgXkV61eFifmZH3+Utd0s9GtZ5G2xiLCy2SGgfV/2mPK2vPe8io8Oc5q0SB1i4Y4pdmQblF7/fXFk8DfIosSLeNvFlLGViC/FdjyV550ZgthYQoFbx3nHRAPHyEIgLrKhhQKgHUhMXU3a9FeOLMRIv rUgkJiDe 9c4ErHkNj8A+FkVMATYQTmMA6KQvc5iBdX5l+H3X5cKDPV84Mmb+Au6VnkawO7aN39e83W9lwlhlCl1yTcqCe4wl9taKuiBaGTROop1p2h1Ap56ww+R2ZUnsIB4p1Y6dhyk4oaDF/tN4Y5Z9c/oX+WtrEEEMYLPkwWQUZxmpY4wdHEm7Bl6CUsgWySEtL9mUYrJFwMk3JQX715DgNM7MwNitVGtkH8wGTclu54wHLDx1M7oF/ByCE36Mpfl+EaftiUhuhyncBem9ATTYjkl7dv3PTy6pnOACxwHq89cfWOjEGBIQ9uiPA2b2CG03MgvX0N/1a 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: List-Subscribe: List-Unsubscribe: We are close to removing the private_2 flag, so switch btrfs to using owner_2 for its ordered flag. This is mostly used by buffer head filesystems, so btrfs can use it because it doesn't use buffer heads. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Josef Bacik --- fs/btrfs/ctree.h | 13 ++++--------- fs/btrfs/inode.c | 8 ++++---- fs/btrfs/ordered-data.c | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 317a3712270f..307dedf95c70 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -744,16 +744,11 @@ const char *btrfs_super_csum_driver(u16 csum_type); size_t __attribute_const__ btrfs_get_num_csums(void); /* - * We use page status Private2 to indicate there is an ordered extent with + * We use folio flag owner_2 to indicate there is an ordered extent with * unfinished IO. - * - * Rename the Private2 accessors to Ordered, to improve readability. */ -#define PageOrdered(page) PagePrivate2(page) -#define SetPageOrdered(page) SetPagePrivate2(page) -#define ClearPageOrdered(page) ClearPagePrivate2(page) -#define folio_test_ordered(folio) folio_test_private_2(folio) -#define folio_set_ordered(folio) folio_set_private_2(folio) -#define folio_clear_ordered(folio) folio_clear_private_2(folio) +#define folio_test_ordered(folio) folio_test_owner_2(folio) +#define folio_set_ordered(folio) folio_set_owner_2(folio) +#define folio_clear_ordered(folio) folio_clear_owner_2(folio) #endif diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index edac499fd83d..a4055896261d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1513,7 +1513,7 @@ static noinline int cow_file_range(struct btrfs_inode *inode, * (which the caller expects to stay locked), don't clear any * dirty bits and don't set any writeback bits * - * Do set the Ordered (Private2) bit so we know this page was + * Do set the Ordered flag so we know this page was * properly setup for writepage. */ page_ops = (keep_locked ? 0 : PAGE_UNLOCK); @@ -7292,7 +7292,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, * * But already submitted bio can still be finished on this folio. * Furthermore, endio function won't skip folio which has Ordered - * (Private2) already cleared, so it's possible for endio and + * already cleared, so it's possible for endio and * invalidate_folio to do the same ordered extent accounting twice * on one folio. * @@ -7358,7 +7358,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, range_len = range_end + 1 - cur; if (!btrfs_folio_test_ordered(fs_info, folio, cur, range_len)) { /* - * If Ordered (Private2) is cleared, it means endio has + * If Ordered is cleared, it means endio has * already been executed for the range. * We can't delete the extent states as * btrfs_finish_ordered_io() may still use some of them. @@ -7431,7 +7431,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, } /* * We have iterated through all ordered extents of the page, the page - * should not have Ordered (Private2) anymore, or the above iteration + * should not have Ordered anymore, or the above iteration * did something wrong. */ ASSERT(!folio_test_ordered(folio)); diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 2104d60c2161..95c8499a159a 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -346,10 +346,10 @@ static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered, ASSERT(file_offset + len <= folio_pos(folio) + folio_size(folio)); /* - * Ordered (Private2) bit indicates whether we still have + * Ordered flag indicates whether we still have * pending io unfinished for the ordered extent. * - * If there's no such bit, we need to skip to next range. + * If it's not set, we need to skip to next range. */ if (!btrfs_folio_test_ordered(fs_info, folio, file_offset, len)) return false; From patchwork Wed Oct 2 04:01:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCB30CF3196 for ; Wed, 2 Oct 2024 04:01:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 305B1440174; Wed, 2 Oct 2024 00:01:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17691440175; Wed, 2 Oct 2024 00:01:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE14F440174; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BD9C6440175 for ; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 410721A07EE for ; Wed, 2 Oct 2024 04:01:18 +0000 (UTC) X-FDA: 82627312236.03.BC7066D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 9854D2000A for ; Wed, 2 Oct 2024 04:01:16 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cZ7AVepj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841535; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=COJ8f3y8IG0H+Q9xXoJdJ9ujTm4oeQQb1jUdkdnvJ4Q=; b=kPB+XAAyPJUkkWAQZcI8kqt/l20rUbJKVHqDBo9q8/fYUuJquh8Ud8s0j/gH3cedeedPdX dpqDlfqxHccCSxcx4hyDhzzcOVTZ4GbLi2OyfuGATI54N3O1MQleMWyLo7+f8r6gzOcBH4 OGtnVYPwsWUpfTtsMbJT0BYWkCH9lYM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841535; a=rsa-sha256; cv=none; b=qxWtsW6qJ/fDakn1u56FH8fijTuW1PcCY/YtSuEfjDx1iLCdgLjju1WDZIgweQ0GbVbQrR T2zYXLknY8Ggp+x9LLZmdrQwf7bQezqS9cX01ry3m/c3wiH3n7OvOerHju0XIpBNKVEvYM BiCgOLoro00aYLP26W4bHy7U7yGSAWQ= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cZ7AVepj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=COJ8f3y8IG0H+Q9xXoJdJ9ujTm4oeQQb1jUdkdnvJ4Q=; b=cZ7AVepjiSMgq/Oh5aKY9/VDa0 gRhmlq5wCZ23wsBbm/Ko4q2nW+MPdwngGy0X3df0Zvy4L/zpwvaLBy8VGiVdFbJwCNZhLXMMsZ1wt /pB8l05ekw0/hTNr3boaDx7x2KmJWkL9y+KIMcSNQcUgmP3pOn+60JPFz5nkH1GZnVtE0+kWHOo5p u4LbdLTtiHAJ6rwONcKSdCxpgmIYHOkTXnqyc3QovQUVpzE2w6iVNh+nqUbZOyptS4klJsACK34Rm xGZ6zrsbHGsmgwF9lSof4rXDk9i4ok3DkyOQHEMs9ECO7U3XNb9XdcavFpe8MAC8kl0hxbM5Uafxo 6kA9ylbA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY6-00000004I8b-09mw; Wed, 02 Oct 2024 04:01:14 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/6] ceph: Remove call to PagePrivate2() Date: Wed, 2 Oct 2024 05:01:07 +0100 Message-ID: <20241002040111.1023018-6-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9854D2000A X-Stat-Signature: cufm4i7eefoatpett19w4g8i8zyzampt X-Rspam-User: X-HE-Tag: 1727841676-170401 X-HE-Meta: U2FsdGVkX1/lX0qNKwdFIXDCuZuhQi/xsfaE3Fvn6j7Z9wFzovTtRPiJKm7H1Db+DGM6N649ZiPay5bSn8+UuUwi9Ggbq1QNztB34+iTNh3GT3y+5viOi2stq7WlNZr3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UDKqtfiPN6GC0SagL+d9G0A9skpBg= 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: List-Subscribe: List-Unsubscribe: Use the folio that we already have to call folio_test_private_2() instead. This is the last call to PagePrivate2(), so replace its PAGEFLAG() definition with FOLIO_FLAG(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/ceph/addr.c | 20 ++++++++++---------- include/linux/page-flags.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 53fef258c2bc..a8788e300dc7 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1051,7 +1051,9 @@ static int ceph_writepages_start(struct address_space *mapping, if (!nr_folios && !locked_pages) break; for (i = 0; i < nr_folios && locked_pages < max_pages; i++) { - page = &fbatch.folios[i]->page; + struct folio *folio = fbatch.folios[i]; + + page = &folio->page; doutc(cl, "? %p idx %lu\n", page, page->index); if (locked_pages == 0) lock_page(page); /* first page */ @@ -1078,8 +1080,6 @@ static int ceph_writepages_start(struct address_space *mapping, continue; } if (page_offset(page) >= ceph_wbc.i_size) { - struct folio *folio = page_folio(page); - doutc(cl, "folio at %lu beyond eof %llu\n", folio->index, ceph_wbc.i_size); if ((ceph_wbc.size_stable || @@ -1095,16 +1095,16 @@ static int ceph_writepages_start(struct address_space *mapping, unlock_page(page); break; } - if (PageWriteback(page) || - PagePrivate2(page) /* [DEPRECATED] */) { + if (folio_test_writeback(folio) || + folio_test_private_2(folio) /* [DEPRECATED] */) { if (wbc->sync_mode == WB_SYNC_NONE) { - doutc(cl, "%p under writeback\n", page); - unlock_page(page); + doutc(cl, "%p under writeback\n", folio); + folio_unlock(folio); continue; } - doutc(cl, "waiting on writeback %p\n", page); - wait_on_page_writeback(page); - folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */ + doutc(cl, "waiting on writeback %p\n", folio); + folio_wait_writeback(folio); + folio_wait_private_2(folio); /* [DEPRECATED] */ } if (!clear_page_dirty_for_io(page)) { diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 35d08c30d4a6..4c2dfe289046 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -543,7 +543,7 @@ FOLIO_FLAG(swapbacked, FOLIO_HEAD_PAGE) * - PG_private and PG_private_2 cause release_folio() and co to be invoked */ PAGEFLAG(Private, private, PF_ANY) -PAGEFLAG(Private2, private_2, PF_ANY) TESTSCFLAG(Private2, private_2, PF_ANY) +FOLIO_FLAG(private_2, FOLIO_HEAD_PAGE) /* owner_2 can be set on tail pages for anon memory */ FOLIO_FLAG(owner_2, FOLIO_HEAD_PAGE) From patchwork Wed Oct 2 04:01:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13819303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B279CF3195 for ; Wed, 2 Oct 2024 04:01:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39A84440173; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 32250440168; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19B8F440173; Wed, 2 Oct 2024 00:01:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D6CC1440168 for ; Wed, 2 Oct 2024 00:01:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2DC731619B1 for ; Wed, 2 Oct 2024 04:01:17 +0000 (UTC) X-FDA: 82627312194.14.E088512 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 8A0441C0002 for ; Wed, 2 Oct 2024 04:01:15 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=LO+loDKm; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727841547; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=81ggZHnEvcBilUrO8Krf1e9LLlvjup5oMzJTQuGKOy0=; b=v+jVuOMYta6EQJzk/A1Q56qWE9nrlBj9TFrO8mctH1m0KWkGYgvtgbZrvihDwmHc+ZB3QG ZzQmk8IM0zGsUVnTxOgVnj/N1jqJabtnfuK2XR3USNKlBdDlvBtM48ue2mlzqYwwsrgHbH tYTyM0JALEw7Rpiooh8jMGXeIkyJpQk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727841547; a=rsa-sha256; cv=none; b=a6tDppcoGsfZB2bR+vOq7GHw4TGx+U0846Z0SsjjfjrT4JaJ5lLxwatjTrr650lyUrBdb/ eEtI2m1rkNQima+Ni1jSFTofFoqRAV8QNKwQ2YVP0MC2kSO98bSxel3WbNYeacpW1CmX+I XaTDEH2z9igbONDHn4yfnrZ12mC4pws= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=LO+loDKm; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=81ggZHnEvcBilUrO8Krf1e9LLlvjup5oMzJTQuGKOy0=; b=LO+loDKm3/JWD5V7y98WPxn+jl Av3Bs+DCvSL5oytmlwf4y+dDZSmHfDNlVp0R2k/1kAKQ5bAN4KKJa7nyVa1Y9qNAHxDOavZVHV7dw 1KdwR9Vxb4OeRabK9McNKm7PIle5OaGCwJUUArWv27qAcGdujiWi01+cU/rMP5bjqOuYM1s0KWGsE NSHzSCqOqZ2BeT9rEBWim8BAVLbo9kQmv7ZO4LcZCX00vvgFsdmL1RzxR+UlJZlewhuf7dexRMe9g rgKItF4kNoFjRRNEmT11nw40ikRG2qJxVjJFISVSWP1HNJab9/kmtfQFliSuSEKMg1xbe4FqgJjc5 zznsCgnA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1svqY6-00000004I8i-0WIO; Wed, 02 Oct 2024 04:01:14 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/6] migrate: Remove references to Private2 Date: Wed, 2 Oct 2024 05:01:08 +0100 Message-ID: <20241002040111.1023018-7-willy@infradead.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241002040111.1023018-1-willy@infradead.org> References: <20241002040111.1023018-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8A0441C0002 X-Stat-Signature: fmrfkfzoakqiyznbpxqnqmcyt44mj4jc X-HE-Tag: 1727841675-717618 X-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SFImJPaUt3E4yimdXll3bmy/DtZ3QAe0txWzmavxGAKHV1W04fDs9eAtCNlP/sHP4P6RV/uNLac7k9+6Ltyczt0WsBTV2MfWOcGbi9PXx6PtHCBvr8hP1xwlwMjfKlCOUMq+f6Fpwo2iiM/5zVAG/sXK4cM= 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: List-Subscribe: List-Unsubscribe: These comments are now stale; rewrite them. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index df91248755e4..21264c24a404 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -472,7 +472,7 @@ static int folio_expected_refs(struct address_space *mapping, * The number of remaining references must be: * 1 for anonymous folios without a mapping * 2 for folios with a mapping - * 3 for folios with a mapping and PagePrivate/PagePrivate2 set. + * 3 for folios with a mapping and the private flag set. */ static int __folio_migrate_mapping(struct address_space *mapping, struct folio *newfolio, struct folio *folio, int expected_count) @@ -786,7 +786,7 @@ static int __migrate_folio(struct address_space *mapping, struct folio *dst, * @mode: How to migrate the page. * * Common logic to directly migrate a single LRU folio suitable for - * folios that do not use PagePrivate/PagePrivate2. + * folios that do not have private data. * * Folios are locked upon entry and exit. */