Skip to contentSkip to conversation

mm/writeback: minor clean up for highmem_dirtyable_memory

PATCH Applied Miaohe Lin 1 participant 1 message Feb 24, 2022

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 mm/writeback: minor clean up for highmem_dirtyable_memory

Since commit a804552b9a15 ("mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory"), local variable x can not be negative values. And it can not overflow when it is the total number of dirtyable highmem pages. Thus remove the unneeded comment and overflow check.

---
 mm/page-writeback.c | 12 ------------
 1 file changed, 12 deletions(-)
mm/page-writeback.c +0 -12
index 48a8cf770e3f..cdba72aa7fa9 100644
@@ -326,18 +326,6 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
 		}
 	}
 
-	/*
-	 * Unreclaimable memory (kernel memory or anonymous memory
-	 * without swap) can bring down the dirtyable pages below
-	 * the zone's dirty balance reserve and the above calculation
-	 * will underflow.  However we still want to add in nodes
-	 * which are below threshold (negative values) to get a more
-	 * accurate calculation but make sure that the total never
-	 * underflows.
-	 */
-	if ((long)x < 0)
-		x = 0;
-
 	/*
 	 * Make sure that the number of highmem pages is never larger
 	 * than the number of the total dirtyable memory. This can only
Signature · 1 line
2.23.0