From patchwork Sun Apr 24 09:11:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12824826 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 AB11DC4332F for ; Sun, 24 Apr 2022 09:10:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F21186B0075; Sun, 24 Apr 2022 05:10:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E646D6B007D; Sun, 24 Apr 2022 05:10:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B79606B0078; Sun, 24 Apr 2022 05:10:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 9C0C46B0075 for ; Sun, 24 Apr 2022 05:10:45 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 69E332847B for ; Sun, 24 Apr 2022 09:10:45 +0000 (UTC) X-FDA: 79391202450.06.9D7F64F Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf08.hostedemail.com (Postfix) with ESMTP id 610C416002F for ; Sun, 24 Apr 2022 09:10:40 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KmMn24jxnzhYT6; Sun, 24 Apr 2022 17:10:30 +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; Sun, 24 Apr 2022 17:10:40 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , Subject: [PATCH v3 0/3] A few fixup patches for mm Date: Sun, 24 Apr 2022 17:11:02 +0800 Message-ID: <20220424091105.48374-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: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 610C416002F X-Stat-Signature: 9dmkqs118bkcro9whasaen5uey8uu6fk X-HE-Tag: 1650791440-364331 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. More details can be found in the respective changelogs. Thanks! --- 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 (3): 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 include/linux/swap.h | 7 ++++++- include/linux/swapops.h | 10 ++++++++++ mm/madvise.c | 13 ++++++++----- mm/memory.c | 5 ++++- mm/swapfile.c | 21 ++++++++++++++++++--- 5 files changed, 46 insertions(+), 10 deletions(-)