Skip to contentSkip to conversation

mm-workingsetc-avoid-unnecessary-max_nodes-estimation-in-count_shadow_nodes.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 25, 2021

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/workingset.c: avoid unnecessary max_nodes estimation in count_shadow_nodes()
has been removed from the -mm tree. Its filename was
mm-workingsetc-avoid-unnecessary-max_nodes-estimation-in-count_shadow_nodes.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Miaohe Lin <[email protected]>
Subject: mm/workingset.c: avoid unnecessary max_nodes estimation in count_shadow_nodes()

If list_lru_shrink_count is 0, we always return SHRINK_EMPTY regardless of the value of max_nodes. So we can return early if nodes == 0 to save some cpu cycles of approximating a reasonable limit for the nodes.

---

 mm/workingset.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
mm/workingset.c renamed from mm/workingset.c~mm-workingsetc-avoid-unnecessary-max_nodes-estimation-in-count_shadow_nodes +2 -3
@@ -461,6 +461,8 @@ static unsigned long count_shadow_nodes(
 	unsigned long pages;
 
 	nodes = list_lru_shrink_count(&shadow_nodes, sc);
+	if (!nodes)
+		return SHRINK_EMPTY;
 
 	/*
 	 * Approximate a reasonable limit for the nodes
@@ -503,9 +505,6 @@ static unsigned long count_shadow_nodes(
 
 	max_nodes = pages >> (XA_CHUNK_SHIFT - 3);
 
-	if (!nodes)
-		return SHRINK_EMPTY;
-
 	if (nodes <= max_nodes)
 		return 0;
 	return nodes - max_nodes;

_

Patches currently in -mm which might be from [email protected] are

mm-memory_hotplug-use-helper-function-zone_end_pfn-to-get-end_pfn.patch mm-mlock-stop-counting-mlocked-pages-when-none-vma-is-found.patch mm-rmap-correct-some-obsolete-comments-of-anon_vma.patch mm-rmap-remove-unneeded-semicolon-in-page_not_mapped.patch mm-rmap-fix-obsolete-comment-in-__page_check_anon_rmap.patch mm-rmap-use-page_not_mapped-in-try_to_unmap.patch mm-rmap-correct-obsolete-comment-of-page_get_anon_vma.patch mm-rmap-fix-potential-pte_unmap-on-an-not-mapped-pte.patch mm-zsmallocc-convert-to-use-kmem_cache_zalloc-in-cache_alloc_zspage.patch mm-zsmallocc-use-page_private-to-access-page-private.patch