From patchwork Mon Apr 22 16:05:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13637735 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 796BFC05023 for ; Mon, 22 Apr 2024 07:10:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D36776B009D; Mon, 22 Apr 2024 03:10:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CC1626B00A2; Mon, 22 Apr 2024 03:10:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93DBC6B00A0; Mon, 22 Apr 2024 03:10:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5D3CA6B009D for ; Mon, 22 Apr 2024 03:10:23 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0DCB0140AF6 for ; Mon, 22 Apr 2024 07:10:23 +0000 (UTC) X-FDA: 82036294326.04.B549673 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf27.hostedemail.com (Postfix) with ESMTP id 6CEA640007 for ; Mon, 22 Apr 2024 07:10:20 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713769821; a=rsa-sha256; cv=none; b=aoLnoQIYHwmHHN0VCVmNLjbUJbDTEnQYYUhf2MMiBzHWk5uYVsmsJ4UrUdkf3V4Wshd77M ahpVpImuq6XwU5UCBMoJvcpFpNu2cdkpP+DMMm+72ewyDmxIeWyiAktWBsJTQ7F9HzO3tB DrUDX7nm6lpelKyviryk6Wv2YghVeCU= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.56 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713769821; 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=Z3YxL2BgDSBDJvO5eIKnjaWuRfoH+ejDqyVLxZ4obDs=; b=T5OjW9Jf7VlI4qnM0rmZfosuMPB52FU9675FHOIOZws/v+r1Q1HDlibUzHjrEitm1mZzEi Z+Mac6XMfi6z0iRT4YkV79fpDu/fAK8d6I++ihZPf0euPHilxApjSA55pw0a02l2jZGE22 4a4hwCHGn3nzK9ZGc9bnL52mKrLcBE4= Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VNGbg6pTjz4f3kp9 for ; Mon, 22 Apr 2024 15:10:07 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 61E701A0179 for ; Mon, 22 Apr 2024 15:10:15 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP2 (Coremail) with SMTP id Syh0CgAHdwpTDSZmt5eIKw--.7343S6; Mon, 22 Apr 2024 15:10:15 +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: [ATCH v3 4/4] writeback: rename nr_reclaimable to nr_dirty in balance_dirty_pages Date: Tue, 23 Apr 2024 00:05:39 +0800 Message-Id: <20240422160539.3340-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240422160539.3340-1-shikemeng@huaweicloud.com> References: <20240422160539.3340-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAHdwpTDSZmt5eIKw--.7343S6 X-Coremail-Antispam: 1UD129KBjvJXoW7WFyxZr1fGF17CrW8WFWkXrb_yoW8Cr15pF ZrGw4jkF4Iyayavrn3CFWq9rZxtw4xtF4fJry7Cw4avanrWF1UKFyI9ry0vF1xAa4fJrWa qws0qrykXw4vkrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPmb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3w A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7 CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2Iq xVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r 1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY 6xkF7I0E14v26F4j6r4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aV AFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZE Xa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 6CEA640007 X-Stat-Signature: 89mwta5m5xob3eejs9ox7usaqxztx9zm X-Rspam-User: X-HE-Tag: 1713769820-733975 X-HE-Meta: U2FsdGVkX1+e9Wi5mJ7gP+2WvngBf8jurfGp4l7RhlIoBFqr6Z6Ee+6OUHpi+sfCDbMtcIXvap2FtP+SKr3fBhjOC6Jhx9RYxL0URCIpKSPiflop5MOcce9FakYDOTYvIH9L0kMbujYrk0e3Gt/CtVm3QNd/bgisgLvq8zwMdVWicwl2KzsDZDPl0bnN+U+92627wcOnS1i/RUTQC5Sjt3et0ws0OlGPmSOCoJK0u/kUs3Wy7/64D3xz4LZYq0PV+lp1O3sh7YnPh1V7sVGlMri28pRSL9nt3eoEPI3UETd/4ydlFs8lPldg7RRgyKRpxyKtdlb88F1PuooFR25APx3EmjHGGSoKM7SXRozO26g+saK6Z3IBg3hZm3AE7QoRA6Lwy6f63+086r1DSESh3ipOHZbGYXvlx882KJ5UApdVs0D2RB7IBN6AmYQwhTL3DpUGqbCUV8BNYna9GpUrCs7efct7dU/XgCUQzgwgIdvH5uuw1qGr/KPoZ0M3rVbq9csJ9kuIrVQW94JK4pqRuo2GasWT3Jq65j7I0zWcx6GgcV6dJs5wZ2GYECO0lEthSQnmopl7ShBg0e3esHVAsw3TDxdZHtEst1NzGzSITC5sWiqX5oBAE/oMJ7kMFgVt/Twwi0VPstsHI40xMCE3151Oog0kOMpS59q4bpAmV9dHka9pAtg3fssypmOO4f0DewOaIsC4pWzrFlvOzSz4QDifNvDhjmbEAT5tpOCu0tCNZui7waaqg2S/DCR6O5skvXSDYW8HB8xrrBdEIhMHOt9qbKvrsu/RgWHZEa70c9MFY6UMAwR/f2/RwfpJ9uqlerOz4yhDqY4ICBpNq/EcGkzXAjWg/RjF87iUCgcpEiZNlOCNjbXhE6h0eyV5Btc8wAYaZAvACgLdjhAAliLoaEXk94Wl2slxWNs5fR8bV3HTYhdJcE+D/LCLIA7EixsWDj/MspN9iJH4kX2zMOE IRBuvC1y AUV4Q3i/veGRXPKV7ZobMwO7PPrDyk5ZIbQm+hvGrUfJHsE5/t45iYjOrth9GQ5IsVvFkY+1R6PQhQWixtqxeBMf64Qm++S+2fK4mHpuQZ3dSXMhRY6RB1Gmik/0hvVC26HggLrQVstf+hEYdewyKJFO2J+Wx4dkP/xcPzNOx8YB57DW1Hk6UaV7Vb7eGufwtvU/oNVZE2KqDH6+nh0+i2TSH7Jna3vjEeMoCh29HuoVha6h9NiautdU8Jgi4UEWN31dsEGe2UqaYVUusAZVc4ParVENAGF8peKwo0g0518WkYpA= 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 38f143195bcb..f2c0237be602 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1694,7 +1694,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; @@ -1715,9 +1715,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); @@ -1768,7 +1768,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);