From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linmiaohe@huawei.com>
Subject: [PATCH] mm/writeback: minor clean up for highmem_dirtyable_memory
Date: Thu, 24 Feb 2022 19:54:16 +0800 [thread overview]
Message-ID: <20220224115416.46089-1-linmiaohe@huawei.com> (raw)
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
reply other threads:[~2022-02-24 11:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224115416.46089-1-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox