From patchwork Tue Mar 22 21:39:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789060 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 1117BC433EF for ; Tue, 22 Mar 2022 21:39:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A229D6B008C; Tue, 22 Mar 2022 17:39:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CFD46B0092; Tue, 22 Mar 2022 17:39:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 849C86B0093; Tue, 22 Mar 2022 17:39:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 6F7996B008C for ; Tue, 22 Mar 2022 17:39:35 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3735E181D75CA for ; Tue, 22 Mar 2022 21:39:35 +0000 (UTC) X-FDA: 79273339110.30.D8E6389 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id C62BB2001F for ; Tue, 22 Mar 2022 21:39:34 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A9980B81D9E; Tue, 22 Mar 2022 21:39:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4678EC340EC; Tue, 22 Mar 2022 21:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985172; bh=6k287UQLQFkel2wGvwxTb471aMwsHRQGu+R6HZZy33U=; h=Date:To:From:In-Reply-To:Subject:From; b=N9r8hMac9Rm9vw8tl1BkW4XBLtrMwjqV+mqGkeRigQQlM6kwNmby0mFzRX9D0jrN4 1ZxvNNGXah6BaLfFRon1rZ+yIi+JwWxd8MpgG7f1MfYfBV8lJSwKRrIOW2FutD3JXr G4U7bK+oIjRL72Jdegh+XBJzIMohqGoHMS21MMqc= Date: Tue, 22 Mar 2022 14:39:31 -0700 To: hannes@cmpxchg.org,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 020/227] mm/writeback: minor clean up for highmem_dirtyable_memory Message-Id: <20220322213932.4678EC340EC@smtp.kernel.org> X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: qzeifxkhb9cqf9giqx1a44f567tswjot Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=N9r8hMac; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Queue-Id: C62BB2001F X-HE-Tag: 1647985174-559919 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: From: Miaohe Lin Subject: 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 --- mm/page-writeback.c | 12 ------------ 1 file changed, 12 deletions(-) --- a/mm/page-writeback.c~mm-writeback-minor-clean-up-for-highmem_dirtyable_memory +++ a/mm/page-writeback.c @@ -324,18 +324,6 @@ static unsigned long highmem_dirtyable_m } /* - * 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 * occur in very strange VM situations but we want to make sure