All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/writeback: minor clean up for highmem_dirtyable_memory
@ 2022-02-24 11:54 Miaohe Lin
  0 siblings, 0 replies; only message in thread
From: Miaohe Lin @ 2022-02-24 11:54 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe

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.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/page-writeback.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 48a8cf770e3f..cdba72aa7fa9 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -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
-- 
2.23.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-24 11:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 11:54 [PATCH] mm/writeback: minor clean up for highmem_dirtyable_memory Miaohe Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.