From patchwork Wed Nov 8 18:28:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13450383 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 88DA8C4167D for ; Wed, 8 Nov 2023 18:28:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0F3F8D0073; Wed, 8 Nov 2023 13:28:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC0898D00C3; Wed, 8 Nov 2023 13:28:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AADE88D0073; Wed, 8 Nov 2023 13:28:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9AE648D00C3 for ; Wed, 8 Nov 2023 13:28:20 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 74E221408A6 for ; Wed, 8 Nov 2023 18:28:20 +0000 (UTC) X-FDA: 81435621960.25.807C7F2 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id BBCC018000E for ; Wed, 8 Nov 2023 18:28:18 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bBmr8T5H; spf=none (imf16.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=1699468098; 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=3uYEGw0nejdZBmCvvlmATeadAl5J07+1G6Eu9ezz2DY=; b=UoilUAP8jexlP+MTu9ZTnjSZdflIrsY03Edq7OEvseSbjte1YJHL5gUm0lUS4hkFmZGjaH 3RXXWGuhzDlBndbcsIipQBmzPVYMeuTN/RL8TvLhy0gqymidBU5dVDc+LA7CinY4+1b7T/ 0Ur6/Pf2eQjLceAoHZblPrAO90trRYI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699468098; a=rsa-sha256; cv=none; b=Z6wRE4RX0KxShUtNFBHGl+GR482ohIdrAY6Ca6plbxYxiHLRIG9/wP0q5wvDSXv4EN1JG3 sRKNnxVTK6864xj/AFPZRLZEecI73dOif2ZEttY00ciyC8p49HaD05fP4m+hU750yLjHpY ytN5H5WWvt18+Rs3dFO7iV0y37bfwU0= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=bBmr8T5H; spf=none (imf16.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: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=3uYEGw0nejdZBmCvvlmATeadAl5J07+1G6Eu9ezz2DY=; b=bBmr8T5H0cFseEt46J2SLgIXNx t+w/SlcZy1E6WFCzoySjFUmckuukY3OHDV43xLvXGdxpv0b54STL6E53F0vU2H0DweRJRirPA9bnu pSO/Uc3226wzwsvNqUx+ySN+iKSR7jCGp/f/t/6kOSGnvC5cctadZL563ajjkLYREyGUMuDbL+N2M SqtJ0SrK85eFvPg1rsSQr3kUK3fQNkZzXDcddkFC0to5aBapXD0PJQqFaPZgmjO13O3P8hUurhp1A ydIndwR0ZW2CrkL3YCb1PGZNMU3FIkaxbJIfgF3ggKOOAVyksbAl6GYzXM78X+bXxd/jr02GUmo7/ CcTitUJA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0nHe-002WdE-RK; Wed, 08 Nov 2023 18:28:10 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , Naoya Horiguchi , linux-mm@kvack.org Subject: [PATCH 0/6] Fix fault handler's handling of poisoned tail pages Date: Wed, 8 Nov 2023 18:28:03 +0000 Message-Id: <20231108182809.602073-1-willy@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Stat-Signature: cbaba1znb7outpjfs5o8apwijfm4d1xc X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BBCC018000E X-Rspam-User: X-HE-Tag: 1699468098-947616 X-HE-Meta: U2FsdGVkX1/UH0Ru3iZ9XiM+IyvWETsXkoives6SaS5Nu4IvpdSFrwhFF4zr+GteJAoZX0mJiUr43B2U//QAkIFc7ieEAdB0BjuIXOHp7MoBzHoGN1zW/Vc4HEVwUjBNfpw+cFujr+wtg4H5QyPYG9hfncJ7qYUqweEnS0UigCuMjy9l6JXgGIKpdG3X/Oos7gjs/Sl3HXlHrq3qUxqD/g+cpNMkp/fc58U++t50Dicv/EFEVyotz7RRg0XDCdfdB4ffG+r38p+eQxvQ9G5iqlHahU86n7BypQCuwm0ULFqcjpGpPvOnIQMNl1fcPw5PK0KnZRuckfw0kY2XlzZ8yn14fkii0mSHO0fWHlArTAgqy+jxfqwqJZ4223lu67UvVUXcXBM75UMLqENU4ygeXYVbDWLE0uVTDSlVH+gqdM+HfAa6gm+pCI95vDMMq8T1JXWBlT5x5qfMxMR5QvleIUB9dWWrZO1elJrMfKf8GZjalF6hvgJtRO48xohYJkKI1kh1/SGgKkaCHG83NfliFrYMPJRBKcUWkQcWpRGLh40YJcuPhIEKElT21+cmD5UkXfGRLWw4FpidDUGoGF8RuN/AsESqVUfmCx8AkXonDEUAks/kcFH59zSrrHJUe7L85z0rhHfFfwInKYMb+B1zjNJG+Dxfm1F/5CHPpmIkVxPPRjV5MfnRFULOB+RjHZm1w5/YSGxWSvXbg3UQ1+G1duURXEI6msZmsezK1Tbhs13luThxSmETtZqMCtaohSs5lEI+2JrRvb1M7E+4bGK+U+PnH8olCFhUCfy7vXHG8MFDsyetU8fpr6cBdnJyy7w3Ax/v2HLzomgiFJrPUUePP4Oofdjc1eArKJpm+Dzf0ZRC0gyA4LtArksO/p86xYsaltZw1fHN+YswtMxG+kvCa47146SBnxwf2p3Ss2zp71upeFMJMe8QFO0G9QhVy6kp75N37lvdz8++oJFrTaA 172cpB2b ldoQlPnUHmjQ1dZcBU2kCi+9b+nrAaM61UNr6U2ZCpkDYkPibrU97UqQTT0CW6+boQoYy/3iynrIAVkx6H3pduY9VXUkLCzC48v46DBaLmr8/wEoRc4TdtPSMDg== 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: Since introducing the ability to have large folios in the page cache, it's been possible to have a hwpoisoned tail page returned from the fault handler. We handle this situation poorly; failing to remove the affected page from use. This isn't a minimal patch to fix it, it's a full conversion of all the code surrounding it. I'll take care of backports to 6.5/6.1. Matthew Wilcox (Oracle) (6): mm: Make mapping_evict_folio() the preferred way to evict clean folios mm: Convert __do_fault() to use a folio mm: Use mapping_evict_folio() in truncate_error_page() mm: Convert soft_offline_in_use_page() to use a folio mm: Convert isolate_page() to mf_isolate_folio() mm: Remove invalidate_inode_page() mm/internal.h | 2 +- mm/memory-failure.c | 54 ++++++++++++++++++++++----------------------- mm/memory.c | 20 ++++++++--------- mm/truncate.c | 42 ++++++++++++++--------------------- 4 files changed, 55 insertions(+), 63 deletions(-)