From patchwork Mon Aug 21 11:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13359344 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 DD764EE49AC for ; Mon, 21 Aug 2023 11:45:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC2608D000C; Mon, 21 Aug 2023 07:45:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 693748E0003; Mon, 21 Aug 2023 07:45:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46F988E0007; Mon, 21 Aug 2023 07:45:42 -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 031F28E0005 for ; Mon, 21 Aug 2023 07:45:42 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B6A64C0BE5 for ; Mon, 21 Aug 2023 11:45:41 +0000 (UTC) X-FDA: 81147932082.10.DFEE271 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf18.hostedemail.com (Postfix) with ESMTP id 1A7811C0005 for ; Mon, 21 Aug 2023 11:45:37 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf18.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692618339; 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=1CaSVdm81QgGpgTqoONgilt0cFPw4HbaVtv7lQJQ/PY=; b=g/893dEA0XcUnVjahFJepzUnIwIOwY46NKSDhhFF6s5ZsFh06X4D5ziwJwUF4ieCoid/BO 7p1NWMaS0Y+KtADlCQkb+E3Crm/tYAh7a91xaoWNDX9qEZTJqzbZTs5grix3hM+g45uff/ UjcFNE+Ln7s4E3B6O8yt6FHV1UC0Xus= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf18.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692618339; a=rsa-sha256; cv=none; b=tPVjqvjmYOljQ0GECn1sJzYeBCebyXPp/WRlEt4OlJUymM+skX11eNYDFwm6ZTh5uxxe13 jFoy/1G4EEYrjUYxUzL7OfaIPRDkd2U/MqW3JcYSH6JoHwCy5F/K2OQzg6wdhEAsAyYQht GrGqCuem+6Lp1wkNy70GjJ39OSSs/dE= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RTrF20znlzLpSQ; Mon, 21 Aug 2023 19:42:30 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 21 Aug 2023 19:45:32 +0800 From: Kefeng Wang To: Andrew Morton CC: , , , , , Zi Yan , Mike Kravetz , , Kefeng Wang Subject: [PATCH v2 0/8] mm: migrate: more folio conversion and unify Date: Mon, 21 Aug 2023 19:56:16 +0800 Message-ID: <20230821115624.158759-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 1A7811C0005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: iddo5zcu5j5hegr3dp85jd1wmbsg1srp X-HE-Tag: 1692618337-127351 X-HE-Meta: U2FsdGVkX19Yofg1Wp+gYXl+CI0QR5cV4XYdv9YWtW3MFsMufV4ZqZ/QXaI720ir3HpvyGIdloCYGjgHqXD/WmPRMQ3HT6ovVaz0OTYBLTGzxocFrTFsSAxvZ7VTyR0njHznm4/k2rsqs6K6+N3vmUpzB/W8hyxTuo6Z0TdSc7VtYWsRgvq3w/VblWKurxIqBwga3JjKyDY8/pdu597IZHBtzVB7vrqvrPWC68jmoeDZ3f/eeTVfT29IYqHNj0FrSdcElYTXUViNggYoBORyvlLNCI7M00EEWsSAR/UuumCvgr3zHQxqJSuZrhgUJ9Up6zR8DK9tLLrG9DOstbknrJhbPdwSvJWQPIpbQbYFr2Qg7gWqkhWaar14UaNzlQmzPujrUmv4EmUyR29jE0Wb08NPhUU78RegzfbOTbQdiix2joheiMxSBb9HWaR7CzxhAHwL0I/jVU41ZpPfFRiFsucCJtJZs88Xf0iC22j9li0al7JU1F77oj3RdpOqy64RCMYkK/DYHtp76lnIPt00l+StOcLsEUenuK2PQoRK34pap4T9cXEf9a1eJ1GX+ysbN72A/q5gpURbh79igzoz+Dm9SObtEsAYovnoYY0aUGvkaJcZ+DsytMVJ+c2B+t7Z9H/cgImbebXyXYtphOPMsXlAEkSdQAg/x+aY+gCcsB455AAACPjJPfmseo0CTE2WsnRP5v2Ohdy1hs/HW3OyAe7YtaWMT8pqCADY92A8N+9LUmbQRczTrM1BLDbPnyDcgk0J1lmPNgwkdJ2FwPqPBDRMNQ6hyELH8riCEe9O50LcH8n53osXyVyq1tqGzBIclD5Nfe6RXtRDGpvcgOqmQzzU9NjrQDP/4gQv29lyp8tp3BB+mFDxh/2FqeqiNcb283V+BO2c/YOWQuSBuoj8ugl45FmGQthN7+E/NHmutgQY3p6/cEaxDcKj4vmu4NrY8ntqwR99x3rHkadtMj7 vzvqUY4U /JUDzVyu1pqF+C7Z050bpBq6SIH+s58g39UORkyqdRW40fSGN6yNccOvOSSUucvzeCO4Nf+zGclHFyqgWgLCkRXS+hvNi/9VEOV7mq44nFVZXAceokUJ4wS44cA== 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: The patch 1~2 remove unexpected specific assert for PageTransHuge page. The Patch 3~6 convert several more migration functions to use folio. The patch 7 remove PageHead() check to make hugetlb to migrate the entire hugetlb page instead of -EACCES errno return when passed the address of a tail page. The patch 8 cleanup to unify and simplify code a bit in add_page_for_migration() v2: Thanks for all comments and advise from Matthew, Hugh, Zi, Mike, Huang. - keep page_mapcount() check and remove specific assert for PageTransHuge page. - separate patch7 to migrate the entire hugetlb page if a tail page passed, which unified the behavior between HUGETLB and THP when move_page(). Kefeng Wang (8): mm: migrate: remove PageTransHuge check in numamigrate_isolate_page() mm: migrate: remove THP mapcount check in numamigrate_isolate_page() mm: migrate: convert numamigrate_isolate_page() to numamigrate_isolate_folio() mm: migrate: use a folio in migrate_misplaced_page() mm: migrate: use __folio_test_movable() mm: migrate: use a folio in add_page_for_migration() mm: migrate: remove PageHead() check for HugeTLB in add_page_for_migration() mm: migrate: remove isolated variable in add_page_for_migration() mm/migrate.c | 110 +++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 61 deletions(-)