From patchwork Wed Jul 24 01:05:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13740495 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 15FC1C3DA49 for ; Wed, 24 Jul 2024 01:06:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6E676B0083; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B20566B0085; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0E266B0088; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 859F76B0083 for ; Tue, 23 Jul 2024 21:06:05 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B9FCC057D for ; Wed, 24 Jul 2024 01:06:05 +0000 (UTC) X-FDA: 82372854690.09.9058E2D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id 7F2E610001D for ; Wed, 24 Jul 2024 01:06:03 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QiOQ2lw3; spf=none (imf14.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=1721783117; 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=y98KBMGmUe2J2iqnZ771EKPXLObJQtefLUww85ZIvzI=; b=zbbCp3zeehl4gMnPB0zIQNn72zSL7Zw99jaKMogs69RaoJHAs3u41y4cakAcgBD7tHfoma GEcn3EsVIpAYLSBQ4coj3S/EiEcNNlx72uauy4sTfFRonbWWt2qXfCa7/4IccD1miFYaX1 QNKAWPSLg18thiPUA0hJH8Rwd1h02YU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721783117; a=rsa-sha256; cv=none; b=CHQqo3R8ifyqSv6rTe2zsxwVw+GJXCMRHMAWtZwRCV6lhK0Hnb5a8iWkJTwygLffiXrSVj CFEn2t9UImAIP78w0oY/m1NgNZsE87YWBgy4rASeYCS79LjSOyWNrLo2VFCpRSbyGIJnui gsVJIfFFYEeR7XOozl7PtCwUb7JOz6U= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QiOQ2lw3; spf=none (imf14.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=y98KBMGmUe2J2iqnZ771EKPXLObJQtefLUww85ZIvzI=; b=QiOQ2lw31tG6W157GXdGaIw6xs pDfIkgyYS9dEB9cL504E+dGBIPHOVam6KHS62m4c62UOXkg4HcTYnZLcWshnenzJAEreM3HDHq6DS lN/UH1pW0LmG0zsQqURu6dFDhVfPGz80ti39GxZTNszvk2Nw4I1GQxQPYS192IYkzH/WZQZKyt4vX pqv8U0MqbEWyfeLIyl5AGtHgnnnZ+ApouJQY/5R78w8Ngq3+KZBHFfWlKmVjgSGKxaEoZzOX6b7Oq Fca/bc3x8XL4EOjIhoXn3xgWZ6RrISkhHP+YBQDlJtwGDkCunMeGV6pK2gsnN9afcOiOycLNBlrod LJTranlQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWQS2-00000007MpE-21p9; Wed, 24 Jul 2024 01:05:54 +0000 From: "Matthew Wilcox (Oracle)" To: Linus Torvalds Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/2] fs: Remove calls to set and clear the folio error flag Date: Wed, 24 Jul 2024 02:05:46 +0100 Message-ID: <20240724010550.1755992-2-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724010550.1755992-1-willy@infradead.org> References: <20240724010550.1755992-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 7F2E610001D X-Stat-Signature: mor3sho7aenfru5qocptxbt8xn6hqq98 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721783163-14209 X-HE-Meta: U2FsdGVkX1+BiezDuTUIX45fH5TTIVyAmEqZYhTdy0LyzrFLSe9Lm2jpIkG1Cet0lDdrDUuNP9K9GO+VxbrxArAHTKlgCgRQkLze7NsPMFlfBVv5ww4/U4ERnLW4EYJxWDl3L8WptRfiAgqaz947nqzOvFcABIjQiZ2rZynymC2Z75U4Zoq2tVPfBKd3BGiKIMybF/XUFeGqTGY3Dyd1oM3pyvTCa/Mt9TH12xnmyDk58Rq8LqRk72aXgxoacU+VG/ok7xzIwQtVLb2Dk21fDFUHZYHWtAozZWNIt1yLMK+EOeoY6AQLkiPNbJfW3DXW5GlzgmP76c9o6MLiX3rSiqSH5dWeM9p7IMzZ5xTF5r+ZFXzMZREAm+l0wpMkc86aVT0T+KCis3MaizJwj4n7EoMHT0JpPx3iIHKRqnhSeg6Dv0eX/1xROSC2eWQE7vHAvxbtfw1uQm/oZcX9waOcLK9oyWD85brAB+AIZvObU5TDFSYATCjbHRs6mywxTZI2Tmemkl+epeTzniFkXANPh7MPad8DEhegT/EYEVJtnCQlYRhND18XJG9KPbjuF8dUooIGYlZ0LmYDFYEWtlI0/fyPwbGQBuxyZzXOh4SNeDdpvz4jaYIQid5EoRQN/XL6HhHlvJT4iwx+CUwWs4vwVlzDJlGNE8sp8cp5TAgvRfm2t/POhUBMb9/BmxYYz3aeKheUdtQ02dJXoFy9KN5DMx/lh1D2dN5FL0Pi21Xe1XcLeTQBLdzfHHXRfeE9JB6kmxxKKSqweV2v5cAK2dhMxWoWERYq14p0VuR/Gf7QMqDc8NleRBGgzHlu5T/e+sk5XP6VN59Z5QMC1y1FljtPvRcEXMnHuu8r9/AZplZFmhA91SjwyWvwTDLED2I0MCpkV1lGwyH+uVlX9pAnuy6dPMYiC+RteJG3cUGTAwbQJeZcGTi4P2AFjXvrdqhEJ4y7H1FX7enpZA3BfuEE6ES uamhVd1C 9FDlbqcEipfqaH3Q+qwhJl95Mv2HBS87voMVe/zp8Kj0OxTuGOOEc4TFHllLCRkf5dPU0GQSV+x9lZCD1mo8lEOEWNvngKxizW13/m3Z9/WztjyRj/6gc8kcjjdf9Y26CMhEA9KzPF7RcgGkCDIXNhgVECW3sbQ7Jn/ju4GJVVPzY9bJqKxZnPp2FSWbiJuMEUp7OndhhWXb0Ld2KIuKLDsEic79pww1T6OZ3VUES9QS/Jp6gQo1EhXTdrlKAlr6PbV7n 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: Nobody checks the folio error flag any more, so we can stop setting and clearing it. Also remove the documentation suggesting to not bother setting the error bit. Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/filesystems/vfs.rst | 3 +-- mm/filemap.c | 8 -------- mm/migrate.c | 2 -- mm/page_io.c | 4 +--- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index 6e903a903f8f..a6022ec59a2d 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -913,8 +913,7 @@ cache in your filesystem. The following members are defined: stop attempting I/O, it can simply return. The caller will remove the remaining pages from the address space, unlock them and decrement the page refcount. Set PageUptodate if the I/O - completes successfully. Setting PageError on any page will be - ignored; simply unlock the page if an I/O error occurs. + completes successfully. ``write_begin`` Called by the generic buffered write code to ask the filesystem diff --git a/mm/filemap.c b/mm/filemap.c index d62150418b91..c7bef2247a68 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -530,7 +530,6 @@ static void __filemap_fdatawait_range(struct address_space *mapping, struct folio *folio = fbatch.folios[i]; folio_wait_writeback(folio); - folio_clear_error(folio); } folio_batch_release(&fbatch); cond_resched(); @@ -2342,13 +2341,6 @@ static int filemap_read_folio(struct file *file, filler_t filler, unsigned long pflags; int error; - /* - * A previous I/O error may have been due to temporary failures, - * eg. multipath errors. PG_error will be set again if read_folio - * fails. - */ - folio_clear_error(folio); - /* Start the actual read. The read will unlock the page. */ if (unlikely(workingset)) psi_memstall_enter(&pflags); diff --git a/mm/migrate.c b/mm/migrate.c index e7296c0fb5d5..e4431c157bc9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -585,8 +585,6 @@ void folio_migrate_flags(struct folio *newfolio, struct folio *folio) { int cpupid; - if (folio_test_error(folio)) - folio_set_error(newfolio); if (folio_test_referenced(folio)) folio_set_referenced(newfolio); if (folio_test_uptodate(folio)) diff --git a/mm/page_io.c b/mm/page_io.c index ff8c99ee3af7..9d4edf8bc422 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -273,9 +273,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret) * memory for allocating transmit buffers. * Mark the page dirty and avoid * folio_rotate_reclaimable but rate-limit the - * messages but do not flag PageError like - * the normal direct-to-bio case as it could - * be temporary. + * messages. */ pr_err_ratelimited("Write error %ld on dio swapfile (%llu)\n", ret, swap_dev_pos(page_swap_entry(page))); From patchwork Wed Jul 24 01:05:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13740494 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 644F1C3DA49 for ; Wed, 24 Jul 2024 01:06:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D79C6B0082; Tue, 23 Jul 2024 21:06:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8859A6B0083; Tue, 23 Jul 2024 21:06:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 727436B0085; Tue, 23 Jul 2024 21:06:03 -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 5940F6B0082 for ; Tue, 23 Jul 2024 21:06:03 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C4C9814055B for ; Wed, 24 Jul 2024 01:06:02 +0000 (UTC) X-FDA: 82372854564.14.2A764DF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id 26928C0014 for ; Wed, 24 Jul 2024 01:06:00 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=J62so7Gs; spf=none (imf22.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=1721783124; 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=eFusLkbviS/7xHQGQO2zQewFlhdvWZpUW4NWdWMQGhg=; b=ReQy7LHaeaWx89M3yP5e8OxsHyVmBqWdmxJUg/fJTk3yCZ4FE1iEEk4XCB3wjUYwXRGca/ g2CaMu31hN5itOgV00mxVihxhcYReF7JjuRLKXPORPTJxFidUR6XJ495qBrR1ZwRtPVBHh 25tx8ndEdk3Lp8wCxEGqkxmd1gr2ZMI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=J62so7Gs; spf=none (imf22.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721783124; a=rsa-sha256; cv=none; b=289SnustbbOynWhnFS1L+Z+49pDcofEuKbAkmis+7pVriEDVNlErEPX1gv4nRwbc/tEdum I8z4jFubeTXpXIjMy0+52YChQOi/tCvMGh7C9ZKcIELu3RJ2wUIaccacKFnfxojwePDPO2 iC1YNpvlzIQCejQz3XFWHAo1xuuSllE= 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=eFusLkbviS/7xHQGQO2zQewFlhdvWZpUW4NWdWMQGhg=; b=J62so7GsQlrq2UaPlrl2663LyB ZTGzko4Pa1OWiKK0+XQ/DFOcOAbhFhPDJiz2ZAHinFGsmdaks02Ut/cmN9FI7N7LLxL7o6BYAjZSa ELwKEWyKDpXUbwYLKh0iiI2IQWYjVBQO7QNGTLKYVf+4lA+GGzbfB86lpj11TRbrwsJ8tkTCeoDzf UGZNTn/71tPvGcORj6fR6sC1mEVHisbh3Ayqd1heabZn1XGOHRc3HTs2JB8grYxcSbck30h1xoUgA 0Kqqtwuv0WcPHBkKg/RsdrtnQ6uHS1pMxfymnjRAD/0JVDWDP09QCDSPzjImYpLweU331qvXR0sWC NrHKliGA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWQS2-00000007MpG-2NZC; Wed, 24 Jul 2024 01:05:54 +0000 From: "Matthew Wilcox (Oracle)" To: Linus Torvalds Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/2] mm: Remove PG_error Date: Wed, 24 Jul 2024 02:05:47 +0100 Message-ID: <20240724010550.1755992-3-willy@infradead.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724010550.1755992-1-willy@infradead.org> References: <20240724010550.1755992-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: tq4gd35b5t4bkho5196n731h7xfek5y3 X-Rspam-User: X-Rspamd-Queue-Id: 26928C0014 X-Rspamd-Server: rspam02 X-HE-Tag: 1721783160-443904 X-HE-Meta: U2FsdGVkX1/5nJdrqSN15viUzuieMYdLrhDppiobHZHOBwBG0yH61g6eGV7ncoF4fgRHqOu/wVDxEs108Npi69wuGqYpJub7YE9LRbqzTlfziUMJeKZjMSwLAMGynzPQo3iKa6tKaHa6PWiysfRGA9dcQk/WK8gyxrwActR9NAWTfZg6iArYR9Wt+efANcxnuug/PiYNMJDb6ilGhUao/sUZhBo/WuyV+Zd0chPiPLEE/jR9gEJF1pfy9Nl2BFUbEhghokwbh2rvEzgO/moI7ucn36TusWGulhkg8kIBA+n+D8vVExNgYq7EwLkP3qej9GkvsD5OCnvMKr66e4emOYfIPWQ8FBbGyxPrQl8+CvKFRNCHeWQqw4HlybMPNQkxIibLav7rPhq77sVBbwiL/yO/+GWaOzJ429K/nvSh6QBGha+rT6adjc17xI5bFhmpRqxet9BL0jof3PLUcTI7WgR2IERPdl2jqn98Y7WGDkryeKnw+yoda+xqR8nz/+PDWrOStQ+MPRnpPHs3iZkSbvW11DZhVNqbD9W1w2QPUt/0HCd4flEpvO+wTZWCaIw0Vd2ysnMF16AZkIs489MIdvJO5PhJ0QPxmRVCqQ/d6L6h7EE1sSvLTb5s0saTik0+WfRqT3PFpxq8FhnOQJZunNeJmqC6RwO8Kx+P5DCV5+Wd0LwcdBm23CfKB+411R1NO6ogeItYJ/m0vvwAt+reVRyHTLd6oQrrOmcBITcm+tpy7vNZOBPNy2SN7JD/kVXukOw9wj+vefDR4ca7anL2dJLev9YWwwIIKuu0osYdRTnCTcEiCCe97B+tdg512j6rf/51LGg3ejd8vfgSyHZiYZyCd/NOK3Uu1hFJqQ/WwChyVCVsN8zYx4fXapgT8EiqUN2oRPixu5FN6NNEJc3Js6aTMzinlB2a+L+fFuwk/APVP+qTHBoChwKR26Dlx2GumVltWysAKEPQ8D1DwCx 4LBVq1xZ ytObpLbH1hU6IES1pCHKQHWueGIPWgoYe4zihAEgttp0weIwpZbPvQ+4/nvZGoTtTnM3LEZlntWNBtH5MSB6dFTOsRu87cZsb03FaCPE6ngnCwBQAu/q4Ep7o688sYfi8p0mdwLLff3JjKjH7M6qiu4UM3Y16uJisaPD0FnkhcArl9PjzpnE63HzrfrDJBaC857c/62eNVAQKXzIH/Elik4TXDRs3mO4JxRILpcgH/flGhNJJfh7d9Cbj52h34dyA9qt/ZuOnx7RZCMuau7s9rUdCUAoNMpjn/kZxHm9+SswxJNGwTxRW5HrK7KJ9t4rh5wc4 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 PG_error bit is now unused; delete it and free up a bit in page->flags. Cc: linux-mm@kvack.org Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/page-flags.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5769fe6e4950..a0a29bd092f8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -66,8 +66,6 @@ * PG_referenced, PG_reclaim are used for page reclaim for anonymous and * file-backed pagecache (see mm/vmscan.c). * - * PG_error is set to indicate that an I/O error occurred on this page. - * * PG_arch_1 is an architecture specific page state bit. The generic code * guarantees that this bit is cleared for a page when it first is entered into * the page cache. @@ -103,7 +101,6 @@ enum pageflags { PG_waiters, /* Page has waiters, check its waitqueue. Must be bit #7 and in the same byte as "PG_locked" */ PG_active, PG_workingset, - PG_error, PG_owner_priv_1, /* Owner use. If pagecache, fs may use*/ PG_arch_1, PG_reserved, @@ -183,7 +180,7 @@ enum pageflags { */ /* At least one page in this folio has the hwpoison flag set */ - PG_has_hwpoisoned = PG_error, + PG_has_hwpoisoned = PG_active, PG_large_rmappable = PG_workingset, /* anon or file-backed */ }; @@ -506,7 +503,6 @@ static inline int TestClearPage##uname(struct page *page) { return 0; } __PAGEFLAG(Locked, locked, PF_NO_TAIL) FOLIO_FLAG(waiters, FOLIO_HEAD_PAGE) -PAGEFLAG(Error, error, PF_NO_TAIL) TESTCLEARFLAG(Error, error, PF_NO_TAIL) FOLIO_FLAG(referenced, FOLIO_HEAD_PAGE) FOLIO_TEST_CLEAR_FLAG(referenced, FOLIO_HEAD_PAGE) __FOLIO_SET_FLAG(referenced, FOLIO_HEAD_PAGE)