提交 854d8e36 编写于 作者: M Miaohe Lin 提交者: Linus Torvalds

mm/writeback: minor clean up for highmem_dirtyable_memory

Since commit a804552b ("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.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 eb5279fb
...@@ -323,18 +323,6 @@ static unsigned long highmem_dirtyable_memory(unsigned long total) ...@@ -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 * Make sure that the number of highmem pages is never larger
* than the number of the total dirtyable memory. This can only * than the number of the total dirtyable memory. This can only
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册