From patchwork Tue Jan 23 18:33:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13527202 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 BE7A4C47258 for ; Tue, 23 Jan 2024 10:36:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B2C86B0080; Tue, 23 Jan 2024 05:36:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 314D06B0095; Tue, 23 Jan 2024 05:36:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5DDC6B0092; Tue, 23 Jan 2024 05:36:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C232B6B008A for ; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 86B0D1407E6 for ; Tue, 23 Jan 2024 10:36:02 +0000 (UTC) X-FDA: 81710220564.07.28C7726 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf25.hostedemail.com (Postfix) with ESMTP id 89D1CA000B for ; Tue, 23 Jan 2024 10:35:56 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf25.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=1706006160; a=rsa-sha256; cv=none; b=G+WYUqB0UEVk8eGh8212uD5r4geiBQkAaJ35/Ad+mCzwdmaZfrSz5Df+ghGfU7u5Kb9FG2 Su9xKkh89ZEeqBcsPl28P9Ty+7zcLQ01rr4zHdZjLSdDeTT4+KS7XCjqsOXGsCPMR+guNB 0Jr/zbuDV6cNQd+9QhfVZo3m18E51Ng= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf25.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=1706006160; 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=OAaqomji99g2cRoUEAO6uaDJ6TGdmIFEqLlbI9qqcjA=; b=amyXSf0PJh3CDU9xNNXiRpTV4c/YQi+SoE4PJ1Ouk44Jz3txEWnJnKAwdS9ynFs91OzH8s v1TmSGj8BIXgYn6VpPHY0yzdtR1XdpQ7OshXZScGVRT8eUIUia/Lu+J6UVzvX+apy5AnsL EUr1jwrqsZXCcbIOnlhLMKDmGDDRv5Q= Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TK3QT11hJz4f3lW1 for ; Tue, 23 Jan 2024 18:35:45 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 6B30D1A0172 for ; Tue, 23 Jan 2024 18:35:51 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgA3Bg+Flq9ly6DjBg--.30161S3; Tue, 23 Jan 2024 18:35:51 +0800 (CST) From: Kemeng Shi To: willy@infradead.org, akpm@linux-foundation.org Cc: tj@kernel.org, hcochran@kernelspring.com, mszeredi@redhat.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] mm: enable __wb_calc_thresh to calculate dirty background threshold Date: Wed, 24 Jan 2024 02:33:28 +0800 Message-Id: <20240123183332.876854-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240123183332.876854-1-shikemeng@huaweicloud.com> References: <20240123183332.876854-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgA3Bg+Flq9ly6DjBg--.30161S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZw4rZrWfJr45Gw1rWrWkCrg_yoWrGF47pF W3Xw17CF4UJrZ7ZrsxAFyruFWavws7JFW2q3s7Jw15tw1akryUKr12kF4vyFy5AF93JFy3 AFWYqr97XF1qyrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUsWrWDUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 89D1CA000B X-Stat-Signature: a7g1wb6d4xke9mhz6qe7pfsisbxskbjn X-Rspam-User: X-HE-Tag: 1706006156-516708 X-HE-Meta: U2FsdGVkX199yrWuBx0FkI5tx+9GdAefE8BU9IP7gW8TNxQzpVZY1favVv6Xb+QqNKE0il4m48MQP8/a4F7+sRWDN01tNTedOVG3OaovjjBfmBFcECgIuXk4zuVyDW5W4EJapy9zT98LVz0/H2FG3HHDhB7RGaNxE8zpqRK7PGnH7NFLvr3fsW9tcftnNorFXzQrnUmgQpt5tBl+T7sA2bnojhLYFC3yRuTIun2gr5yxI/0DC1HVItuCaAdIDP70irZ+YfuUTTwsPQ7+McR3MTM3sPETHlCCQb/kdQ3eHPgNTj9ZmBxDVTZrjgRevqIaHNshYXWQnGFjYxAZjXy7R18Tg0+82blOX6oujElg5rEPUol3447vv9SnkhqHN9Lx5AMyObxZGGlhM0odlbBvgYZx9s83uZxlz6LTdBahsw3IkxSux+cETlceA+41aoa3wRfyW9DsvXzxCyFSlh4ZaJfNwt/fwbWrV2cQPJzJtZmpJnGvd5chxQcPLOmndTeMIpC5Se3XriNWN+cm4enDvrCstHTXCTnT0gCBNHNCUtusr7rctnsB+n9aopLIb0vz47SlxMs8KOWIwqOYlMW2JauPToL/4Yy95Qk3ozHLIDO+E8UHFlDOoPQ3P2HxVsXfQd3ikta+4lwngUfv0ZWwPYfTI0ml74qCKYUI7LagbffvJRpRiLNCLGkhaw7DCe8VbazIzB4WQdYLHaO7FdCOE7WzhllFjnueXNkgffpvEgK4C1S2K/M+7te+qFT3hr/zO4/ZHGweR0XcUCMSzErexuiO25HEPWrCd8nuMJjk4+4Y6s7trQCGeCxA+SaDDQ68zT8Djxdbk8u2F8/P4Sts/hteAxIcYX5knRxjCBkqAdSQt7GZ9OUF0xrGklUerCnFtqNGampuZZJD1szpNwBEl3nLRM/DlI/laD7liRV7Ilb9vxNKxhzSgUEwZPySKT0bc+JzjE6wy5jRdgelRAe 9XpsD1K+ XguYDKm/wCFgDwI04D99Snq6m/+NoU7pVrBxRoDDem2LApJOsQ8vtrhWJUbzFFFinG9ImXVczxIlZEiuEXWkp4xoKD3/VhIcOayinT+6cbOLpqUng4SpbYR9FjRYGUw1xdSuFbLEEppaOUH9WwbcHanjC0cKdUkbXKYVUWrVA4IqvUjaBTqrQiBh06gASTVMPNwuecG0h+RGqkYz+ez9SCbtM0CIv7QlcRo8uLxHOYqKoxu3Z6DXqbck5s4ghH5UgGxUFUZ4yHM00Bh5qlI6Vc8pRnICwfCu85RsRtA8xrbYo2r4= 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: Originally, __wb_calc_thresh always calculate wb's share of dirty throttling threshold. By getting thresh of wb_domain from caller, __wb_calc_thresh could be used for both dirty throttling and dirty background threshold. This is a preparation to correct threshold calculation of wb in cgroup. Signed-off-by: Kemeng Shi --- mm/page-writeback.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index cd4e4ae77c40..9268859722c4 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -838,13 +838,15 @@ static void mdtc_calc_avail(struct dirty_throttle_control *mdtc, } /** - * __wb_calc_thresh - @wb's share of dirty throttling threshold + * __wb_calc_thresh - @wb's share of dirty threshold * @dtc: dirty_throttle_context of interest + * @thresh: dirty throttling or dirty background threshold of wb_domain in @dtc * - * Note that balance_dirty_pages() will only seriously take it as a hard limit - * when sleeping max_pause per page is not enough to keep the dirty pages under - * control. For example, when the device is completely stalled due to some error - * conditions, or when there are 1000 dd tasks writing to a slow 10MB/s USB key. + * Note that balance_dirty_pages() will only seriously take dirty throttling + * threshold as a hard limit when sleeping max_pause per page is not enough + * to keep the dirty pages under control. For example, when the device is + * completely stalled due to some error conditions, or when there are 1000 + * dd tasks writing to a slow 10MB/s USB key. * In the other normal situations, it acts more gently by throttling the tasks * more (rather than completely block them) when the wb dirty pages go high. * @@ -855,19 +857,20 @@ static void mdtc_calc_avail(struct dirty_throttle_control *mdtc, * The wb's share of dirty limit will be adapting to its throughput and * bounded by the bdi->min_ratio and/or bdi->max_ratio parameters, if set. * - * Return: @wb's dirty limit in pages. The term "dirty" in the context of - * dirty balancing includes all PG_dirty and PG_writeback pages. + * Return: @wb's dirty limit in pages. For dirty throttling limit, the term + * "dirty" in the context of dirty balancing includes all PG_dirty and + * PG_writeback pages. */ -static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) +static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc, + unsigned long thresh) { struct wb_domain *dom = dtc_dom(dtc); - unsigned long thresh = dtc->thresh; u64 wb_thresh; unsigned long numerator, denominator; unsigned long wb_min_ratio, wb_max_ratio; /* - * Calculate this BDI's share of the thresh ratio. + * Calculate this wb's share of the thresh ratio. */ fprop_fraction_percpu(&dom->completions, dtc->wb_completions, &numerator, &denominator); @@ -887,9 +890,9 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh) { - struct dirty_throttle_control gdtc = { GDTC_INIT(wb), - .thresh = thresh }; - return __wb_calc_thresh(&gdtc); + struct dirty_throttle_control gdtc = { GDTC_INIT(wb) }; + + return __wb_calc_thresh(&gdtc, thresh); } /* @@ -1636,7 +1639,7 @@ static inline void wb_dirty_limits(struct dirty_throttle_control *dtc) * wb_position_ratio() will let the dirtier task progress * at some rate <= (write_bw / 2) for bringing down wb_dirty. */ - dtc->wb_thresh = __wb_calc_thresh(dtc); + dtc->wb_thresh = __wb_calc_thresh(dtc, dtc->thresh); dtc->wb_bg_thresh = dtc->thresh ? div_u64((u64)dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; From patchwork Tue Jan 23 18:33:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13527201 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 7EAEAC47DDC for ; Tue, 23 Jan 2024 10:36:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 195E96B0081; Tue, 23 Jan 2024 05:36:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 13C756B0083; Tue, 23 Jan 2024 05:36:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE61C6B0093; Tue, 23 Jan 2024 05:36:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C166E6B0089 for ; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 88114C0A32 for ; Tue, 23 Jan 2024 10:36:02 +0000 (UTC) X-FDA: 81710220564.07.18CE332 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf20.hostedemail.com (Postfix) with ESMTP id CE94E1C001B for ; Tue, 23 Jan 2024 10:35:56 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf20.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=1706006160; 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=STqcwsIa7V5zMfywJaxQON49pm/FNYF+nf7cFtmGVYw=; b=MF6fgt55DS09iVMlCLSVqA2UkCoGZQN0QKeBD1GtBPXujrneVLaL1g8dfM0t0i0FmhH8Az oA7kkP670oKm8p8GX07j+HuEpaAw8j4bTAZeYLO1mmSzSfCpDSve3PP+BqFK1lDcE4vHdB 8nuSzr6y/GaJnsyqVMgzLDD5EpCaH0g= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf20.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=1706006160; a=rsa-sha256; cv=none; b=Ks96tZYwEqhqbAPhPgUXA15AM3GAn6FvTaJJXnbMMloH/AqMsNWZ+3nuthhIjPMSefedQZ uZR5tYyFQUv7dfElpKXNo+TbMDvt0cQQk0om2vNz0k68SWax5tJQWYFmTNm7+b9Bw8b5OX cV72Xoq2YkunLKSws+0zoEu1ZTrFT0Y= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TK3QT42J8z4f3lgG for ; Tue, 23 Jan 2024 18:35:45 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id D1B9E1A0272 for ; Tue, 23 Jan 2024 18:35:51 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgA3Bg+Flq9ly6DjBg--.30161S4; Tue, 23 Jan 2024 18:35:51 +0800 (CST) From: Kemeng Shi To: willy@infradead.org, akpm@linux-foundation.org Cc: tj@kernel.org, hcochran@kernelspring.com, mszeredi@redhat.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] mm: correct calculation of cgroup wb's bg_thresh in wb_over_bg_thresh Date: Wed, 24 Jan 2024 02:33:29 +0800 Message-Id: <20240123183332.876854-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240123183332.876854-1-shikemeng@huaweicloud.com> References: <20240123183332.876854-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgA3Bg+Flq9ly6DjBg--.30161S4 X-Coremail-Antispam: 1UD129KBjvdXoW7JF45ZFy8tFWUKF1xZr1UJrb_yoWfZwb_uw 18tr47GrW7J3WDGay8uas3Jr1jk3yDuF1rCa1rKFy7tay0vr1DZF18Cw4kZr9Fva4j9rZI 934SqrW5XwsrKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r15M28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jguciUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspamd-Queue-Id: CE94E1C001B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: y9taf9j4err3hbbzhcmojsyzpnuscwyx X-HE-Tag: 1706006156-551715 X-HE-Meta: U2FsdGVkX18/0YrPIi4JaR+3sGdAf+sKF1FHeP24ErudBbgTgtKZu6MyrW8tvIYFimmgxSirwpXiBfkwJZjLvpTWN38H/cXITMY0yb0ff3E24Glrt23kqvWpDCLAG/VGAim1XZ8U3veIZlCHMi0BwgRztnZcur4qY/geiuIoGZw/n77h5uTVkydFtqPoAhlO2EaJMsoBtIHD/okHDHRZSrwT0N4I0phFdAgeczMUUOCCrcOOGcujD2zevZmeESgm+V5AvnJnMFiSLf7noF6kP/Dd7LWzw6ZbTJwNZjLMTlH9FVhytKUpySjBnYO7Tj+Xt2ol0edGARjfkwZwl5j0Hox6YW7dQ0WAkK7OWrYLPyH4zS+0mHN1sW+aZGCoreXkMS0rE2mGzO06bPz/Wy70TeJEFG4lLgkoC54QTT8Zv/ZUrxG2uCWS5CdmAyj/qXHWSsDyELJCDCJ3qBfZbUFcyCvp9vkhIzJnDmzZieMhAFdyoc8jMnCsSG+7FUgSSocGRTJxGz2FZMUS8g7Y9aB03cBZf6iGUsQMrdcxcpm3tVtN7lWUvSk7DWH+o374ChOn2tOdlEikpEmPjIft68oIsArTg3g1ByUVUpVxZlHi7L+D7hm5+PhXXdKoV8ocmTxPOPdoJ4lt8JFMuyWQTIQAMjqIO8fT8r9JLqFr8o7EsQ7yXJjZ+HMDO3TOq5jHv6The2wTWwImvdTTSR0oJYNHY3zkSgcyQmKrEJul1W/Oqa/F1pn+vxp6Dy/qIijUqlneFCTGHBVn2UiXWOciq34ubvWznMTuzTX00Q+/MpU7oTJ6J2WtLtz4Jf7+98LlmnTK23TTILR7Ece98f3K/ZkJMaa7l8grCFCkhsbXlomc2w12s12tB0Q5a/MT7O0J8ejjUgO56IH75u7OonERl4Zn6BDFqC52t1OlJIL8nTKyPNcu01zBfW6HJ5vMryMdYPNNfkbcFxzUlOrG/nEz0SM orRJoDI0 X0sRK3UnXquHELiNi3XqQL0vvf+i5QPKPDhL1STYN2NHtYK2dzphfOKLnFostOt7RR8Fseo+tjAHZ5UJtEch47PpQ7mF2hC7bePiwfpPWphLpSnlTIM5TXc2XWAmkIn7uGyZtZBbJITz8HJqACgzyulb3oA+3x5u69LPEkDb4ABEVeO5lzCk6LlVTo4cLVb3biNPEixNetjNPaXqeV/o+xh4t6fO1DrPzFVZy1sn8z7p9zYUHnJyeoFOuPk1BXIvhG1WAKQg9u5fpLmTibnFRkk3RqMsUnpfEqjSAQX33qNV9Bq0= 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: The wb_calc_thresh will calculate wb's share in global wb domain. We need to wb's share in mem_cgroup_wb_domain for mdtc. Call __wb_calc_thresh instead of wb_calc_thresh to fix this. Fixes: 74d369443325 ("writeback: Fix performance regression in wb_over_bg_thresh()") Signed-off-by: Kemeng Shi --- mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 9268859722c4..f6c7f3b0f495 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2118,7 +2118,7 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) if (mdtc->dirty > mdtc->bg_thresh) return true; - thresh = wb_calc_thresh(mdtc->wb, mdtc->bg_thresh); + thresh = __wb_calc_thresh(mdtc, mdtc->bg_thresh); if (thresh < 2 * wb_stat_error()) reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE); else From patchwork Tue Jan 23 18:33:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13527200 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 95AAEC47258 for ; Tue, 23 Jan 2024 10:36:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5DA26B0089; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E34ED6B0081; Tue, 23 Jan 2024 05:36:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC3736B0083; Tue, 23 Jan 2024 05:36:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id ABD146B0080 for ; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7B6541407D1 for ; Tue, 23 Jan 2024 10:36:02 +0000 (UTC) X-FDA: 81710220564.06.CCA4C3A Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by imf18.hostedemail.com (Postfix) with ESMTP id ED2611C0013 for ; Tue, 23 Jan 2024 10:35:56 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.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=1706006160; 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=cEG0RoDb3wTJRvQKXPlpyVHF9bSRT5RhaXKzQzxW8Ck=; b=kOIBdkadl34p1L+un8pDXaNHHlBsnj/2+tt9ik/fRIAojTzTXuSUDojw/T+UwUPKAuUj7S CvRRKEwLv0NVFf6Sa0ECEZ4Vwu9jRUIe0sScsD2koKItJXlSQt8+KoLyy57r3pviu4ugED fBkwSq+3EXyCH95/alj9yEC4VrO4zws= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.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=1706006160; a=rsa-sha256; cv=none; b=ggI8mzPWais/pTa6LqUFkHukMhMpFGevyTe39caZUSp0hQroBUv8tvyqJo9QGHbSHg6A64 pJasnC1kpDbpPbqjPHc77dqCmnw//ec2U8/u22f3q8psTX1ssg7TNCkFdhvCfYQ6fwLRZ5 efEXqmuFTzkQapnR2kSWDQtPbGy+9qM= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TK3QY6d6Sz4f3k6Y for ; Tue, 23 Jan 2024 18:35:49 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 43BF01A038B for ; Tue, 23 Jan 2024 18:35:52 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgA3Bg+Flq9ly6DjBg--.30161S5; Tue, 23 Jan 2024 18:35:52 +0800 (CST) From: Kemeng Shi To: willy@infradead.org, akpm@linux-foundation.org Cc: tj@kernel.org, hcochran@kernelspring.com, mszeredi@redhat.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] mm: call __wb_calc_thresh instead of wb_calc_thresh in wb_over_bg_thresh Date: Wed, 24 Jan 2024 02:33:30 +0800 Message-Id: <20240123183332.876854-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240123183332.876854-1-shikemeng@huaweicloud.com> References: <20240123183332.876854-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgA3Bg+Flq9ly6DjBg--.30161S5 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4fGFykGFy7WFyfKryxuFg_yoW3JrXEg3 W8trnrGrW3JFyUGa4xCas3Gr1jkrWkuF1rZa1rGFy7JFy0vrykXFy0kw4kZr9FvFyj93sI krySqr4YqanrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfxYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r1rM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07js0edUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: ED2611C0013 X-Stat-Signature: ybud7eox5zo4kfbgdwrfuyuiqfzbkrpc X-HE-Tag: 1706006156-417811 X-HE-Meta: U2FsdGVkX1+FV3Qsn7XZwOOo/4PF0Ynq8zYB1ZfZRoNNBkjzuqtQME1J0H84ROFk/23COYxMiLpmd8Uyn06qal2pkuSp1+7IkJ6qvBOKdXAnBwPkynCnX8aRnmk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GuOixCoDg7HMl+0Iw86reEQV86AW16iEpFnbQLYvdqhbJTmvu4vJ+F3yIONJh0D+3tS7uPNmBCUhoJ17MHv+xeQ= 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: Call __wb_calc_thresh directly to remove unnecessary wrap of wb_calc_thresh. Signed-off-by: Kemeng Shi --- mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index f6c7f3b0f495..5c19ebffe5be 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2098,7 +2098,7 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) if (gdtc->dirty > gdtc->bg_thresh) return true; - thresh = wb_calc_thresh(gdtc->wb, gdtc->bg_thresh); + thresh = __wb_calc_thresh(gdtc, gdtc->bg_thresh); if (thresh < 2 * wb_stat_error()) reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE); else From patchwork Tue Jan 23 18:33:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13527203 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 A472BC47DDC for ; Tue, 23 Jan 2024 10:36:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77FA76B0087; Tue, 23 Jan 2024 05:36:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 584886B0092; Tue, 23 Jan 2024 05:36:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3606A6B0085; Tue, 23 Jan 2024 05:36:03 -0500 (EST) 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 C008A6B0085 for ; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7FB5EC09D6 for ; Tue, 23 Jan 2024 10:36:02 +0000 (UTC) X-FDA: 81710220564.05.F4499C3 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf10.hostedemail.com (Postfix) with ESMTP id 05A6EC000A for ; Tue, 23 Jan 2024 10:35:56 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.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=1706006160; a=rsa-sha256; cv=none; b=RvxMQH2eEuf/tEI9hs9puKix4zGnM5DQLxyXOSyffPDRQtr36dHIoP1Us7Feqdtwr5brZD V6B6+JuVGn8calJuJpna6qIRgV6JbCY4nkMaKIXcae6iA9rS7feHMZgGzymgMyB1Gu7FWy rex95f5810vGQhJEThlT7DvKaHmtjG8= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.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=1706006160; 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=518Jn1m04qVNd/hB6FcaFbxdgjO4h5CJ9DcA/eDdQqM=; b=7RTNrxsINM/qY0cMCgOJyub4hasp2s8hBkB1LuhHDxXhErWKfhXFVCLl/045+rwA7MXmch RJf+21q9P2nCEv9bMHD5bDMv8N8jXqVc+wML0Cw4FdrBb4XC/NR/JzDtWQzi3G0h8zKofs jd9F2V1VI3InM7P0rcqT1ztIqn1/tgs= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TK3QX5Y0vz4f3khd for ; Tue, 23 Jan 2024 18:35:48 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id AC9EE1A038B for ; Tue, 23 Jan 2024 18:35:52 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgA3Bg+Flq9ly6DjBg--.30161S6; Tue, 23 Jan 2024 18:35:52 +0800 (CST) From: Kemeng Shi To: willy@infradead.org, akpm@linux-foundation.org Cc: tj@kernel.org, hcochran@kernelspring.com, mszeredi@redhat.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] mm: remove redundant check in wb_min_max_ratio Date: Wed, 24 Jan 2024 02:33:31 +0800 Message-Id: <20240123183332.876854-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240123183332.876854-1-shikemeng@huaweicloud.com> References: <20240123183332.876854-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgA3Bg+Flq9ly6DjBg--.30161S6 X-Coremail-Antispam: 1UD129KBjvdXoWrKFy5XrW7Jw1fXF4kXr4UXFb_yoWfXrc_XF nxtr95A3W7WFy3Ga1I9as0yrs7Kws5Cryxuw4j9an3tFyrKr1FvFs5ZF1DAw1UWF42qasx Gws8uF45ZrsrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbS8YFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jstxDUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 05A6EC000A X-Stat-Signature: 8wqpnn1zxg1aa5u3w8hcufq4tr3i7okw X-HE-Tag: 1706006156-975051 X-HE-Meta: U2FsdGVkX19sDxLs7DyGBf23Uz6kTeKn1/LgGthCu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2pClZYr469CO7JLMohVGBwDTyOrL/56JVmIixcZ8annTUOBol7Fv1IvKBYHSR+rumxKjdmfg2dEyQhivULGXl8FHXB7ui22FUmfm3Jx26LqiwEZrBRaOBovfRcTulmCLrt6DyOA3gPwH/LZI1WOFiNlTkI5NWh0cDBOZC8kq9zc= 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: We initialize bdi->max_ratio with a valid value (100 * BDI_RATIO_SCALE) in bdi_init and we always set bdi->max_ratio with a valid value (< 100 * BDI_RATIO_SCALE) in __bdi_set_max_ratio. So the validation of max_ratio in wb_min_max_ratio is redundant. Just remove it. Signed-off-by: Kemeng Shi --- mm/page-writeback.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 5c19ebffe5be..f25393034c76 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -198,10 +198,8 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, min *= this_bw; min = div64_ul(min, tot_bw); } - if (max < 100 * BDI_RATIO_SCALE) { - max *= this_bw; - max = div64_ul(max, tot_bw); - } + max *= this_bw; + max = div64_ul(max, tot_bw); } *minp = min; From patchwork Tue Jan 23 18:33:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13527205 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 0DA37C47258 for ; Tue, 23 Jan 2024 10:36:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CCF506B0085; Tue, 23 Jan 2024 05:36:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 88E7D6B0093; Tue, 23 Jan 2024 05:36:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 649366B0083; Tue, 23 Jan 2024 05:36:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C0B516B0087 for ; Tue, 23 Jan 2024 05:36:02 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 72462C0677 for ; Tue, 23 Jan 2024 10:36:02 +0000 (UTC) X-FDA: 81710220564.07.3F4FCBE Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf12.hostedemail.com (Postfix) with ESMTP id E3E744001D for ; Tue, 23 Jan 2024 10:35:56 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.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=1706006160; 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=IURGaeULh4hznugYEnawrad3ofcDLif3EvNTQEzDaos=; b=uSbWcKGtd3l16yBHajy9gZC6hPqiOKJ4AHNlkae10szB2ktInfYaAVYgxRcS/5+T1ZhPUx Q/FdhaykrMnVdXUxCDijRElfKFTyGrf+jFXrBj2xFmtgzhdvdtMkymONWlafJXI8+z4BLp 4YvVWC6uQzlOj9pzLpn0SfZsLl5cj7I= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.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=1706006160; a=rsa-sha256; cv=none; b=b6Up2x7IjbNUufeK3Ll0eUWJ6hCy6uxWRMbNzvKtduuirayPFtregSq6eFjopelO03TRll BeD1h16jY005HZ16OWbR2Wh7XS04Hj/YCvcQNA2ZayqRfIov6UAJbzuGFnR6dkEyNEBSmE nQkTkUx6sp5faCi9sJN0Pu1PmKBapKQ= Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TK3QY1QLyz4f3khM for ; Tue, 23 Jan 2024 18:35:49 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 1EF3A1A038B for ; Tue, 23 Jan 2024 18:35:53 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgA3Bg+Flq9ly6DjBg--.30161S7; Tue, 23 Jan 2024 18:35:52 +0800 (CST) From: Kemeng Shi To: willy@infradead.org, akpm@linux-foundation.org Cc: tj@kernel.org, hcochran@kernelspring.com, mszeredi@redhat.com, axboe@kernel.dk, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] mm: remove stale comment __folio_mark_dirty Date: Wed, 24 Jan 2024 02:33:32 +0800 Message-Id: <20240123183332.876854-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240123183332.876854-1-shikemeng@huaweicloud.com> References: <20240123183332.876854-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: cCh0CgA3Bg+Flq9ly6DjBg--.30161S7 X-Coremail-Antispam: 1UD129KBjvdXoW7Gr18Zw1ktF1UJFWktryUtrb_yoW3XFb_u3 Z7Jr1kXa9Fgr1xJay29as3Aw1v9a1DCr1xZF1SqFnrA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DN1W8WfLqXHGIrvonpx8zmWPbqSlf76VeizlV1/gkp5RhC51pG45GlBD09uZz81t336Ax1fMyatLxpcnvZ1AF6JqMVqPzXHRbEadIQbstiDWjF+HkaqR7xS9zNAlBHQujS3yUgu8/wYNLqO/hxxaE1yQAU7x/6HzJC3+zLRFMkHg11DzU+dyYoaYe+VFjS75iJHzbhpekM+kZ6uqPkjQ0JNHwsVa5UD6h4Gqal1bWbpSFt8GLPs5/BtkOtOsgQCh4+XDUdeWMt4k4MIifMhwtYdkLk= 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: The __folio_mark_dirty will not mark inode dirty any longer. Remove the stale comment of it. Signed-off-by: Kemeng Shi Reviewed-by: Matthew Wilcox (Oracle) --- mm/page-writeback.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index f25393034c76..03e2797bc983 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2647,8 +2647,7 @@ void folio_account_cleaned(struct folio *folio, struct bdi_writeback *wb) } /* - * Mark the folio dirty, and set it dirty in the page cache, and mark - * the inode dirty. + * Mark the folio dirty, and set it dirty in the page cache. * * If warn is true, then emit a warning if the folio is not uptodate and has * not been truncated.