From: Miaohe Lin Date: Tue, 22 Mar 2022 21:39:31 +0000 (-0700) Subject: mm/writeback: minor clean up for highmem_dirtyable_memory X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=854d8e36168d79ad09a831d60bd4d835ad33e188;p=linux.git 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. And it can not overflow when it is the total number of dirtyable highmem pages. Thus remove the unneeded comment and overflow check. Link: https://lkml.kernel.org/r/20220224115416.46089-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 91d163f8d36b2..f13ed76399410 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -323,18 +323,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