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