From nobody Sun Feb 8 14:31:39 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D69ECDDA0 for ; Wed, 24 Jul 2024 01:06:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721783167; cv=none; b=dEwGsGSiR7ZEKRoIMwVVAGiAr4At7JXP4jY6SccJufSrWQh5DHxRDJcM7v5UaJz8E5MxmGdUAuoXCvx3yKqPc46j97Wm7RXtOEr8W6KvSFZVkkqhc31MetjHBhjY6SlYOBlogFsHRHpBjgRWiji3gBZkj+/nlRHbPxo5naHP2aY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721783167; c=relaxed/simple; bh=psUIz3oVZMx1qwQEFAiBplG9CcQKs4s9Itq16i67tAE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=giXllvU4TanSgF3KbFfQ6WeVvDLXYMpQn/sQ8S8xuMyc6s8VSf6yXwHevPJ1/30dDQzDn2oC7DVP7XfM2L/wYZthmiv4F4VL7JxhETIKJT1V7idPMYhKk/0mR7XueQdn8s4CrTPzNVRcnCHoMwXB8hvFP81oEvubxm1C5bjgAis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=QiOQ2lw3; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QiOQ2lw3" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 de= fined: 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. =20 ``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_sp= ace *mapping, struct folio *folio =3D fbatch.folios[i]; =20 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, fil= ler_t filler, unsigned long pflags; int error; =20 - /* - * 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; =20 - 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))); --=20 2.43.0 From nobody Sun Feb 8 14:31:39 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 009B15C99 for ; Wed, 24 Jul 2024 01:06:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721783162; cv=none; b=GEDG/FoHq9PhpZXG5OgCb+pTxdNRVMYqBQRpqVNd13RkUEVBocyYSEmq6rpRA9oq6WrkB5+nU/tH/4w39HXxtjOoQMmbSUKrixv+4t9IRXSIYUF62Wibm0TFj7VJ7dqn9fGavNjhXJg2c459fQ4Vn4L0KXBDLCV1nG5a3nQPQL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721783162; c=relaxed/simple; bh=GwJNvq931G20gH0CQL3xXW+3Ks7XhNZBlOUlu8sD2zo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R9PVn8jbzeoRHVjKK8OWCp+ORgeJ7gg+gM/8etPkm31hLRnhPA8Fo0x80S7wYNtefT7pyhKuEhN+SDJGYq8sDN3ihnwCM1AWp4MKrLGvAQbPHoUkC/TgdE51U8FsfjBnLxh7taxWSBxQoRiNmpULFQ3AALXnekXL7FqHW6gMj5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=J62so7Gs; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="J62so7Gs" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 { */ =20 /* At least one page in this folio has the hwpoison flag set */ - PG_has_hwpoisoned =3D PG_error, + PG_has_hwpoisoned =3D PG_active, PG_large_rmappable =3D PG_workingset, /* anon or file-backed */ }; =20 @@ -506,7 +503,6 @@ static inline int TestClearPage##uname(struct page *pag= e) { return 0; } =20 __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) --=20 2.43.0