From patchwork Thu Apr 11 06:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13625447 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 92939CD128A for ; Thu, 11 Apr 2024 06:14:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C3B3C6B009F; Thu, 11 Apr 2024 02:14:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BEEC56B00A0; Thu, 11 Apr 2024 02:14:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A64E96B00A1; Thu, 11 Apr 2024 02:14:45 -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 816216B009F for ; Thu, 11 Apr 2024 02:14:45 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0E0F040A33 for ; Thu, 11 Apr 2024 06:14:45 +0000 (UTC) X-FDA: 81996237330.02.E5365C3 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf11.hostedemail.com (Postfix) with ESMTP id B780740009 for ; Thu, 11 Apr 2024 06:14:42 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dDQK7Bqf; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712816083; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zRaE8XB9x3krm/w8wdPb38N4ZFM39swOoK9EEP9rGJE=; b=NO+Y6Shu+bM3Mgf3WGemW46OmWPZvhB07PP6Xpxi9mXLSgzrFjCPuyPIO4oWwP+ma5d4Ht ESU95duX0NVDHRyxJo+QiUJpDiPKKR7xUrD+wfABkkV3XTylzNsVwnY+NTB020+B+ILOBg FHmmQbLbXnZYKqbzhzeVBRL7JekcxXI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dDQK7Bqf; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712816083; a=rsa-sha256; cv=none; b=VnXrPcgV3pHFOP/1wxfnKHPw4wHDx26lUGiwG8iPNbdU5/yZ+2FiRce8faVyu3zXfrUu8w gjKfijaKD2JNwkFkeT8lB6blUGIPc6bL0e3aFl9LVFZYYqBhcDGFGKNVFgNaMInOLnoeA6 63DT8Y6SvWoI4fgCFTxZsRX1nVs3sV4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1678BCE2F01; Thu, 11 Apr 2024 06:14:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59CA9C43142; Thu, 11 Apr 2024 06:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712816079; bh=wwxxrSyMrjaoURhO6OXX+a2E0cDwbJxoGFhUDcJuPic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDQK7BqfFTyKR3n/R+YvyO4I55kJp28xKTt8gOMJzVuB5hAcmSDUzIwLWBVsgvyfX Z6RjymuU0IhJe/n62nYuMNFQ5PMVSYhI5XxpLhIThOrYM4D92pBZP3z58FxKyiU3Qq 1kVWLlrq++6LvXjzYqEIHQEA9vJYF8cfrr5QHj1c1Eiu03aUiYbNOUdA4VGxgbLgXE /TPzMg7BdEdke3czh9Uxlrs/bG+nCAlWaMRO436c7KOe8uKYBOEGgAJECYwXFIdbxH i5gYTYmC76/TLxM5nbCeHVcTdn6lIK53zFtmshPmYl6SjDCvWHl/Ox68b39PndsJyM NAhveKN2mU7yw== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, zik.eidus@ravellosystems.com, willy@infradead.org, aarcange@redhat.com, hughd@google.com, chrisw@sous-sol.org, david@redhat.com Cc: "Alex Shi (tencent)" Subject: [PATCH v5 09/10] mm/ksm: rename get_ksm_page_flags() to ksm_get_folio_flags Date: Thu, 11 Apr 2024 14:17:10 +0800 Message-ID: <20240411061713.1847574-10-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411061713.1847574-1-alexs@kernel.org> References: <20240411061713.1847574-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: B780740009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: wk7qn35dy1nwrpx11yy5zee5gtkusdji X-HE-Tag: 1712816082-288250 X-HE-Meta: U2FsdGVkX1/EhUntZpQ5kMCnHGpBsOeV3TVrZ8eETJXCNRlueovIv1bmTRztQtpaMcqnm2zBh6nHwkfklGEB7Wulb9vktEi9g5c/rBtb3Jl7c+Gzqch98FNiVaVihu3UavXelF9Dn4QQhL74xOSSXxD+voo+g+zsvzDnpJqeB7ByAKz4rwG9fzRo9YeZBFiKma7nLNOBxcWTVP2HYhNQo7Fw1t8A7HMRkeNm74uAHj/OWGWyrUNWZS4q64Rvj8HeDVj9uagKjxKxBH5vaaQYgHXhPFMyfwpXfsVZba5IgfzNzr8PrwL/1eyNiKXSuVg6p4tTwVC6lVoZAGjRvhXZQbsO3IfHxqqoCX6P3aQ8uMzKlScw5MQDK01u0fCroWkxYpIYsGZD3Bt+WIBiFB4PltULpndaQnDxUkg1GulaXucIsAN6lqNCuj3gMb38IYijsoVF1KmiBHtFi2JUJcPExUXKWuFhZtn1pSW8cy9YNxrHUzBgIO9OxCOZRBWEd6SjBUV5HGWqfMyUVsuIqDDhfzl5KeSs6qT3xiGZj6pWBJ2UQ1IziJUdyl0KwGfTg2WxvwGAoghL3X7LRBou8GPTqOTL9wwXDBt14xtmTDD1LHtWuER2Kyx3wgFotA5mZ3pq0XPQkq0shQlfnexOt854N6pGDUzwmsLBcqmY8T0UBvIeIdoRGSXzBIfym773OWhJXPlT8Wi8eVU693FFan4XYRh0QctmdcjBVRZZZQKjjPsP9MEPb0CnlnFns7O05fdHYaYy3G2OjkDT5N/j56tjDohtaBMZdEGeh1+KDCYub1TO5aYuTgRsrUafTUs+jCCEBSGpQktil87pWLi0MQhm708dGbhfbBdRjw2N2L1J4gqZ73AgiP3AwnP6ZoST/uNHN5HDc58H2rS4qMmqTVZJtCXSMD0FIKUVps3P7ztN0W/hk0Lg10AkVQX0vwu/QzmyJpcSN8eiH8nEQZy6PX2 ssAFrVMz 3Cc9uqPn9Wh4el22ugIYZCg9cqAAALg2UC0u7T8s7ccbcHwqYuFepvrUj02MS//6+r4YAYFDq6JGd/JKAJGJZ+4u0vEkgGju+iUlK2ox4FlciLXQz+ih39CB9bJ9FhqrnsTYKfOVAT7YmGYmVT6nV7Brq8s2SKIUvHMr+cYZL70le8lMJk6hARn5mr4fpKcStNmTF5XE6zI/UvtGvp2lC7+9TDeX04JIV7iJytkUX0xbDs70zR86VMnj3Y33jvcfKpx9VMmmKR17rNw7QcrCgcHjL4al+80p2FdY5rBcPsnQcey5uzblPpCSFKw== 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: From: David Hildenbrand As we are removing get_ksm_page_flags(), make the flags match the new function name. Signed-off-by: David Hildenbrand Reviewed-by: Alex Shi --- mm/ksm.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 61a7b5b037a6..662fdaaf3ea3 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -890,10 +890,10 @@ static void remove_node_from_stable_tree(struct ksm_stable_node *stable_node) free_stable_node(stable_node); } -enum get_ksm_page_flags { - GET_KSM_PAGE_NOLOCK, - GET_KSM_PAGE_LOCK, - GET_KSM_PAGE_TRYLOCK +enum ksm_get_folio_flags { + KSM_GET_FOLIO_NOLOCK, + KSM_GET_FOLIO_LOCK, + KSM_GET_FOLIO_TRYLOCK }; /* @@ -916,7 +916,7 @@ enum get_ksm_page_flags { * is on its way to being freed; but it is an anomaly to bear in mind. */ static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node, - enum get_ksm_page_flags flags) + enum ksm_get_folio_flags flags) { struct folio *folio; void *expected_mapping; @@ -959,15 +959,15 @@ static struct folio *ksm_get_folio(struct ksm_stable_node *stable_node, goto stale; } - if (flags == GET_KSM_PAGE_TRYLOCK) { + if (flags == KSM_GET_FOLIO_TRYLOCK) { if (!folio_trylock(folio)) { folio_put(folio); return ERR_PTR(-EBUSY); } - } else if (flags == GET_KSM_PAGE_LOCK) + } else if (flags == KSM_GET_FOLIO_LOCK) folio_lock(folio); - if (flags != GET_KSM_PAGE_NOLOCK) { + if (flags != KSM_GET_FOLIO_NOLOCK) { if (READ_ONCE(folio->mapping) != expected_mapping) { folio_unlock(folio); folio_put(folio); @@ -1001,7 +1001,7 @@ static void remove_rmap_item_from_tree(struct ksm_rmap_item *rmap_item) struct folio *folio; stable_node = rmap_item->head; - folio = ksm_get_folio(stable_node, GET_KSM_PAGE_LOCK); + folio = ksm_get_folio(stable_node, KSM_GET_FOLIO_LOCK); if (!folio) goto out; @@ -1116,7 +1116,7 @@ static int remove_stable_node(struct ksm_stable_node *stable_node) struct folio *folio; int err; - folio = ksm_get_folio(stable_node, GET_KSM_PAGE_LOCK); + folio = ksm_get_folio(stable_node, KSM_GET_FOLIO_LOCK); if (!folio) { /* * ksm_get_folio did remove_node_from_stable_tree itself. @@ -1656,7 +1656,7 @@ static struct folio *stable_node_dup(struct ksm_stable_node **_stable_node_dup, * stable_node parameter itself will be freed from * under us if it returns NULL. */ - folio = ksm_get_folio(dup, GET_KSM_PAGE_NOLOCK); + folio = ksm_get_folio(dup, KSM_GET_FOLIO_NOLOCK); if (!folio) continue; nr += 1; @@ -1779,7 +1779,7 @@ static struct folio *__stable_node_chain(struct ksm_stable_node **_stable_node_d if (!is_stable_node_chain(stable_node)) { if (is_page_sharing_candidate(stable_node)) { *_stable_node_dup = stable_node; - return ksm_get_folio(stable_node, GET_KSM_PAGE_NOLOCK); + return ksm_get_folio(stable_node, KSM_GET_FOLIO_NOLOCK); } /* * _stable_node_dup set to NULL means the stable_node @@ -1887,7 +1887,7 @@ static struct page *stable_tree_search(struct page *page) * fine to continue the walk. */ tree_folio = ksm_get_folio(stable_node_any, - GET_KSM_PAGE_NOLOCK); + KSM_GET_FOLIO_NOLOCK); } VM_BUG_ON(!stable_node_dup ^ !!stable_node_any); if (!tree_folio) { @@ -1948,7 +1948,7 @@ static struct page *stable_tree_search(struct page *page) * than kpage, but that involves more changes. */ tree_folio = ksm_get_folio(stable_node_dup, - GET_KSM_PAGE_TRYLOCK); + KSM_GET_FOLIO_TRYLOCK); if (PTR_ERR(tree_folio) == -EBUSY) return ERR_PTR(-EBUSY); @@ -2120,7 +2120,7 @@ static struct ksm_stable_node *stable_tree_insert(struct folio *kfolio) * fine to continue the walk. */ tree_folio = ksm_get_folio(stable_node_any, - GET_KSM_PAGE_NOLOCK); + KSM_GET_FOLIO_NOLOCK); } VM_BUG_ON(!stable_node_dup ^ !!stable_node_any); if (!tree_folio) { @@ -2611,7 +2611,7 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) list_for_each_entry_safe(stable_node, next, &migrate_nodes, list) { folio = ksm_get_folio(stable_node, - GET_KSM_PAGE_NOLOCK); + KSM_GET_FOLIO_NOLOCK); if (folio) folio_put(folio); cond_resched();