From patchwork Wed Mar 27 15:57:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13605693 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 C7DA3CD1283 for ; Wed, 27 Mar 2024 07:02:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 133E76B009B; Wed, 27 Mar 2024 03:01:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7EAF6B009E; Wed, 27 Mar 2024 03:01:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAA986B00A0; Wed, 27 Mar 2024 03:01:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A97456B009F for ; Wed, 27 Mar 2024 03:01:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3F2B1A020E for ; Wed, 27 Mar 2024 07:01:56 +0000 (UTC) X-FDA: 81941924232.09.7D4F8E6 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf27.hostedemail.com (Postfix) with ESMTP id E131A40009 for ; Wed, 27 Mar 2024 07:01:52 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711522914; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=legvJF2aX/KZoe3pO8laGwhxgmeeGaUBDK8cupXPje4=; b=Lirvkhv/BbTBYU9zdCexqd5dzf1MHaug6LQMK0WQIA29MnZUD0nb7Liaqac5otbnR+bxCa O3uhcppAJAm70tZSA1BG7TEtMeojXg0sGvm+/DpjCkq15JLdv13Ti48o6xB1lxFarHCMAr 2ysFiQ2Dz0mvzJg57upHQAqZ6jweQ+g= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711522914; a=rsa-sha256; cv=none; b=e7C1WZXkpVJWReCUxaDU1Z6d3aSf875r9BvYColo/6e+Wir/Jn/w30plcRdNrRpG3Htleq r8A76mNbU9xmyAVYeN6m9BCoey5b4JOwYkoSig4MoIhbXEqNmwiKrMplYEYXUDOD9yprMZ vJpVQL6OMAIsBKqFI4EQCTvwsHUNvLQ= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4V4Hdx1Q2Sz4f3nb6 for ; Wed, 27 Mar 2024 15:01:41 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 4F2941A0232 for ; Wed, 27 Mar 2024 15:01:49 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP2 (Coremail) with SMTP id Syh0CgAnSQxYxANmi6+LIQ--.50310S7; Wed, 27 Mar 2024 15:01:49 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, willy@infradead.org, jack@suse.cz, bfoster@redhat.com, tj@kernel.org Cc: dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 5/6] writeback: rename nr_reclaimable to nr_dirty in balance_dirty_pages Date: Wed, 27 Mar 2024 23:57:50 +0800 Message-Id: <20240327155751.3536-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240327155751.3536-1-shikemeng@huaweicloud.com> References: <20240327155751.3536-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQxYxANmi6+LIQ--.50310S7 X-Coremail-Antispam: 1UD129KBjvJXoW7WFyxZr1fGF17CrW8WFWkXrb_yoW8Cr15pF ZrKw4jkr4xta4avrn3CFWq9rZxtws7tF43JryUCw4avFsrWF1UKFyI9ry0vF1xAayxJrWa qws8trykJw4vkrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPmb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7 CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2Iq xVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r 1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY 6xkF7I0E14v26F4j6r4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aV AFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZE Xa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E131A40009 X-Stat-Signature: 9ia481sm3qk7rwfqr13tyrgh8g616on7 X-Rspam-User: X-HE-Tag: 1711522912-77666 X-HE-Meta: U2FsdGVkX19QF0oNqErePO0V481CZLf3ruT2zRDo4jqMUF1/xWwwrq6KIViRtGxhdgwDuqXwM6V/RVptkCm4sb6IQzo0H5bVAw5YNkEaeeK0II+SQX3JnzisSYBMoT952kG/ymFMYGlL/nXhl80IvapQrxGc8QHjJFvuox8EnYt7kOQcUy+2kVaB8nikKZlooAArOMlaIDiqxiupUMeRkVt5Ct+L/x1LcoQhKYFmrmN9j0KGHPexwVEVuXGn4BifqYyd4EYGmnTQkzGD8/9s5KvSHuyTeCw30iVR4Pc2hZwyfGTpJKt3DoFy54gUP9VwCFr6FBmld1bC/9VLw9dPYO03N6fw0iwUEyFEVwgImWNl2ltQ0JT/ZXHdqf+jMc/mKNUll/xpTVKdC0zugmMVhtTAAnRyo8PCcrqPz4LMyGLtuULm0hR+SrvhNJsHoHic4iSiqZIA/dm6qcYy4bvSVo+1yD+TAzpWapjopJqZFuSA2tsudEQtSlukDWUesg+tL1PKigJ+lpJJlTMdI05CM8oRVPiEtQGW9fzCl0fwm1QdSQ1uvE0TnnH3S0V95NOU7792GQu++osXW3cqRr+v8NTBC0i9kv4tslaPfQ8wH/jB8GNjhrNdeigqQ4tNkVhvH92rXlp3P/83sXKx47jvO6+NmhSd1XuzJfsqq+3ToNb07q7M01nKMzWjIr9ixag5l3arz9Z/abxbqq6DiKKAInSpbzF3YXDVrL6XihC4TGdfKTVe5hDdbWuWmcmjisGcub+SpFbWP6J3IcjhgPXw99koB179hIIueaF88M2t6vwNakiDOja9GtAeV4iML3zUD+7szjJhdoLGzFXpgwqUzeTGhYFAZiP04l+gBK+P0KdXjctliTqH5IJef5xTrhUQ2GthHEyJdmFPM64L6ZAutuRXAUwBwORbono3txXnmgHDbC3AjmFbpMiFFsgZ8vgXNN0Gru5rsrS5rC6C/QP 0ABsSE8k k8/LmDGLkP+4Z752MrrgjxRuGgVLkrUWUvYD+2ZiumgLuoEiCKOJBwhiKcN+dJV0dWC7hgEbFxXPURo93O30ULf0u7s2CkPsnyPU1YA3uUSAAYHKvkoWZvEiU6X5V3jsK+JPjWknB1kvG/rOjgFOCbh1rATTaBtphB8xNkgdtn3JSluJkEVthlaJsEEmbbEgcYkYBmCYXHt0EzSwO9Ry5ehzxYXkfIqoZDliBvXyyxvhHtu/BQsG5VojUHtXSfAgCE24HJsFGiWLXa/1iBvzb+hRpzwlDrhBDfw5DoLk6IcTk6qI= 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: List-Subscribe: List-Unsubscribe: Commit 8d92890bd6b85 ("mm/writeback: discard NR_UNSTABLE_NFS, use NR_WRITEBACK instead") removed NR_UNSTABLE_NFS and nr_reclaimable only contains dirty page now. Rename nr_reclaimable to nr_dirty properly. Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- mm/page-writeback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 3724c7525316..211565d01600 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1695,7 +1695,7 @@ static int balance_dirty_pages(struct bdi_writeback *wb, struct dirty_throttle_control * const mdtc = mdtc_valid(&mdtc_stor) ? &mdtc_stor : NULL; struct dirty_throttle_control *sdtc; - unsigned long nr_reclaimable; /* = file_dirty */ + unsigned long nr_dirty; long period; long pause; long max_pause; @@ -1716,9 +1716,9 @@ static int balance_dirty_pages(struct bdi_writeback *wb, unsigned long m_thresh = 0; unsigned long m_bg_thresh = 0; - nr_reclaimable = global_node_page_state(NR_FILE_DIRTY); + nr_dirty = global_node_page_state(NR_FILE_DIRTY); gdtc->avail = global_dirtyable_memory(); - gdtc->dirty = nr_reclaimable + global_node_page_state(NR_WRITEBACK); + gdtc->dirty = nr_dirty + global_node_page_state(NR_WRITEBACK); domain_dirty_limits(gdtc); @@ -1769,7 +1769,7 @@ static int balance_dirty_pages(struct bdi_writeback *wb, * In normal mode, we start background writeout at the lower * background_thresh, to keep the amount of dirty memory low. */ - if (!laptop_mode && nr_reclaimable > gdtc->bg_thresh && + if (!laptop_mode && nr_dirty > gdtc->bg_thresh && !writeback_in_progress(wb)) wb_start_background_writeback(wb);