From patchwork Mon Aug 26 04:01:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13777059 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 03D5DC5321D for ; Mon, 26 Aug 2024 04:01:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D3376B0357; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8271D6B035B; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31F606B0357; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0C96D6B0358 for ; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B5968A0B8C for ; Mon, 26 Aug 2024 04:01:41 +0000 (UTC) X-FDA: 82493047602.06.C53C1D2 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf12.hostedemail.com (Postfix) with ESMTP id 3A22C40002 for ; Mon, 26 Aug 2024 04:01:38 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 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=1724644881; 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:in-reply-to:references:references; bh=/pGzX6d2hRvhbIybk4tuU6fjzFGfMT9zmuQtVxF2CsM=; b=aywg4sZ7XT/cuDgk1osxCwZgY/pv/SUjiMjEjYUXmV1DiL9rKzXoTWJjYivj7vijp7RCN4 CY1gCY4rtFTJ0DMdE4X715nomyYo/NTp7hBaaaYSowbfBIZ5qhlAbcDLpQQ3k46XH8HduA U+82BFXuLY+6PBuYYIZS9qltZ7r1Dhg= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724644881; a=rsa-sha256; cv=none; b=5XlA0Tj6AOb2IpRxxJXGikB6coOrmVqJJ/BeTj/Pdu7eY3EZ75D+wRflNr2HWH9lUt8Yyj M7VBNL6B0LwaPvhHj/uGUYUs2tGkgbLIfiToSq5VIdvK24nJFnqYBC2U7k/L3m9GKGcMmm pc9Uc20o/WjMLxjg6D57F6Xn3bfIiqM= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WscLR4TzBz69LG; Mon, 26 Aug 2024 11:56:47 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id E06801800A7; Mon, 26 Aug 2024 12:01:34 +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; Mon, 26 Aug 2024 12:01:34 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , , Kefeng Wang Subject: [PATCH 1/4] mm: migrate: add folio_isolate_movable() Date: Mon, 26 Aug 2024 12:01:29 +0800 Message-ID: <20240826040132.1202297-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> References: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> 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-Rspam-User: X-Stat-Signature: 6gi6waim3oes8u5ik159penh7wogudue X-Rspamd-Queue-Id: 3A22C40002 X-Rspamd-Server: rspam11 X-HE-Tag: 1724644898-916977 X-HE-Meta: U2FsdGVkX198ieW1tt1SC6xo4e1O8IIlbxXODZZ8m+ktMvk5uEDYhfPMDURJeVyDF1Aq8mFn/KVcIh9hOt1TvtfH+MuSpzfAl2fDn7QfBDBnmv+ZATOyKfOYfvDPdsECVwqCIK2yhr32TQpjv+A2VDfrODbkU9TycmqXfrkvYH2ZO7xnurkLbLbIgy27iB6H1E4jaIJyN0kaMaAcYJRhl6aGLn8okDVJ4pngDVL0Sd+Cw0SamuBXxlAU99AeOCJm0F3ov1ViCNR32q+TH8cikSXLXCdvfRPF331fRfsV1/mTMWk5Rqtr23HExtMe/VI75GT0Fu2bxqLMoLFH3RRm1X0prqZZjs0JHPoSEGDABBzl8eH6pciS4GO+jOGcSk3LkS5WkHZGkkj4615FTSSxTepaZ3tCpTxP1Y4FUz7p3hinmOS4BfdlLqpPI8/ahAcU6EFMALr8mNyu20BGoKuOs63hJvzakKRsjaLpxlMyKIx3QPcp0jNmfXeg4HIt9LpnnKja3cXaGrFlrDObxzzaDW/fQMXXwi8yooA3ydMLJVshLqsLcOyt7HMsuFoq2nX5D9LOv0etqdX+ISFkIT4iLtdkTzvPglg0st/1HGExg84oZGL1nM2Gdi707IhmSfRcNVF17xUmK0GNb0zI+uFlMleIza+KUE/p4rpui6ZfLlFMAPC0xeB0UWrMxG01IT2vnsMfRvtLT5Q/QteWDkTUWyoQ0F8aa5JtRjRQVq1ZsmjXQjblaIeWqKw98O9XTvZ+mMjGZ0R+6snIpoYPUU6LFy0Z7Aq9yh9Lf+5MRkQ1oX2R9mVHfWemuAz2Cqec4Wzd4f4x1jLDESksJ+y/tMdudRfsse6wWMmj+/60n8ugePLrNrh+qLsVZF06BMRliqoUArQ4VH0lNsbiLQMyFjOkAQb90tCGuXH5foPnFS6WKtT2R3/TDrhagUSpYxBSCUgBknYW0T/M1S4jLOcJ0PY /ZQ/oS2s AluPqJYI0MgpBt6pwyfAC1u7TsreRYK/fkjvbrfc0lelgmvhwAxN1n+ETkMBmapwU5qhKAAyz9bUi3SITrBjnzbrnXkgBbqjzklURQxKD0rvYQj8aITU+yB+6FZTfbxNktr5mV3wcYFm0FlN5CqzpUDcZW0dscQxUe3eMg2kuPhdakR30ihVK3s2KdSFbCN/IKChm 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: Like isolate_lru_page(), make isolate_movable_page() as a wrapper around folio_isolate_movable(), since isolate_movable_page() always fails on a tail page, return immediately for a tail page in the warpper, and the wrapper will be removed once all callers are converted to folio_isolate_movable(). Signed-off-by: Kefeng Wang --- include/linux/migrate.h | 4 ++++ mm/migrate.c | 41 ++++++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 002e49b2ebd9..0a33f751596c 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -70,6 +70,7 @@ int migrate_pages(struct list_head *l, new_folio_t new, free_folio_t free, unsigned int *ret_succeeded); struct folio *alloc_migration_target(struct folio *src, unsigned long private); bool isolate_movable_page(struct page *page, isolate_mode_t mode); +bool folio_isolate_movable(struct folio *folio, isolate_mode_t mode); bool isolate_folio_to_list(struct folio *folio, struct list_head *list); int migrate_huge_page_move_mapping(struct address_space *mapping, @@ -92,6 +93,9 @@ static inline struct folio *alloc_migration_target(struct folio *src, { return NULL; } static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode) { return false; } +static inline bool folio_isolate_movable(struct folio *folio, + isolate_mode_t mode) + { return false; } static inline bool isolate_folio_to_list(struct folio *folio, struct list_head *list) { return false; } diff --git a/mm/migrate.c b/mm/migrate.c index 4f55f4930fe8..cc1c268c3822 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -58,21 +58,20 @@ #include "internal.h" -bool isolate_movable_page(struct page *page, isolate_mode_t mode) +bool folio_isolate_movable(struct folio *folio, isolate_mode_t mode) { - struct folio *folio = folio_get_nontail_page(page); const struct movable_operations *mops; /* - * Avoid burning cycles with pages that are yet under __free_pages(), + * Avoid burning cycles with folios that are yet under __free_pages(), * or just got freed under us. * - * In case we 'win' a race for a movable page being freed under us and + * In case we 'win' a race for a movable folio being freed under us and * raise its refcount preventing __free_pages() from doing its job - * the put_page() at the end of this block will take care of - * release this page, thus avoiding a nasty leakage. + * the folio_put() at the end of this block will take care of + * release this folio, thus avoiding a nasty leakage. */ - if (!folio) + if (!folio_try_get(folio)) goto out; if (unlikely(folio_test_slab(folio))) @@ -80,9 +79,9 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode) /* Pairs with smp_wmb() in slab freeing, e.g. SLUB's __free_slab() */ smp_rmb(); /* - * Check movable flag before taking the page lock because - * we use non-atomic bitops on newly allocated page flags so - * unconditionally grabbing the lock ruins page's owner side. + * Check movable flag before taking the folio lock because + * we use non-atomic bitops on newly allocated folio flags so + * unconditionally grabbing the lock ruins folio's owner side. */ if (unlikely(!__folio_test_movable(folio))) goto out_putfolio; @@ -92,15 +91,15 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode) goto out_putfolio; /* - * As movable pages are not isolated from LRU lists, concurrent - * compaction threads can race against page migration functions - * as well as race against the releasing a page. + * As movable folios are not isolated from LRU lists, concurrent + * compaction threads can race against folio migration functions + * as well as race against the releasing a folio. * - * In order to avoid having an already isolated movable page + * In order to avoid having an already isolated movable folio * being (wrongly) re-isolated while it is under migration, - * or to avoid attempting to isolate pages being released, - * lets be sure we have the page lock - * before proceeding with the movable page isolation steps. + * or to avoid attempting to isolate folios being released, + * lets be sure we have the folio lock + * before proceeding with the movable folio isolation steps. */ if (unlikely(!folio_trylock(folio))) goto out_putfolio; @@ -129,6 +128,14 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode) return false; } +bool isolate_movable_page(struct page *page, isolate_mode_t mode) +{ + if (PageTail(page)) + return false; + + return folio_isolate_movable((struct folio *)page, mode); +} + static void putback_movable_folio(struct folio *folio) { const struct movable_operations *mops = folio_movable_ops(folio); From patchwork Mon Aug 26 04:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13777060 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 3F1D5C5321E for ; Mon, 26 Aug 2024 04:01:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CCD156B0359; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9647E6B035A; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 603F16B0359; Mon, 26 Aug 2024 00:01: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 33FA86B035B for ; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9B9ED160B2F for ; Mon, 26 Aug 2024 04:01:41 +0000 (UTC) X-FDA: 82493047602.11.FC79C61 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf05.hostedemail.com (Postfix) with ESMTP id A44B710000A for ; Mon, 26 Aug 2024 04:01:38 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 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=1724644805; 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:in-reply-to:references:references; bh=5q8+qACHJBaqY5ESz9bVG/3j80TMZe/EJH+sGR4xddM=; b=Oreymt2l7/qvzfXtwm+1C/ndpJZv2LQSvkN5WtFeUMvB4MsV5yTBVKtUMpNRyczj3V1Z5R sT3JKq+8Kh3zSBe9xJdRRzl0Ye/EONIsl5SObtuSkCiF7kB155U05Se8JhZbmxDyVeseft O4lRJEYNT5KqR75HQ9e+BKJB8dnslmQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724644805; a=rsa-sha256; cv=none; b=ZnHXCXoui8vnGO+C91fwvUHwRA4pc1grCVXgoLU4HWMCDyjwOP+y7KAbY0YZJqd1CHfz3T owSzNehQBxn1h9jXuSe1VCFJq4d/xnRPwb1OLMAByjW57M9LldiIdrKu876tpEz11RXHe2 nqRhYiWpW2qAfDaoiw1QTyhww81xR7M= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WscNB0nJ2z1HHMr; Mon, 26 Aug 2024 11:58:18 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 5BDD014022F; Mon, 26 Aug 2024 12:01: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; Mon, 26 Aug 2024 12:01:34 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , , Kefeng Wang Subject: [PATCH 2/4] mm: compaction: convert to folio_isolate_movable() Date: Mon, 26 Aug 2024 12:01:30 +0800 Message-ID: <20240826040132.1202297-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> References: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> 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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A44B710000A X-Stat-Signature: gmnc1ijg1gj7k7h6re1cnzz3jn7sudor X-Rspam-User: X-HE-Tag: 1724644898-183026 X-HE-Meta: U2FsdGVkX1+Q9XRXD7mJxx6LMM20z5thhRsmlq7hUPJf0X1dLXOj9rSrS+w0tHJE/0uTo5MykS0H4nrj8Bh0jfyosl2Q8apeO6iIrdhEzvlIKU38Yodd70MV4GyZnpg1y2mtwRM+onNXSnJx3B9f4Rs0EGgPfLDBUvKRO8yh6BMb3IGOFAqj+wEpDZHZUWY+TNfK6nJUKDMeHZbNgo8NNW1XKimNl1NwxR153chZoiySHnsEohFBPzFwFMOzbkAb9OTQrPzy7u4ozZiRin1a0Ho8+0TE4bSIzmRK83PADlxxmp4ZlEjjbOjuLkTSjW3K6Bn/59OG9ncPnBvnxG+Mv/pdw2QUB3KwtmALqPYDFGTdqGeoQEnKlh5177OmEzFekc031lX5htSQzenKRmg37l6ORppIJLt7f7eP6ZUn9o78EicGNoAUMlhBbX1j1BlGI05vkxJs/htgfvOCuZ2Ar4lO1p7e/p0gdWuF+JyKlkV7k5kNuUAoMS2ZrtqsYYCq22Dp0SQGh4EVaIyf1+G6XNKb1uVyj9X68IJgLm2OJRUIq/Y+PaMY1CgiEYn5MAWPAn20foQXn9jEq1078IeIOkmieMlgyeH7s0aH2G0uAjSc7noWc8Ury8E8E5fOwJDJRIx8jxiIVLohnT4ROQToi12uNWg6WYpQWWWAep2PVU20IF849oflcudaFMrSYGAo0o41StIRm1TdRg1ijdGGiALsBc0GeTuNHhVTKCfWqPctmSoewVFb1uTjV20UPkVipX84sJckGTIgHqINQob1LEuP3EmuN+l6HmzMGRne1kleW13tV2o6IcpTNda74J8IvkDFrl49hkjCWfrR/L1cmpjbAa/aepMWOoVJAoxQ3zLm4nVD9EdmBlt9JV3ykDgOrlZRZeIsCiB1EwEOeD2J6FzMkfV/ENzpS0wcFSJLhADRrRFNjUpRoHUdH7NYcJXaNYeBfNBytgIBRTgPdSd D2wDjqlG MkdT49EtWJhDnhGFQ3BAMAY2prvZuo5QXnQks01u1dPAhuw9Byss0QN6zKKXlr8oig/HjVzs6Zfk1VNyyk7JRai2b6HCYeEHPcGSXkcs2qPTLTn19qy7SU/dFkCMgFjp//9Zvo55sLUx1+JKR1Vp5WzKH5L/Kx23g4X80hqx7f8nAUxUy4tKkyTelQyPiursryObs 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: The tail page will always fail to isolate for non-lru-movable and LRU page in isolate_migratepages_block(), so move PageTail check ahead, then convert to use folio_isolate_movable() helper and more folios. Signed-off-by: Kefeng Wang --- mm/compaction.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index a2b16b08cbbf..aa2e8bb9fa58 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1074,39 +1074,41 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, } } + if (PageTail(page)) + goto isolate_fail; + + folio = page_folio(page); + /* * Check may be lockless but that's ok as we recheck later. - * It's possible to migrate LRU and non-lru movable pages. - * Skip any other type of page + * It's possible to migrate LRU and non-lru movable folioss. + * Skip any other type of folios. */ - if (!PageLRU(page)) { + if (!folio_test_lru(folio)) { /* - * __PageMovable can return false positive so we need - * to verify it under page_lock. + * __folio_test_movable can return false positive so + * we need to verify it under page_lock. */ - if (unlikely(__PageMovable(page)) && - !PageIsolated(page)) { + if (unlikely(__folio_test_movable(folio)) && + !folio_test_isolated(folio)) { if (locked) { unlock_page_lruvec_irqrestore(locked, flags); locked = NULL; } - if (isolate_movable_page(page, mode)) { - folio = page_folio(page); + if (folio_isolate_movable(folio, mode)) goto isolate_success; - } } goto isolate_fail; } /* - * Be careful not to clear PageLRU until after we're - * sure the page is not being freed elsewhere -- the - * page release code relies on it. + * Be careful not to clear lru flag until after we're + * sure the folio is not being freed elsewhere -- the + * folio release code relies on it. */ - folio = folio_get_nontail_page(page); - if (unlikely(!folio)) + if (unlikely(folio_try_get(folio))) goto isolate_fail; /* From patchwork Mon Aug 26 04:01:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13777058 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 44967C5321D for ; Mon, 26 Aug 2024 04:01:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CD0D6B0356; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 56C736B035D; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25B206B0359; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EDB596B0357 for ; Mon, 26 Aug 2024 00:01:41 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9B659140AE0 for ; Mon, 26 Aug 2024 04:01:41 +0000 (UTC) X-FDA: 82493047602.12.C09AD79 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf28.hostedemail.com (Postfix) with ESMTP id 3CCFFC0004 for ; Mon, 26 Aug 2024 04:01: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.35 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=1724644814; 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:in-reply-to:references:references; bh=xOm3AKuYzLQyL2v8rb7q3aRjBphfv5TPDins0PqxeGc=; b=YUTcRwTBWnOoO1Cq8bprx97J2lvl4vVMTfyKaccl7P5apD/Zx+e4EGQXRhJywl6CdEAXYY V8CN82WYV9aNXzN9yRCB3e4eJogrlE4i4mgr8a8o1HyYm+b4dNpbyrBRAJ6IT1Oh3N9u+W HtF7PXRf3MB9sTDu3LbR9usX/4al6Rc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724644814; a=rsa-sha256; cv=none; b=thMg2bBJrd6iKZ6r+u9XiRdwL7ea5/DAzcnALeXoXehfb/SfT8r4GrunogvLvqZGOoV4ji gK4MbnuM6bArxYjg//CwFN2R++BKfvxj/hGXa5JcRKjeUL4osFmbxL5TcxZrAWaEDb4yPz wcY55MyotwuWiIfeQuWc3awjVE5VlAY= 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.35 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.163.17]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4WscRp5sWHz1S8s9; Mon, 26 Aug 2024 12:01:26 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id C40461A0188; Mon, 26 Aug 2024 12:01: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; Mon, 26 Aug 2024 12:01:35 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , , Kefeng Wang Subject: [PATCH 3/4] mm: migrate: convert to folio_isolate_movable() Date: Mon, 26 Aug 2024 12:01:31 +0800 Message-ID: <20240826040132.1202297-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> References: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> 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: w7ddz5yywxmbtjoef3zqxhxszhsjbj56 X-Rspamd-Queue-Id: 3CCFFC0004 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1724644898-432250 X-HE-Meta: U2FsdGVkX18sxUl+2QBCiqEGGzNIBa/cmLLAfmkuKn5RC1m1yTaE4Maau0cwfOwjrRJMaMYuADgagOcu+3PrQXlq6NKXnlH8EMGM4qKJniEHtMdAlt0LgLCD1d+kQcGXeKM+/23ZMPIVk+DUcIuIM1sWHmiC/dSYc3Pd2OahtaRbIODrY3o31f2DIHWPgs1h5nK/uurBPHS1EE6e77iwhkvTvy9EP08R/Mya5FhB1DimgRYIm0YAYGTRuGJIuvIOpMwNL98wPaHIaGolJS2UmFRDphwk2VPq8EztdyAF9jtkVslXjLhSkWjv9KUpf+VhdHtafIuup8F0xJnWyCQIQstzjFzL4Y7M3cp4Sw0nQuBPGHYmnly8ZZsoPgwn6rr73F+0Q7Oot/g5sJDhqLTv9L8AQb4JK0FaXtWByeKJQGzdj8/FEgcqKZeZ2RIV+x23/sJL4832pprRJHlkRKRujd6IlTc4Rn2ZuT0/0C81zcyWJBRrqK3oxEdv9z4tZfZjvw6mnBH524XLNxpGXgGyTuMLHNDjqCpeZxjFpeQlr7EwuXeyAdWgDkofSRwRHGM2ITEKRBoQH8DWJdFTyAQv1xUoTvBOijslMDteZL4Clcl0gO9P962CKF5ngn2oya68FbXQVTFfv/zhplrVJGUu3raKxHJzBs3qkdwGp9uCq6g5Ly9B3kwAt4dYbxensK8z/nC3dYKH8ihQSxiMymPav90P2uc8zKohl6rMAMCJjq7LAaBq4qtvuNR89V4yGR7Rvy5cHeh6iw6qGSKHR9jNgws38XtGmkCO1kGZoijfukfW19Qi3dwIU8Ltqr4+qwDcYNHrVnFw9zShxUVqmrphHiLZP0+GaCTgrvkYHTS1ctqTAGMIwOnuz7XRnWZrGrf83Cd3w/JKCf1Bkh+wrE0Oc7nUT1MiHBdxzG0siF5W2pjee2U2epaJTpQwNi+LuoqIyI9eei3HZsbOMZTZF+f QEpfJJVK JzevdoIH2w99suzTxNRWV7qTGScf7/IVTFOUnVhYn+KBOz+nyHFGsr5p9RrsDqz3UTL3ElR1sPwXeOU39cBDHKjsoTn/NPVOg84EM/glaTd6siaoLq9Sh8+Dpr57NlqLozOdYd9ulsDwULq8QuoWrgw5fgI61VM1wZZHZ270YiOiOo5JIGYGWfLQhifisF0AxwxF4 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: Directly use folio_isolate_movable() helper in isolate_folio_to_list(). Signed-off-by: Kefeng Wang --- mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index cc1c268c3822..3d8a97b74356 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -198,8 +198,8 @@ bool isolate_folio_to_list(struct folio *folio, struct list_head *list) if (lru) isolated = folio_isolate_lru(folio); else - isolated = isolate_movable_page(&folio->page, - ISOLATE_UNEVICTABLE); + isolated = folio_isolate_movable(folio, + ISOLATE_UNEVICTABLE); if (isolated) { list_add(&folio->lru, list); From patchwork Mon Aug 26 04:01:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13777061 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 64E61C5472C for ; Mon, 26 Aug 2024 04:01:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 236866B0248; Mon, 26 Aug 2024 00:01:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E7A66B024B; Mon, 26 Aug 2024 00:01:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 015736B035D; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D1C316B035B for ; Mon, 26 Aug 2024 00:01:42 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 882F5A0B8D for ; Mon, 26 Aug 2024 04:01:42 +0000 (UTC) X-FDA: 82493047644.27.B7C610A Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf17.hostedemail.com (Postfix) with ESMTP id 645F040009 for ; Mon, 26 Aug 2024 04:01:40 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 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=1724644805; 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:in-reply-to:references:references; bh=Oj8fQq+gzwG1OboExvIULZQoFAqjORnTXZsrLg3ZJBg=; b=4OFUnvlVSrQGIsvCDtjXP9RkieKCslPWila6fN0tLCVr19c/LxBkLw/K16CcOXfaFojnT+ TdfJLWwRXrzbx9iuQvyxoceaXV7np2sgBKo6xqV7PoSwZhgFAIv40cptO9+MrsEc2lMNe+ kCFZzB7CZ/XBWO7iDSEKeikOVsSJ7Ww= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724644805; a=rsa-sha256; cv=none; b=7J2DPzJ63UiJqfFXMWjPqkV2Gb5ZNfkbBJtSzZrHEP58UcaXSAGIeuiRMEmHLVR5G2VSJ3 odCepFjKwb2pvhnl+hsGBt4huRJmr2G5cVtQPIYWK3/fTGto+rpbNP+UnI+3q/+wu4Lavc sU/wvYOtWrET+UnI1Urmmasv1GWuO6Q= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WscNB6zc5z1HHMt; Mon, 26 Aug 2024 11:58:18 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 3B5CF180044; Mon, 26 Aug 2024 12:01:36 +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; Mon, 26 Aug 2024 12:01:35 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , , Kefeng Wang Subject: [PATCH 4/4] mm: migrate: remove isolate_movable_page() Date: Mon, 26 Aug 2024 12:01:32 +0800 Message-ID: <20240826040132.1202297-5-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> References: <20240826040132.1202297-1-wangkefeng.wang@huawei.com> 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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 645F040009 X-Stat-Signature: b41usnwxzpociaqmrxrpf9u1mprp6j63 X-Rspam-User: X-HE-Tag: 1724644900-510835 X-HE-Meta: U2FsdGVkX19PYkVQByoxEm26sKXS9n6Pj8xBVlGfwcVLhseBrg+fZin9uyqoVoPjd59nDPSaFqORjr+S9ifnqZ5Fs2fvCg0lTEx26H0GTzvsK6PYAB0IvaC8C+ZEzv7N8m+rpIDR2DMGJcd6BHGXsQcvf7TgIPcw+B4xtpM5hxNPGivbg1Y/NjswHIA7HnZx+r1MGmeo1iO9Ul6uD39Xz7JuMQS2zQRGn5h+fnnXCZUKHHtSyYZpwkzwjwqqHKWytShfFA1V8tSz0LZZXq/Qnl20FOB3gSPVSBClKBAea0uCagSL7Hp5fFLqY3Lnrq2DToHXTpoB19qTcfVoCoBl56jwwzEA1T7BaSU6YCPoBpL/SJZOWN3jwoa3KsfM1av1jy7oNtaevblaQN7V9ZBe8WTvSxyBgmB+cATf/8sYbsxNYRqufFm/i64LxluFQrFufIW1vKrsiMSflA0ElQIXcnjYjD/ai4U8zZUNlPOyHrzS5o/70w2oYNfmIg1JsX1oHNOjfxEIEkowKSAP32ONwxIGw8GU06I3rSoFFHDwTFhTbXufYYBdM/ldclTymru4IFrCijmd+RLgniRpQT7NWZD6udeXrF+4puJoIIGLbRZFaE5CBIzJOSoTG508Sp9MEtXXjxb8lmsG9chuH2/39UjXa7EAxidDdL0PU5BRQYA1Es9p3x7T2ctTi70o2SBBMt+NyHc61yZtdokiEWNgpUvTjZdWHyPTSgBfSkYZHyIIBG+8Y8Wq9tzhkthktvoVsh7m+6igoiNQNpEueRF/D5HB3wxHPXik3J4f1XwfHki0KaLUptR2nIbR3UCtSCrqp2pY0iFrPKYli5vfwUrC0w9/dt8N1smNe18FxixQNhPcHsmQb7rgIq3mC0b0RxVo+IT2Th3e80E+EWbasC0oM79IJVEZOkZukVv35eSPqjM+awKdp9M96dyacjBjcJfIC+SNJxjafF6yA3+ToGg fD6GMmYk tg7ZmoezY2PbKKVIgwYXEISydCN6S/zrZsqHGeABU+H/cU5Nl4KbLoqIZEXDUo6xoj/uG2Bg75QwsXxoontrvT8Z0wXxk9+XijkYcFDHgIwnqmtNASRBkk+TDwtIzqXOB+O7UDPGweODQ6pUaRQCn00eeanuXIH9fm6Ki9O9edg++YWQIf4njiA//4t0/9FAYPyie 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: There are no more callers of isolate_movable_page(), remove it. Signed-off-by: Kefeng Wang --- include/linux/migrate.h | 3 --- mm/migrate.c | 8 -------- 2 files changed, 11 deletions(-) diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 0a33f751596c..dca6712b8563 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h @@ -69,7 +69,6 @@ int migrate_pages(struct list_head *l, new_folio_t new, free_folio_t free, unsigned long private, enum migrate_mode mode, int reason, unsigned int *ret_succeeded); struct folio *alloc_migration_target(struct folio *src, unsigned long private); -bool isolate_movable_page(struct page *page, isolate_mode_t mode); bool folio_isolate_movable(struct folio *folio, isolate_mode_t mode); bool isolate_folio_to_list(struct folio *folio, struct list_head *list); @@ -91,8 +90,6 @@ static inline int migrate_pages(struct list_head *l, new_folio_t new, static inline struct folio *alloc_migration_target(struct folio *src, unsigned long private) { return NULL; } -static inline bool isolate_movable_page(struct page *page, isolate_mode_t mode) - { return false; } static inline bool folio_isolate_movable(struct folio *folio, isolate_mode_t mode) { return false; } diff --git a/mm/migrate.c b/mm/migrate.c index 3d8a97b74356..5bed761b1be9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -128,14 +128,6 @@ bool folio_isolate_movable(struct folio *folio, isolate_mode_t mode) return false; } -bool isolate_movable_page(struct page *page, isolate_mode_t mode) -{ - if (PageTail(page)) - return false; - - return folio_isolate_movable((struct folio *)page, mode); -} - static void putback_movable_folio(struct folio *folio) { const struct movable_operations *mops = folio_movable_ops(folio);