From patchwork Thu Aug 29 14:54:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13783355 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 B995CC83F2F for ; Thu, 29 Aug 2024 14:55:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B7E66B0089; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 640466B008A; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E2796B008C; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1EB456B008A for ; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AE782140B8C for ; Thu, 29 Aug 2024 14:55:06 +0000 (UTC) X-FDA: 82505580612.02.67A4A49 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id 1945680010 for ; Thu, 29 Aug 2024 14:55:02 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1724943185; 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=WtBKDhXYu95JY5c7tiHXMhZnGiWWXdEXj9Mq8yW03Pg=; b=YzMlLiA6MgMMvFuEPpzoW0+L3w27AUS4PitusQZs0J270ev4brRHSnscK+7U9caUK0tw3A JRMTCgOPjrMAhd3ChD/jstL5skDF+aDc5fskh5jI4U3E6Rgv+qU0IBabOf0+85akCx7GeU 70RzvpuEb7OCB3RC2CsFfYeIrL07pvo= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1724943185; a=rsa-sha256; cv=none; b=jn34F0eFYP1Hapwx+h7TYGx0tB288t0K/G9u9DbJEcdrCBiostbi2OzrYXkobKrUZAPupg LDwxAztaovMo3gYL2lCM7FwIjdDVLvytYZ5EZSA2sI6Ao8KXTQZgcNz1RjJyU37l/Aalb0 eNfakKzuvmTfvkBZ1ReWOyNl7Vx4MYg= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WvknX6hxVzyQmk; Thu, 29 Aug 2024 22:54:08 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id EBA0E1402CA; Thu, 29 Aug 2024 22:54:58 +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; Thu, 29 Aug 2024 22:54:58 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , Vishal Moola , , Kefeng Wang Subject: [PATCH v2 1/5] mm: compaction: get reference before non LRU movable folio isolation Date: Thu, 29 Aug 2024 22:54:52 +0800 Message-ID: <20240829145456.2591719-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> References: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1945680010 X-Stat-Signature: 4kiwjamqfawape559u58me9mdmxuxhsq X-Rspam-User: X-HE-Tag: 1724943302-311423 X-HE-Meta: U2FsdGVkX18oYOpN0Dr6FUh6vebgzs1YLebSy2zyZ1AdT0/bHeTqlQICA0l5mHd5FXL1BsMuKRoz53xrhwonYVznsGPxnfmNTb+ErAkHgQXcVkKM7NohnjZYJicmPYQz/7NHZUGvQCR3j7ELxK9It36F6TFhTN8UOT9hSAJzexKLYnQZQRMCIt+2BmOaLoLIv8FdfLj8u24iGgI+H/Q+r7vTYmOW9/OmEUM76pbu2CYV14Cj+P9pHiVYIpEa9M/RtNp06U0hUpI7H9/3QuChwaSRcQF6oeacHSIaqINJ5aZ6/wCzxI+uMsZ/6C8zjBrvXydPoozyFkFrKhnAywh51yl67/h2q2FYWS3MIU+ltMYjfq0Oil27BnoiuhDyrpqzMaskaa43/gHViSfthEXsARsM12ji7NAKkpYggFrmBRMvZj7M4m7jOB22PUWKRjrFi5dMEAtLEQct35FO9AwGEp79xecF1CVclPLqoZKaxQC5sHYhzu+ycs3+iE72dT6fcivlEK66C4gxaHGiy2K6COYrqdbZz3gnX2NCYUS6wZwcb4FjplE+czq65NTj0yv8FPNCza4JoJj7A9zIqaH+a1aELASyz7ihgu8lDmbSbbiqRNWHekkskSv2UkZmwgcAlrx46uIe0drDc7C/+DT9dq7xxfrk/sXaUqSWhJSZS4ZG8bwev+UNaGP5ltIIfzDZY+qClIuFXJuJZW/wjrS3+AiMyziPkhAyN6n4/pz1XOwScA6cS+57dMatwFLdPWQLmlx8kA84dI5I/kp/ENAA/xR5cZVNemOYYFEzZgB3bs42R5nKrQmFprtS7/diCSCyBzgt48A/s92hVH9xtQqVwBdHwkkCmYwZA1RSWgZulUpgnQNd/NDq59/NcHS2aYlWdB1TEEgD3De9MwpkZqWagkRsXwgEQCwWItaZUgrpFBskEr0DybDJa7CMJcxAjCJijaaoze+AgvrlqMdSG+n yW8SFa4W cPZffJAN3ucXK+HYfgVnHXQ18LOJKzRDaU2eoN4SFRNU+Mmls6kl7lAli4slfBiII0ecUG2aGxodsjvIYocqI0TqnzvmwNLPzUn85g3qAE8VrmgQRgmG3CRywS25KumcgEYwcSddCRajLmmVTV7z/2tNO297Ln8lOqNadSTdlrFRHwgw985uv5vrEUM3yVS0XzXCk1kHE3D8lWkBNA6fPDUjrVg== 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: Non-LRU movable folio isolation will fail if it can't grab a reference in isolate_movable_page(), so folio_get_nontail_page() could be called ahead to unify the handling of non-LRU movable/LRU folio isolation a bit, this is also prepare to convert isolate_movable_page() to take a folio. Since the reference count of the non-LRU movable folio is increased, a folio_put() is needed whether the folio is isolated or not. Signed-off-by: Kefeng Wang --- mm/compaction.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index a2b16b08cbbf..8998574da065 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1074,41 +1074,41 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, } } + /* + * 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)) + goto isolate_fail; + /* * 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 (isolate_movable_page(&folio->page, mode)) { + folio_put(folio); goto isolate_success; } } - goto isolate_fail; + goto isolate_fail_put; } - /* - * 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. - */ - folio = folio_get_nontail_page(page); - if (unlikely(!folio)) - goto isolate_fail; - /* * Migration will fail if an anonymous page is pinned in memory, * so avoid taking lru_lock and isolating it unnecessarily in an From patchwork Thu Aug 29 14:54:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13783357 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 A42A1C83F2E for ; Thu, 29 Aug 2024 14:55:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 398546B008C; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 339716B0095; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA5E26B0092; Thu, 29 Aug 2024 10:55:07 -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 BB71D6B008C for ; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 584AEA0604 for ; Thu, 29 Aug 2024 14:55:07 +0000 (UTC) X-FDA: 82505580654.03.986DFE6 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf11.hostedemail.com (Postfix) with ESMTP id 96F8540032 for ; Thu, 29 Aug 2024 14:55:04 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 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=1724943260; a=rsa-sha256; cv=none; b=oATA16Jgz+BPnj+InRQ6GuOh9Fyj7EeGj7AJXfzxtzMK6tpTbrWUM7Q+eU5EUAI4JeO16X H+WUbpzr7WCu2ZDrkzX4mL8jcmMNRMRAOwYGUr/ElfmHVTNIF8H/+iLNFjWC31OJiccHsZ iv6TaB/6RaTYLX1LvqVPMiBRM902xpg= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.190 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=1724943260; 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=kG/zxNSDIQVJ/o+eqSwqYHucarxybNVM9KJS4wSrq58=; b=2y7qPwcekNz4D1nnJGDWbotVS8AI/+sKlECa+B2JrQgjn3C/5amf6dZsJLYvs2ldmfuPcv ShDkFXC6XRonbQhc8LizKyhVD2Lyo5mu2azJlrGiPdIJ1RCMO4w0mdU1juiVKa47j1zxaw PoHinv+kB74CKHdPRVW5Ic+SvQP6cOU= Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Wvkhw5X08z20n1n; Thu, 29 Aug 2024 22:50:08 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 6D48F1A016C; Thu, 29 Aug 2024 22:54:59 +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; Thu, 29 Aug 2024 22:54:58 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , Vishal Moola , , Kefeng Wang Subject: [PATCH v2 2/5] mm: migrate: add folio_isolate_movable() Date: Thu, 29 Aug 2024 22:54:53 +0800 Message-ID: <20240829145456.2591719-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> References: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Stat-Signature: gh3wubw9nw7fbo9fbdti97zh3xp6epy6 X-Rspamd-Queue-Id: 96F8540032 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724943304-667529 X-HE-Meta: U2FsdGVkX18yZGb+86q5TrMUOOT47VHiJY3KTrr93XG471wwJiJSMpMudYQVL6N4xkgeWavx3Yl1tkRkxlH0EffdKUkh92mcORNdYwHuO1FtvLd7yOO66W9FKykhdYyVVCCRQ8OFCf4LQfk+Ais8ca71crcYi/4nCSUZVrON4Py6MPRhydk7FVPXvQ4xeDrAqaiYJ0IMhIGa+7qwoCQZdLiB8tbrVfG1mL2DuGmZZnTjSK4Lh9GS3p6zigj20pQ33nZH5ej9+eJMECSqFQj7Mj1PBRwyLhY3tXhsHR2MYMxk42bNPtUMhsCEbBT8+sxmKx3Vo9uRSbMcz+9aqCS/QVZb5qx72eYaaPtr5Nk7lfuRNKgHBy9UWtd5jd8FOMi9VsQW1/7do5CoZiEAPjSld9nRDyqlOwxdV6iVeCIG/J2APhw1aes87rvCpPma7UXOsSTcnDl5CBIUyRW8044b2Cz27YBd8k2OYuBg5p9jvIS3iC7QfbtWWjAa3EvLQgEXwy1wHKha/A0YrBy098YVCN4MVWGaQe4jxzh4kvo8RMQy3riVjhfNSRRFnEBck9YGX5NsegOnPmAUT9gAI+b8s5x4jSgX8Kt+TUN/oTwInkH/puIFvpgEhjQsVWRQpgaBWwjpfp3h2NvumI54Wq5sQOVtMciOKWUE3mx96iRWqLaECeXA40rFmlg72z/bxznVFLCWaER29WoiSbh5IoYYDkAi6bsQcait3H3jh+2hhgXofuoYOCMbKRZb+trJPxp3a+RBkkNGyESBzHFDTrtw5/jrtjFGCMWzdbhHAVFS8D5h07oegCZJS1JlSaQ57eWYnqa3FPTwLE2up0MWDT5JnlbpvumBohs7YuVE8AhXU6l9tsVdDekJFmhT7lCZjEctq8ivTIIIuBhVct8xKUEapDCRyJ1vAQvIzwfKvkCaOwAgMEV9Nyr5mx91k9DEqdxSi41hfjfALIKThycF+bJ OwVxYUpA 3T8/24/gxP/gCmqrSiFHumtUI5DuTHKWpLxfOTErsYY/WZsnITLSTo21OJkBNG987Zs2IJMFtsWGEvKOse1yHtXeEG8fa/2UzJb21rhXrHixNbzZK9I5TYrO0QRYNYjWjA2b1N93F3yymCmRu0HYU7K2SItgycq9VEE5QFr4qzAoF4jUep531xVfzwrURgR0z5/VUjKE91vCMcbhgB0E34Q74I+/hMVdmxNQ0dZ4QEwa90q71pPXOg2/9qreBc4IOsg26Yh11JeEsXWw= 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(). Note all isolate_movable_page() users increased page reference, so replace redundant folio_get_nontail_page() with folio_get() and add a reference count check into folio_isolate_movable(). Signed-off-by: Kefeng Wang --- include/linux/migrate.h | 4 +++ mm/migrate.c | 54 +++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 24 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 6f9c62c746be..704102cc3951 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -58,31 +58,30 @@ #include "internal.h" -bool isolate_movable_page(struct page *page, isolate_mode_t mode) +/** + * folio_isolate_movable() - Try to isolate a non-lru movable folio. + * @folio: Folio to isolate. + * + * Must be called with an elevated refcount on the folio. + * + * Return: true if the folio was isolated, false otherwise + */ +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(), - * or just got freed under us. - * - * In case we 'win' a race for a movable page 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. - */ - if (!folio) - goto out; + VM_BUG_ON_FOLIO(!folio_ref_count(folio), folio); + + folio_get(folio); if (unlikely(folio_test_slab(folio))) goto out_putfolio; /* 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; @@ -125,10 +124,17 @@ bool isolate_movable_page(struct page *page, isolate_mode_t mode) folio_unlock(folio); out_putfolio: folio_put(folio); -out: 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 Thu Aug 29 14:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13783354 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 280C8C83F2E for ; Thu, 29 Aug 2024 14:55:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 223AD6B0088; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AC026B0089; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 073536B008A; Thu, 29 Aug 2024 10:55:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DD7056B0088 for ; Thu, 29 Aug 2024 10:55:06 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8325E140610 for ; Thu, 29 Aug 2024 14:55:06 +0000 (UTC) X-FDA: 82505580612.29.C8CF941 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf22.hostedemail.com (Postfix) with ESMTP id 15E07C0009 for ; Thu, 29 Aug 2024 14:55:02 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 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=1724943259; a=rsa-sha256; cv=none; b=rcn3ViakUVB0vfP+t663obcA7dE0ls7+o3NvUd4FMz1g65e/NzQH3kM8xg/jHkPQBhArQV PFfywZ7BzzUPRZnZTDGPEd7wuDMkZzM3rhS66qTx39Io1jJT7nEtqutbJZACxAMnsDnkfZ 5gNqWG4dIDfUhUEF8yi4tTD9dXGSDW8= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; spf=pass (imf22.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 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=1724943259; 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=vz9mJnQK0yw1Wh++4Xywa+oCuZ/BGx8ZbFEZVWsLnQQ=; b=mLY7BpUz4r85pGJbk1yIPyqkfzSwa/J40zSVAmKaofRHVf6SstkQCg2jAkGmEF2ZwysTle yD7p02TB6gCT1xjt7/bQzfzIUnRBEfcjlBmwYVj8GLJX0CAMmI8JwOvhYvQY/Sj5UNhWio UMt9jl3YbpTpFlmNYwqFrcie3pOvuMA= Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WvknZ17vgz18Mrj; Thu, 29 Aug 2024 22:54:10 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id DBB871401F2; Thu, 29 Aug 2024 22:54:59 +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; Thu, 29 Aug 2024 22:54:59 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , Vishal Moola , , Kefeng Wang Subject: [PATCH v2 3/5] mm: migrate: convert to folio_isolate_movable() Date: Thu, 29 Aug 2024 22:54:54 +0800 Message-ID: <20240829145456.2591719-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> References: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Stat-Signature: pktytwi3maip8ujiwb6f5myqz4381x65 X-Rspamd-Queue-Id: 15E07C0009 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724943302-85268 X-HE-Meta: U2FsdGVkX18n02eofW9eJywbpKE1/RcPgcGkzrf3sx/kAE+cBy/57DNh423Z8vgNuzqITOfPzHYIzcB6enx0iGrSrb8p+VKwoVqHb/SS/uaKb6SQSXbLhSZU/xNKcYAUHu464qdOfhljMA9NQb/t/rIYj9YmwRclb9TvrYnHlq3W1lyFydnj8gpt+WrvwBVvip4yLTLpRj+ZDMTCRHHV8g8hoPvJLz+QkLbEyVI/E90KEdOFgtQV5knsq1xkyEcgfSZgpsnhCeWFKpWCOVjKChjDUQmaJizcVUE5aiGqxQ5BntcoZwzqnX0iBAdTUFMfcmTRlVEUx4idPeqCOW5dhOosTo8C2LDURKpjBY6iR2dqpzR4bSK9864wlJYIkUnL418GR21eMopRuBPwm4gP4S22yxHz48eiDjZ3NFTMdNKnpO0+6/ltyR0v8GOYNaHyWjB6ae4rxff3Mca1rITn+AFC3ZEuKiW4SJVT1Cry/9MqZP3aftD3uim6Z5RxZVP7r0rELY+a/ea9Fpn44xXzSY38KEexkNo7nLjYFHeapHLrE0rPNxARZp81ekxElfj1xW9+FAL6KqnkyZJlIStjSRHxDyCyKFHqn1/T+M7080buxpHSTNbLjEWWbEcLpAQ1Hp3cbMPR8l1CdGnWxvKCFrQIkZcqMhj+lssehzfR2+iTtPIzw7XHtMYU774Igl8Xl06Z06V4DSe4TNBt1g+2VMj3l97XPPUESMPZ98iDstvVp+mOUNX0B9/rWuvGdBlL5gscZHd9LPrNyFFGOU35y84f8W+7qlYWgIDTg2ITbvyRibcmLAE4RbDvKpizwZtDuYTXe/G7Xm4RU6THucWqSgwwB6PDkuGNAYk+IXrB7bHN1udBUQVqaoPDEft6wKVg7DD81nHo2KUMIMLQ9xarwbhpi5vMCSosolauxYwn/taELeSYF/K1IfFKbVrcpLYM8IneMADAnV86l7y0D+c h3Uj+Av/ XZ/PlN4kFWyw8PgsXI/gwsmmXReVegtp1aMhN1SajJS3VpcE6DqpZhmcX/3BZrCdF7cD2/YSprm/S0zSvDIMQV5VT9dJ0nb62zDSbHTvWPFIhX/Ate928TrW9dDhV7BhybYEn7mme35QTDUT9BT6EBfxLLa1SXfYCRX14/RYM4ynG2a00poNBuie2pmPqjVaOXu6VLPPAhE7ykgJEq2GnX1RK0Y48ENdGfHho3Ilp8sRFNRsIKmrhjWBu8NsttizM8zFW 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() in isolate_folio_to_list(). Signed-off-by: Kefeng Wang --- mm/migrate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 704102cc3951..4cac7f749620 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -196,8 +196,7 @@ 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) return false; From patchwork Thu Aug 29 14:54:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13783358 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 739F0C83F32 for ; Thu, 29 Aug 2024 14:55:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88D746B0092; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F0196B0093; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 643CF6B0095; Thu, 29 Aug 2024 10:55:08 -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 400716B0092 for ; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0571C1601F5 for ; Thu, 29 Aug 2024 14:55:08 +0000 (UTC) X-FDA: 82505580696.16.336704F Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf30.hostedemail.com (Postfix) with ESMTP id 5F98B8000F for ; Thu, 29 Aug 2024 14:55:04 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 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=1724943261; 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=hHPkjoGzZrQMtilXtQQnB3IDGAmGGH2FobzMtPUsrJY=; b=dOvDXakboe9UH0on0GTeuPSZPiOAvU/JNWiOcqFKTjv5p3llG5UmMOKuIpw/j8E7VZGbum F2ZAkihfnTOt6IEJv7PEnUeD5aTjR9cdnFjrKnxok/E7JADjBRcxLOy06qLRSr8x6ztHd0 d7NvWmC6F/b6Qmfu8P8Bmh2rVKHrfd4= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.32 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=1724943261; a=rsa-sha256; cv=none; b=B7LcYoOkcNf2KgifLJUNBPrGhV14Tm4GthetokUnD5ZdBWCbwvvQ/XRKGVjaAnhx7CEi6w 16X9/tnC3tLFcOCtYrFb45DMOvV+vMYVQNYp899SAWgDYCYbtccPF8oW+O1o28zpVuMfBS RPKDgK9rp7SjqnncK1WXPM9M5JPdKIQ= Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4WvkmG1LYJz1xwR4; Thu, 29 Aug 2024 22:53:02 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 5C4A4140153; Thu, 29 Aug 2024 22:55:00 +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; Thu, 29 Aug 2024 22:54:59 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , Vishal Moola , , Kefeng Wang Subject: [PATCH v2 4/5] mm: compaction: convert to folio_isolate_movable() Date: Thu, 29 Aug 2024 22:54:55 +0800 Message-ID: <20240829145456.2591719-5-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> References: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 5F98B8000F X-Stat-Signature: ackuswcbia1u6dme7h6fqe9i8dsdfqnb X-HE-Tag: 1724943304-666431 X-HE-Meta: U2FsdGVkX19oowuXVwocoOR/uDm90E1sZOo0rZViuh+mwSG5pLfLHyUuY80EssCGkH013+GQZQ32KYWhwol5qHcIbSaXrHWRngWyPLU76cX/2uDM5/OthEN5Kwc8yPXvhvX9UeBx21Gpf0CwgYTLw3ZYw8X5kBL5gbeF1ZSGi8xDHnh1iADDm02hgjZPy2qukvFVzKO73jitmMFxjwh6f6aJZRbdZYqqBNZOT3Dq9IACcZ6Accnp/uD+10RG/5tjiyYZhQdOvE9eytkmMa2C8YlO5GmwjK1SofrnNjViW98VXutPFY8Mo73Xl9NnPuvuaHcNsQHZ3NQxp4I2imdmTVLOhgnAkbP+ygFJmlKsCLKCiA2TcRMLExDm3BKYEt3/f0kOQFei+DW4/sjNzDz0bviIc6HWzBJL7fobhHhKvVagGsQDp/nbE6kPuAXROmkKuCHMtSzimwoMT4SzdavazxBCI0jnU2V8i8wQlPRpNVmjkSFRmz7O2OtPLriuRRKy9OYHfHd3mqYGhEKqQF+oXrFjfiZVBWxNchX+NWxbJHdZhbkhsy/KC2ZMcqjriHGZV2+0p41lP4IaR+ncbswfgnynuBOJRJX2ErrDrI4EEagYAp7awbCodmw4m+hHm/jno3H2qXAxDFevdLLxJffq6XrRKK25xM1wuO6m36/80scz3DnwJpVlijxFR9Oe0L4wIsGqLt4qvMPwOyM6lRWpCTXO++sZPxUFCpmYq+oD6WgNX921TifrfEtLlGDDLvSRXw5Gfd3c+qRsP8mgPQf+xHOsx3ObTCF5WJ/QsUfzLSYxCKg3mhfcsHeNd+nXiLANHatdQfg1+P4pW1DwJIVQd2imjomuywSa7TSWQSvUzXopjvXYS1Z0aoT/BZx/R7zdpmIHw7F+mFlZSmbJn7sVRqHPogdXgj6LlGR1jlEu6hR44uBFScVTCjxw8vHPSi91cJmDMycFvl/BgANu42a 12kpGDsQ LGoNF/qcz2mzKx29WL/jSaRnwIRfcBn2dqEwdggk21ko5Brb6s5C5UGELX2RHfP69XcqCL29/bqfHeozsvo3uT6ErAXWcqPn/5gJ6Gi4ZvHnvo8isDdedYtZjI1JJndSGluP2QJ3TPA1tBcO3wbbLM7AEsISP7/RNuKIvi2IItKFRY0+whICNVjhzzE/qUdNy/2iI2Th1/OX/AJbveDg61fHmX51b0I06H1dAWcJsSyY89Q3NKtFAkR0PeVXToebu0JwBG+F6WLxMxqhzhRgY7U6T5NYV1GQ7teCJ 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() in isolate_migratepages_block(). Signed-off-by: Kefeng Wang --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index 8998574da065..f2af4493a878 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1100,7 +1100,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, locked = NULL; } - if (isolate_movable_page(&folio->page, mode)) { + if (folio_isolate_movable(folio, mode)) { folio_put(folio); goto isolate_success; } From patchwork Thu Aug 29 14:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13783356 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 2099EC83F2E for ; Thu, 29 Aug 2024 14:55:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EB2B6B008A; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0741D6B008C; Thu, 29 Aug 2024 10:55:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6DF06B0093; Thu, 29 Aug 2024 10:55:07 -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 B1B696B008A for ; Thu, 29 Aug 2024 10:55:07 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5C04B1C5B63 for ; Thu, 29 Aug 2024 14:55:07 +0000 (UTC) X-FDA: 82505580654.28.0D1CD27 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 9F0A040009 for ; Thu, 29 Aug 2024 14:55:04 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724943284; a=rsa-sha256; cv=none; b=WqSJzoKAf3brTIXt59GaDUKpYWwO6LOfpDCiGqbNFa+xl5pEuz13ZDpEGkenCZVD+zbU4X 8WHPMIe3LcblnsTPFmYwd06D5Hg7ow/0h7eyDVjdUGi3ba23I0pJeLlUpzOhqOQddPQuUx N/rtFLQ+UK6KWEHkpeQD5bwx9ZvJhUA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 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=1724943284; 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=Ce+KGWyJt8HJ6N8KXpGEkgKjw2BhgQ/uJpqNKoKnNJQ=; b=rMY6qwRVy61lLb6J3P4HVVIwi0CuJwEsv/MV0SzRlbovr1njJlMCA+/ujNZuTQl2WKSJhz 9dPCI0nW6JU//JmnoCKYF1e06TFbHKMmdTwsRaC8tM/71o+QjW+LHqSMpk5BOMftzid+CL MFg84lycJcCaka/6oaYGZrsMK9GNWxY= Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Wvkm82h0KzLqtG; Thu, 29 Aug 2024 22:52:56 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id D05AB180105; Thu, 29 Aug 2024 22:55:00 +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; Thu, 29 Aug 2024 22:55:00 +0800 From: Kefeng Wang To: Andrew Morton CC: David Hildenbrand , Matthew Wilcox , Baolin Wang , Zi Yan , Vishal Moola , , Kefeng Wang Subject: [PATCH v2 5/5] mm: migrate: remove isolate_movable_page() Date: Thu, 29 Aug 2024 22:54:56 +0800 Message-ID: <20240829145456.2591719-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> References: <20240829145456.2591719-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspam-User: X-Rspamd-Queue-Id: 9F0A040009 X-Rspamd-Server: rspam01 X-Stat-Signature: geakbsi1jdjsfd39mohfimitbqn7ohqy X-HE-Tag: 1724943304-284607 X-HE-Meta: U2FsdGVkX1/H5I2/9QgOdbDXKpCxYgVC0AhBZqNXw71HcDiBkSVgI/9iiBz9HRfvEuAWwDv+KZCvvpMCoPKto8VoTxCDuoGUNble2FADVQG4xCkX3zH7NkEUR+MYxTgegKre7A8aa5o0IZYTLFc1pG1sqVE+Tx09cAgv0Lw//Qiy3EjXxeV1NuLTLa87PifvuhlDYRuxr4B3fl/Brhf6EMiNdDuDjkAFd97pzliZfhEgOT+zjISUbxgRDR4/PmIHJJwogbJsJvWHl2r3TBIHj81T6TTzSYtV9XuCYy+65ESwpKAq2PUemMohT5uyf5rYsztkdezkal9t7YZeHT1MPVyMg4FFxGtSDwVPQQtqeqvN7LAJcTtr2cQqRRKrdrIHUElVBL2cd2QmeRQ/fAe5v0k66zKEI4+zX59PHaKwtE0FusniO2dHUBsZi8JmuiOQKjBf4mFZQ7CrWgRQKyK2xuGy/yFOtsfFedqCYlP1/f+lRQQJ/BR0wbsj7CgY1mq2p138hU4hIEqhbpuKURrU0/WO7LOvZ4iOX51K9/NWoHk5TYwMGXGotgAzMPzePGfvVNF+CNs1C3+RJRLSeOli2astKixT+DOWKHK/PfM4NPv8q6sulJ1HW7kWgq9sG6bXg3ftGORbzAwqsuA1+fmhgA9BLxSXK5iQuBOuB6p3YuVUohUVaPiQGwp06BmSs4h5AkJQN9PsRHvvTGM5Igj1y1lHrE6/y0zy7h7iEX6tGSEaIKcQp3xrBzyJ/MsQY7wBUsK6MyVc5qYjcbU2Hicp2MVN4ZKjGPsMp1zbXKqUJdgpUKDJcHkDA6F6w1naDrrXSVx8HsvI45M87C9PhsBD0WqNLw9SMVLi38LtjjPrM4CHXAnalt5sufJsOsukjc9/+DAAHh4mJb9XP8sHdGlNht5TJGzU6Yi2TTjouVY4wPvMc+T2O2E90Y4HgwnZsV0NMDSJ3p148dWMlveEe8v A1dFoYe3 ZR0wjZCZscWWd1rOj5TwjSSCc4wzNgGcIJSX1lV5FrWaAgMJ5MHHM2w3FtNXKuZhMVkjhiNvcqGw1iKkK6dqK7saH5cHZwnrEJ4E9BREMbtugXLJTATvQWbpupbqB79wh6fWgwYHctVeKh7uwluHWTE8SHLY1eNce5lnZUf2c84tt9cpCjNFZxqXCDzaCFQG1mLmJpguVN1Gl4/DaWXrCV2JH5/CJWIK/O+IbGeSiQ1NAcrNxWkuFMGbLKR5b+RLxeeHm+lI6nmZ7boc= 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 4cac7f749620..a29f3f8f61d0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -127,14 +127,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);