From patchwork Fri May 31 03:29:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13681085 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 7F40DC25B74 for ; Fri, 31 May 2024 03:29:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C192D6B008A; Thu, 30 May 2024 23:29:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC8846B0092; Thu, 30 May 2024 23:29:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB6FB6B0093; Thu, 30 May 2024 23:29:48 -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 8DB906B008A for ; Thu, 30 May 2024 23:29:48 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1ACD84104D for ; Fri, 31 May 2024 03:29:48 +0000 (UTC) X-FDA: 82177261656.02.E782882 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 95AE3C000C for ; Fri, 31 May 2024 03:29:46 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Et494RoS; spf=none (imf10.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=1717126186; 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:references:dkim-signature; bh=q4RdhM51WRWOCZOsX/8tBi7vP32YdTRqOo5ORv+oq7E=; b=3qcd/JFPi711FE+f9R4B5GyM5+PK2a9mdqa5PoBWk61i6StHjPgugCvuXUvIoXauBT/LHy D/jHZds/pp2rjG7MB09qIpsugT4VD7wvKuzoHeLw+njLQ75URnZBvCnLAdajj8/+QveaHi Ez2vwdJTXZV0X+Jyzn0Rj/5i048oEow= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Et494RoS; spf=none (imf10.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=1717126186; a=rsa-sha256; cv=none; b=FTn1CleGVy6fzK81ZWbHnuPZeAW7p/xuPrpBZbEoFhxJAVEGvrsEuVfs8oPhsCGGvqqQym 98Dz3/1GBKJWc1ZGlBLQ8idpUkRlayu91BilgDP5DG/YAOaPYLuR4Or2MpD5cJTHv+vvFk bN/Wy3/Ty6BFa3gU1u9B5maa35dqj1c= 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: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=q4RdhM51WRWOCZOsX/8tBi7vP32YdTRqOo5ORv+oq7E=; b=Et494RoSfQLODjjTgE7+uAtTWJ H/T8MlMtlHgeqlXxiwV4lbOrTllVbWSvEqAtv6VEfqX88qQhAAaSyFJ/qYhFvBOSSgbHDmWq8t7gF omf1rlWeLI18zyz/4kjds5pYD+M4iF4ERruIB+WEB8J8yr9Khw+fkL0qIZ/NG96usPEUdIUAfi7zh n4Hl4Iq+ETUbMtPgTXB0YRW31+slQMWCf/oFQsYVymp6vosqvWBi5pImQiLizdBPGLEQQoL9jEqsR /jRq2uLncKA+GXjk8UgKsV3l936X6h86pojXOD4x3/+c9aJrMYyFHn1eDJbq7TCMHCrDfuXlgyJfX MZ5t1A4A==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCsxb-0000000BNkD-0NiF; Fri, 31 May 2024 03:29:43 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , Miaohe Lin , linux-mm@kvack.org Subject: [PATCH] mm/memory-failure: Stop setting the folio error flag Date: Fri, 31 May 2024 04:29:25 +0100 Message-ID: <20240531032938.2712870-1-willy@infradead.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 95AE3C000C X-Stat-Signature: pf5anwzyqyt3u8w8rbs9dpk5wjaxxnkr X-Rspam-User: X-HE-Tag: 1717126186-117127 X-HE-Meta: U2FsdGVkX1/y8NnMjp3XTsid6+zWyMp51XX/HCRcT4WI1KMhAqwqPp3NCIHiXl6VKwY9EQ3H6di9OYi/qqDnvIE43Z4B+Yd+U/gY4Ea4LdkfrPvx6jEOp90k00m2uBYoqIUL09MLkSklanISjUusktgv3E7RNh2SuypmXoRXcRSX7Q7gk1zI1a7c8KPRY0OaBZlUAeJXnRxVZafpiqAsuk6zKOtZsUp24uZ44kohpPMEKafa0alP1GOPIa51RI+n0NYFcM+SURH61jIa0pnSFoUE99rVWFl7z24xNuuLww6iAkL5/CMG9epQKJqMhjFJhuY79KT7PsWmcXDaFLhR76M6aWt4WYd9RgXGpG+HzhRB88wvHcSGjX3XQhQFC7A+/ozlK9cVxg/+BJpQfyvUgnBSFfZY+J4KfWgOujHOID/x79UDazf0rZYp75j4VKUMljLNkwSpIPVmeGegPf8IfXxD1StFUJl/doUsBKG/o98MWbu9SzPljoZrOsO4lFgYLU520gK38v8FRdDmEOBCOtxBaj/EJkcK3guGpGxd41sXwWZkaUqSDT1AChdlB5a987KM57NW6MFYPEnuXYFbkIViJllBObSAACNyUU1qpCGctRNijPcZv6FCmEfUZG8c5Xxn+sj54mv7mz6U6/dDW/ur43T18rzlHYgB5kKq/7jqnmNNnK1o6BfUNzLOeC56v132M0tO7Pasidb6Imu9H2jNmkj0gYAd+YHinUfr41d0ZRPq3Kv6q0UmjxpgbALKifllL2jWxA1S8Fwkz1g/KR7U4sUOsvyc7iblH50mq+r3HvjpBEqPjgBcTC0YjVT0wjwEXk3BvgSOTz9yQBkfdHrYe+W+QYo5V60rUHi6iNni71/w266nmQZawhvwaDr2L17HyP7IXFu6X+bmgyzMOI6AoQ+7dHRK4sgAVZHY/N1iPqQQa8mDM+/mHpc25Mrwi8is4+TrxxGqYQRashu 0xrH93ZX HLNwmmyyK/lu/vBAX0iBoa80mWARoPEjMTXP+tmvRoUpDDb9ALAFonRmS0itD1d3oJPe9Spf4vTO0NLBoAZWgJmacqsWy+NIcyVUO7f36dbBPBrxbPaDDuWOHmZwy+G+FsYwh62aGkF08koFkebF+JrjWQJeXoAbovTxQwMbGu6VZz1Ze+1PCnLRVtgqoitejw88aVnEQB6BYkgxwiGeDa7JA/DCspXwWKWNYCZ+CZjn98cHsCWlRLQ6O1mqNOVPWLbxn1tUt6/17YfrpWjNg8nKM6y7zA42T8/Hn 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 error flag any more, so setting it accomplishes nothing. Remove the obsolete parts of this comment; it hasn't been true since errseq_t was used to track writeback errors in 2017. Cc: Miaohe Lin Cc: linux-mm@kvack.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Miaohe Lin Reviewed-by: Oscar Salvador --- mm/memory-failure.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index ac030061eda0..78fdf5ee8421 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1112,7 +1112,6 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) struct folio *folio = page_folio(p); struct address_space *mapping = folio_mapping(folio); - SetPageError(p); /* TBD: print more information about the file. */ if (mapping) { /* @@ -1120,34 +1119,6 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) * who check the mapping. * This way the application knows that something went * wrong with its dirty file data. - * - * There's one open issue: - * - * The EIO will be only reported on the next IO - * operation and then cleared through the IO map. - * Normally Linux has two mechanisms to pass IO error - * first through the AS_EIO flag in the address space - * and then through the PageError flag in the page. - * Since we drop pages on memory failure handling the - * only mechanism open to use is through AS_AIO. - * - * This has the disadvantage that it gets cleared on - * the first operation that returns an error, while - * the PageError bit is more sticky and only cleared - * when the page is reread or dropped. If an - * application assumes it will always get error on - * fsync, but does other operations on the fd before - * and the page is dropped between then the error - * will not be properly reported. - * - * This can already happen even without hwpoisoned - * pages: first on metadata IO errors (which only - * report through AS_EIO) or when the page is dropped - * at the wrong time. - * - * So right now we assume that the application DTRT on - * the first EIO, but we're not worse than other parts - * of the kernel. */ mapping_set_error(mapping, -EIO); }