From patchwork Wed Mar 20 11:02:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13597195 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 4F3E1C54E71 for ; Wed, 20 Mar 2024 02:06:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7F0C6B008C; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B28426B0082; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 897106B008C; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 674B86B007B for ; Tue, 19 Mar 2024 22:06:13 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 22F44A06CA for ; Wed, 20 Mar 2024 02:06:13 +0000 (UTC) X-FDA: 81915777426.30.48694A5 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf27.hostedemail.com (Postfix) with ESMTP id C8CDF40006 for ; Wed, 20 Mar 2024 02:06:10 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 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=1710900371; 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=QQiu7fsWBAZuTo9rcm0fd1EYXKcxjmg3HJPxBPJoMIE=; b=BT276GfDME1r656Y6ycFNq2a5S6YnZPiYXn5T+r1elgJ+59dU7vlv8dExh5IHlRok6LMwx rE1BnsHT+ANj4y65QKox5MuMM0KP2AJQ0503xwpDJBA7OrBUcRZH6VM8/6JRlMgvwofQV2 8hCmRN3wm72Pdh/rvCj/9nskYaduuLQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of shikemeng@huaweicloud.com designates 45.249.212.51 as permitted sender) smtp.mailfrom=shikemeng@huaweicloud.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710900371; a=rsa-sha256; cv=none; b=ht+rp6vl5vYXmRToVlCRbF1zSmVoctPTUd0dD55AWl3ppseT17TmzhwT4SkS4BfeG4JIOj woeyK2BiJaX+HYOGOicETxnXvzZWM1lH7AlpBjwMsREDgOhG9Q/1LDqE7dkc1wIOl8jy9C lQwvakgwh/2ESR9fLC6FFum4k3CBcXg= Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TzsPz1JGGz4f3n6K for ; Wed, 20 Mar 2024 10:05:59 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.252]) by mail.maildlp.com (Postfix) with ESMTP id 1C1071A0172 for ; Wed, 20 Mar 2024 10:06:07 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP3 (Coremail) with SMTP id _Ch0CgAHFZ2KRPplVj2CHQ--.18626S7; Wed, 20 Mar 2024 10:06:06 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, tj@kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, bfoster@redhat.com, jack@suse.cz, dsterba@suse.com, mjguzik@gmail.com, dhowells@redhat.com, peterz@infradead.org Subject: [PATCH 5/6] writeback: rename nr_reclaimable to nr_dirty in balance_dirty_pages Date: Wed, 20 Mar 2024 19:02:21 +0800 Message-Id: <20240320110222.6564-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240320110222.6564-1-shikemeng@huaweicloud.com> References: <20240320110222.6564-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgAHFZ2KRPplVj2CHQ--.18626S7 X-Coremail-Antispam: 1UD129KBjvJXoW7WFyxZr1fGF17CrW8WFWkXrb_yoW8AFykpF Z7Kw4jkr4xtaySvrn3CFWq9rZxtws7tF43JryUCa1SvanrWF1UKFyI9ry0vF1xAa4xJFWa vws8trykJw4vkrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPmb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3w A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7 CjxVA2Y2ka0xkI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ss5UhZLkigTRNvRW5endgWfLe2Hdrv0zVHu42ilUMhSkOpSjecXetlE6sEODbE+I6zYiiCYYonmqPJ1rM1MbGPVaN7sY8fZ3phmzqrkWwr566sFPrzJQYHOLEB2CHqSB6ZqqgGX6WY6P1Eenxc8pIu7Oua5MhHfNcRMhT9vlLZVzTygKkSA1E3ZqAONX6/EaUMDhNtNoqV27F/lWsRGkZEzT57bnN/EFpWO9UvBN/fOILOAHuXhpoMcB/yNCMLdbGLxoorzNflpqHFVY8r7m5I0u5Yr7Ih+r9nHKckY6rKq564iz4sR+B38gu8um8uHem/lJzXa3bK1oLhKs0/dUeU0N4Szv7QpFwdDLMX617ZP2EAMWUesSh2aAfWYawp2VPb4mgQ5i7ZW8S3p6lv1o0rLq0MzgilJQMzabrOZz /lI+uW8W /Z8QtbizaSCVG5bVTu8sbolHirw== 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 ba1b6b5ae5d6..481b6bf34c21 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);