From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17AF9C433FE for ; Thu, 24 Feb 2022 11:55:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A6108D0001; Thu, 24 Feb 2022 06:55:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 62FD98D0002; Thu, 24 Feb 2022 06:55:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52B918D0001; Thu, 24 Feb 2022 06:55:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 3F9558D0001 for ; Thu, 24 Feb 2022 06:55:08 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0E4AD215CF for ; Thu, 24 Feb 2022 11:55:08 +0000 (UTC) X-FDA: 79177517496.03.A16390D Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf20.hostedemail.com (Postfix) with ESMTP id 0C7BD1C0008 for ; Thu, 24 Feb 2022 11:55:05 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4K4B6s4nlpzbbq4; Thu, 24 Feb 2022 19:50:29 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 24 Feb 2022 19:55:01 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/writeback: minor clean up for highmem_dirtyable_memory Date: Thu, 24 Feb 2022 19:54:16 +0800 Message-ID: <20220224115416.46089-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0C7BD1C0008 X-Stat-Signature: ygnaaw5sq8n56k4sm8kkawq5ruzs91ky X-HE-Tag: 1645703705-425743 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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