From patchwork Mon May 30 11:30:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12864539 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 56B6DC433EF for ; Mon, 30 May 2022 11:30:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC61D6B0098; Mon, 30 May 2022 07:30:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A70D56B009A; Mon, 30 May 2022 07:30:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 871366B009B; Mon, 30 May 2022 07:30:11 -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 759046B0098 for ; Mon, 30 May 2022 07:30:11 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 2CAFC80C79 for ; Mon, 30 May 2022 11:30:11 +0000 (UTC) X-FDA: 79522190622.14.3D9F456 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf24.hostedemail.com (Postfix) with ESMTP id AC9AD180032 for ; Mon, 30 May 2022 11:29:55 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LBY7d1DzYzgYTZ; Mon, 30 May 2022 19:28:29 +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; Mon, 30 May 2022 19:30:05 +0800 From: Miaohe Lin To: , CC: , , , , , , , , , , , Subject: [PATCH v4 0/4] A few cleanup and fixup patches for migration Date: Mon, 30 May 2022 19:30:12 +0800 Message-ID: <20220530113016.16663-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: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Queue-Id: AC9AD180032 X-Stat-Signature: bfjqsekm1m94gr63cx9ur8ejkg6tmbfx Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.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-Rspamd-Server: rspam09 X-HE-Tag: 1653910195-858525 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 remove unneeded lock page and PageMovable check, reduce the rcu lock duration. Also we fix potential pte_unmap on an not mapped pte. More details can be found in the respective changelogs. Thanks! --- v4: collect Reviewed-by tag of Oscar. fix build error reported by kernel test robot. v3: [PATCH 1/4] mm/migration: reduce the rcu lock duration add the analysis that the original race condition isn't possible now alsoreduce the rcu lock duration in kernel_migrate_pages [PATCH 2/4] mm/migration: remove unneeded lock page and PageMovable check let free_pages_prepare() clear PG_isolated for us [PATCH 3/4] mm/migration: return errno when isolate_huge_page failed rename isolate_huge_page to isolate_hugetlb [PATCH 4/4] mm/migration: fix potential pte_unmap on an not mapped pte collect Reviewed-by tag v2: collect Reviewed-by tag make isolate_huge_page consistent with isolate_lru_page add hugetlbfs variant of hugetlb_migration_entry_wait v1: rebase [1] on mainline. [1] https://lore.kernel.org/lkml/20220304093409.25829-2-linmiaohe@huawei.com/T/ --- Miaohe Lin (4): mm: reduce the rcu lock duration mm/migration: remove unneeded lock page and PageMovable check mm/migration: return errno when isolate_huge_page failed mm/migration: fix potential pte_unmap on an not mapped pte include/linux/hugetlb.h | 6 +++--- include/linux/swapops.h | 12 ++++++++---- mm/gup.c | 2 +- mm/hugetlb.c | 15 +++++++-------- mm/memory-failure.c | 2 +- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 5 ++--- mm/migrate.c | 42 +++++++++++++++++++++++++---------------- 8 files changed, 49 insertions(+), 37 deletions(-)