From patchwork Mon Apr 22 16:48:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13637857 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 D29EBC4345F for ; Mon, 22 Apr 2024 07:53:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC9A56B009D; Mon, 22 Apr 2024 03:52:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CE0F46B00A0; Mon, 22 Apr 2024 03:52:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A430F6B009E; Mon, 22 Apr 2024 03:52:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 547066B009C for ; Mon, 22 Apr 2024 03:52:52 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8C2491A0AD7 for ; Mon, 22 Apr 2024 07:52:51 +0000 (UTC) X-FDA: 82036401342.28.83778C2 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf16.hostedemail.com (Postfix) with ESMTP id A7106180009 for ; Mon, 22 Apr 2024 07:52:48 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=none (imf16.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713772369; 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=hxpn8Mrd+KJNjH+UucynyAuAo7UnmAP0GuxvYjOVFqo=; b=wI65qHNsLjVMmEIxrGOVMKAQ4Ok42GgeLK2kN8mWoSo03NfsaeV+9Jdm+3U6yJdiZnM31X b2wm1H4o7vPJCNk/vNe4yGBkJ9vEEqZQkcCGhE98u0FlhuEfyuGU+UsY/5abTs+MBBlWvE T3mJDm4/jpTS+NE+rnUHgrKH0tbBWtQ= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=none; spf=none (imf16.hostedemail.com: domain of shikemeng@huaweicloud.com has no SPF policy when checking 45.249.212.51) smtp.mailfrom=shikemeng@huaweicloud.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713772369; a=rsa-sha256; cv=none; b=Q+dNQHn4+rZayQFdWUdJvoNbLUOiqh5y1w+GTR+iQL/4gc2vtbPKO9OMDLO3prjqi9kfcI MI/UQTPVmjKtSaHGCxVojIhRKrMSGSrRV1CEqCdP4I/7dRgFZcTzy+ekbYrf1t+F46GQYD x0ybQhMpaFjlQnckTNhs/EUZiB3HNJw= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VNHXm004Mz4f3kk6 for ; Mon, 22 Apr 2024 15:52:39 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id C41D51A119E for ; Mon, 22 Apr 2024 15:52:44 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP2 (Coremail) with SMTP id Syh0CgCHqg1JFyZmCViLKw--.3978S6; Mon, 22 Apr 2024 15:52:44 +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 v4 4/4] writeback: rename nr_reclaimable to nr_dirty in balance_dirty_pages Date: Tue, 23 Apr 2024 00:48:08 +0800 Message-Id: <20240422164808.13627-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240422164808.13627-1-shikemeng@huaweicloud.com> References: <20240422164808.13627-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCHqg1JFyZmCViLKw--.3978S6 X-Coremail-Antispam: 1UD129KBjvJXoW7WFyxZr1fGF17CrW8WFWkXrb_yoW8Cr15pF ZrGw1jkr4xtayavrn3CFWq9rZxtw48tF43JryUCw4SvwsrWF1UKFyI9ry0vF1xAa4fJrWa vws0qrykJw1vkrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUmCb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3w A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7 CjxVA2Y2ka0xkIwI1lc7CjxVAaw2AFwI0_Jw0_GFyl42xK82IYc2Ij64vIr41l4I8I3I0E 4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAIw20EY4v20xvaj4 0_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_ Cr1UYxBIdaVFxhVjvjDU0xZFpf9x07jVUDXUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A7106180009 X-Stat-Signature: pped9noe69dckyca73g3go71ywqsapiq X-HE-Tag: 1713772368-794925 X-HE-Meta: U2FsdGVkX1+hlcJQndJPVw6uaf84Z18lI85C0b6wWTFXkD7S934e77iE1ONv60DwXdp5TtfDRGQ+7t/B/9wg7DaI5eFFRdiaI+475u7FgrqAWPramqF9wRr1AfjufgOXvPOhBWtu7oU9QIEEBXIALLwVSQ8DuhVaqOtme7qcJy3oKxU6a/cFWurv46OumZwer17EN33EcLNcjgNnv4WGvGqycTLiVIQImtyxCcunwg1xSkqvRKOHfEqEw+0+ArOQ4SQq/Nw6++z1HoP7l6qhy72oUoDECyus7PB7zft205/HYg8YPtOiYa08jwQ8zPjbaKgxENg2/8zW3ISN6YBD5E0yAtICrLo3hlpjuRVEM1fDMkNEjIbwhWddMimgBinRrmF9I6Wi5yBOdoAfJxrmlakYVQsuB+YjFTGeh4PX31Y0Ng6Iot/O+YAoYZeGohPE1gA2BnAEXhl0ry87wE4+MLUuvN67bgO87npjnuJo4eXRMaHl1Qm/m6WPznbuvbqeiTlG1Y8FYYxCeB1X2UmmNIAC18MhCmF+/zJde8smRj39a+0CibM0Q+EV+0RPH0erLE4KhJ5RNKlx3a6HkbqviWApWoMif2+bZThybgyRyvDRt4Uf9RVCFMVlmgLnibhXUDFFFNxqLwonwsfKamm71E7oFCaD884DrGs4cIIBPZhNoO3vA4lxyJD+QhfGh6gHgfB82YWGsY1NUrIyAKfu9BCguNAeJWEqRXrjYm7I27ULE4FOd96t80Aq4+vQ5lt6xyaW2m3MvxNaEVF/JKnRNi4tiBVPKHiwfEcn8R9kPT91QhNCXtw8IoxC3LBumh49Bp3OhDtBSbrQmRIrKm0DRTcE44cCzpzL5LI+T98M1zsrPj1q+3DbXEMtGWkYU9aErH1fxaQtzvNpnSz7a+zinWL1WF0Zor+gNnjDN4iCXjQhgX/5tZWUnjsSbVDJzdYBwPoNa2PIb8e4I3Wgf/s vCG4chdA hmdu3Ayspxgq9y9v7mLvzGjL06fGEOnGrvFaML1jry8FaT7wXd0uy8CU2mwrARnMgMZ0ncfcMkytkLUFcJNgV2uzrBeJrY47SKIATYrZMLs/ZeqSefhZ+OtQ+QogknFN8SrSU5fxbJjkjjQYXQrmnqtk0ELlezNQ0auXJDOh7eiktkyIPnPTIak4pwM312Vm2iVftFtY/fYUqC9cdg1I82y5EzvJFqkIx4pg298zU3sWIMI+zTBq2jpkXpr2d9f+akYMO2kKcAXhWlSXeSbXP2xUSHMlq78ASma2ydZH2hXDmSyYvJR+xBUxDfxMLeJup/Zyx 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 Acked-by: Tejun Heo --- 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 3bb3bed102ef..44df5c899a33 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);