From patchwork Thu May 19 12:50:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12854880 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 3EFECC433F5 for ; Thu, 19 May 2022 12:50:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C14286B0072; Thu, 19 May 2022 08:50:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9BF76B0073; Thu, 19 May 2022 08:50:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A14C56B0074; Thu, 19 May 2022 08:50:22 -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 8EFD96B0072 for ; Thu, 19 May 2022 08:50:22 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 590E4330C1 for ; Thu, 19 May 2022 12:50:22 +0000 (UTC) X-FDA: 79482475884.30.3906D04 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id 4747A400C5 for ; Thu, 19 May 2022 12:49:51 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L3qPj11TNzQkLs; Thu, 19 May 2022 20:47:21 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 20:50:15 +0800 From: Miaohe Lin To: , CC: , , , , , , , , , , , , Subject: [PATCH v4 0/5] A few fixup patches for mm Date: Thu, 19 May 2022 20:50:25 +0800 Message-ID: <20220519125030.21486-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 4747A400C5 X-Rspam-User: X-Stat-Signature: 1zpmr9hrdze1y94d5ce99cehdnyb5rsn X-HE-Tag: 1652964591-494255 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: Hi everyone, This series contains a few patches to avoid mapping random data if swap read fails and fix lost swap bits in unuse_pte. Also we free hwpoison and swapin error entry in madvise_free_pte_range and so on. More details can be found in the respective changelogs. Thanks! --- v4: collect Reviewed-by per Naoya and David. Thanks for review! fix infinite loop when swap in shmem error. Thanks Naoya for reporting the issue! v3: collect Acked-by tag per David remove unneeded pte wrprotect per David v2: make the terminology consistent and collect Acked-by tag per David fix lost swap bits in unuse_pte per Peter free hwpoison and swapin error entry per Alistair Many thanks Alistair, David and Peter for review! --- Miaohe Lin (5): mm/swapfile: unuse_pte can map random data if swap read fails mm/swapfile: Fix lost swap bits in unuse_pte() mm/madvise: free hwpoison and swapin error entry in madvise_free_pte_range mm/shmem: fix infinite loop when swap in shmem error at swapoff time mm: filter out swapin error entry in shmem mapping include/linux/swap.h | 7 ++++++- include/linux/swapops.h | 10 ++++++++++ mm/madvise.c | 18 ++++++++++++------ mm/memory.c | 5 ++++- mm/shmem.c | 39 +++++++++++++++++++++++++++++++++++++++ mm/swap_state.c | 3 +++ mm/swapfile.c | 21 ++++++++++++++++++--- 7 files changed, 92 insertions(+), 11 deletions(-)