From patchwork Tue Aug 27 11:47:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13779371 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 7421AC54739 for ; Tue, 27 Aug 2024 11:47:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46C366B008C; Tue, 27 Aug 2024 07:47:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 388206B0095; Tue, 27 Aug 2024 07:47:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 134E86B0092; Tue, 27 Aug 2024 07:47:43 -0400 (EDT) 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 DD3B16B008C for ; Tue, 27 Aug 2024 07:47:42 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 84A90121698 for ; Tue, 27 Aug 2024 11:47:42 +0000 (UTC) X-FDA: 82497850764.01.24BB518 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf28.hostedemail.com (Postfix) with ESMTP id 30498C0017 for ; Tue, 27 Aug 2024 11:47:38 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724759173; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=I8xuJcZSrvFr1vxRjmJHAwqxDZ3vjXFZY1gMUC1Z+80=; b=MN1OFEEm3nFkPYnoBSgX7OUW+vpBBRYhibfp+LQlnpuGXFhHQTuzLL2NNe/J2XY5pcKUc1 KoYa53hbaMbJrNhVaHKD8QeIDAieA2IgP94vCSzoenBj5BtWZ9+GgnfvIN+WEUvm4I9yjg gcQP0ZJGeaxnO4kp7QmBkY/YQad7YPQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724759173; a=rsa-sha256; cv=none; b=PAEy34JVE5Y/E59cq8TyIskB3TQbEK3Y1Y3ZG/d5B5MxBMYvQx2mqTGAYL+Z/0XXx89HER NYj8EzxKEY2jDYuDjwtD9gdbsFbBcEnmTl30GjwcAtepFanz7ZWfQoJvFp3umPbmXes6ov N7wlBAQRWrlX2vv3do9K8etk7XPsbs4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WtQl13Blmz1j7PR; Tue, 27 Aug 2024 19:47:25 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 59A75140120; Tue, 27 Aug 2024 19:47:35 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 27 Aug 2024 19:47:34 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Oscar Salvador , Miaohe Lin , Naoya Horiguchi , , , Jonathan Cameron , Kefeng Wang Subject: [PATCH v3 0/5] mm: memory_hotplug: improve do_migrate_range() Date: Tue, 27 Aug 2024 19:47:23 +0800 Message-ID: <20240827114728.3212578-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf100008.china.huawei.com (7.185.36.138) X-Stat-Signature: rbc3di3d1ipzje17sqc74kj18b7o73pm X-Rspamd-Queue-Id: 30498C0017 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724759258-728641 X-HE-Meta: U2FsdGVkX1+Siq1vmzfHjV+U48Iq/QdIlLZDVxlZT4o9kCHajwNwuFoTgE5PJSzrrHA+kPJKYz/od4liZBkZDYXZY/qHAHdqrbIA15NKxyDdmCv36Byodpigg9Emu6pQLyyya4LedHmZAEyWUD3FD7kyQorR4E9/pQY9FZejh1Gams5Ly4WAuRLwyMUwIcW6wgycgzwKtQKnH1+5yOxtbhZradSHGZX1lcgbZcXEPbAXwPhUcXdgko9ViZQWbZrFCjrh5NVJezbz7iB/liST9o8Trkc4UOu/ChnOfRmCPd90mTtTLbAxDdmFrNXGI8hNKCZxKT5jJ3iNcr7NZnv0LV310cENKx/K27qucSa2J/BaU8zZ9eGRIp5IPKg32kW6ch93fDV4gXJdnUhd+4uNpajc7z887cX6ZcN+6iak/nKAQQHwtpAu4vZyA8nCBxk4gvndSi3zQ15rZxKOTyaPQAMp8GLKeeK+GVJo4Gk4FzUIRRhj5attk9CjVNt/ZwaWNJ6OyySG5Ohd9n4aLQ/qeFE3OROZfafiR0SsPlvyXJT4X28iCa011GVwFkD/hhTPNEZs2n7ZvPu3MPza33pBMRaIojWb0vKUui8/g0Z82hFKF/17+PdAm4BQ7yQasjwcxrXPVsr3I1AzSFHseUP/6RGFsiM6RkBhJnEsBW7xzNCnlB4pSxI1929GtS5TE4yN4Wj95IKkOmOSCH7W+59QeWcr+qVpgRTkJiQVIn126C+hpY3eDPSTVv6+OmjSN0YBTA3C7WkCV7SqT6JT8Ky9jr6PLGfTdPg8odYI3g3XrRB0DlYq+E7N0HxWACof7l6xdEIlRlE2DLKvkaFoSgf/Ay4GN2f8pG3dQsCPKj+KqF8OcmzQpm3cK+qCgwxGSLmea4+s/DaUKtVHBIfDqzqxO+6D7X2ZYvhIAuSNM9evg4A6R/kqhejsJvDurDg+aHaMUetIqdIrzNOEelgkMm6 vy0T5kbh Exno7V5BnsllQGDF3qX/xYVkUxdc5QwH3nsr294pz6gS48uG7R2n3EVsZXv6P0W8IgpIUTc9xGrPUEaU333vebOabIDLyCrkhAlauXJG3zEO0rBNpmt80rStTGDl2DqxXbatNsFaFocRKzW9icP9/W04jq4Wxi1jVWy4A7iExL2SyrsGPaJn/v3evtKmSG4XDqt5Q7WKiZ2Pn+CdhN6YwKDVWZdBHfQHYv7uF6VOudyUV74E= 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: Unify hwpoisoned page handling and isolation of HugeTLB/LRU/non-LRU movable page, also convert to use folios in do_migrate_range(). --- Hi Andrew, since David and Miaohe give some more comments, no big changes, but need to update, so I revert v2+fix on and rebased on next-20240826 and resend, hope this is final version, please use this v3 if no more comments, thanks. v3: - update comment/typo in patch1, Per Jonathan/Miaohe - remove return value of unmap_posioned_folio() and print inside when could not lock mapping for mapped huge page, per Miaohe - drop incorrect KSM comments in do_migrate_range() - refactor isolate_folio_to_list(), per David - fix folio_put() in soft_offline_in_use_page(), per Miaohe - use hugetlb instead of huge in patch5, per David - collect ACK/RB v2-resend: - fix isolate_hugetlb() build error in patch1 v2: - address comments from David(eg, fix HWPoison check/use a folio for pfn calculation firstly) - fix lkp build errors for isolate_folio_to_list() - drop unnecessary comments and don't grab one more ref for hugetlb Kefeng Wang (5): mm: memory_hotplug: remove head variable in do_migrate_range() mm: memory-failure: add unmap_poisoned_folio() mm: memory_hotplug: check hwpoisoned page firstly in do_migrate_range() mm: migrate: add isolate_folio_to_list() mm: memory_hotplug: unify Huge/LRU/non-LRU movable folio isolation include/linux/migrate.h | 3 ++ mm/internal.h | 8 ++++ mm/memory-failure.c | 91 ++++++++++++++++++----------------------- mm/memory_hotplug.c | 65 ++++++++++++++--------------- mm/migrate.c | 26 ++++++++++++ 5 files changed, 106 insertions(+), 87 deletions(-)