From patchwork Thu Jan 18 20:31:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 13522800 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 AFC4EC4707B for ; Thu, 18 Jan 2024 12:33:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47BA96B0082; Thu, 18 Jan 2024 07:33:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 42C1F6B0088; Thu, 18 Jan 2024 07:33:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31A6F6B0089; Thu, 18 Jan 2024 07:33:42 -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 23C196B0082 for ; Thu, 18 Jan 2024 07:33:42 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id ED2B61C16AE for ; Thu, 18 Jan 2024 12:33:41 +0000 (UTC) X-FDA: 81692373042.10.1EB99E8 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by imf30.hostedemail.com (Postfix) with ESMTP id 1069680016 for ; Thu, 18 Jan 2024 12:33:37 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.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=1705581220; a=rsa-sha256; cv=none; b=zZva4zfu4DcjEpbDiaDYSq4Rn/DJ5UQsp3YEgkmyd6QDwVVMYxrtIzlum5iL9ZJviFbCFh m3T+4kDajEl557Xcjot3Ks6nFBJvvVbLq3HqHeQaEX7DQrJ2tdr7qXyfFjW8D3QyvI/Vre 0NuSgn+J7oERwQJTGYSv9UReBuTryfE= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.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=1705581220; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=JlP6c3yi8O5EknEjRyHrK/Vnm2SCt3yE8BO5OF7OgAY=; b=Vyrk1RU8T4VqOuD++Sy+mTEhNyX+aOG+SJYl6hsGpOmph0Yo7+DfGJRLOgx0xV6aOZxkFP ZQdLDm+WWzIsck+Sgyu/NdkHBxZRewSOc7pVZsG6KTQn4woXV3ydHJ5DVB92XrQPC6d2Mq vpMkXM/4SxaCPimT5W4F3rdYSFvo0Z4= Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TG2Gc3m1zz4f3kFk for ; Thu, 18 Jan 2024 20:33:28 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 4A5281A0232 for ; Thu, 18 Jan 2024 20:33:32 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAnLW+aGqllR6blBA--.39914S2; Thu, 18 Jan 2024 20:33:32 +0800 (CST) From: Kemeng Shi To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] writeback: avoid to move skipped wb in offline_cgwbs list Date: Fri, 19 Jan 2024 04:31:19 +0800 Message-Id: <20240118203119.764016-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CM-TRANSID: gCh0CgAnLW+aGqllR6blBA--.39914S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZF4xCF18Wr17CrW3GF48JFb_yoWDtFX_ua 9Yvr1UGrnxursY9Fya9a4UXrZYkw4kCr17WF40y347A3yUAr4DuFWkJFn7Xry8XFWagrWf WrZIvw45Gr1q9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl8c AvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7 JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oV Cq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG 8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2js IE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY 0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcV CF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2j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zMh7c6LoxQT9QwaF9UWPYafTcpGKlYMkVaOh+gv7atR8A04T1IGpSBlFzafdTGq7cSWVcEpIpxrbndLeB6ZyJDfAtr2fS8y+E/Y/JgzQYiOuPDFLZsQ3RzdvSZESAkJXZEFjhYYMEzlin2PO0T4DmKH+SomV1Het wNV/+SuL OA/j1r8eIKApmcO4kydKGlGeeEP0jqxbtM13PEJFFTK7tsXdLjS2yj8k9WVvVpW063LWnX+d4+jh1O3Dy/y/BYzsM9CBPD8f8kWXiC5eo/p/WrROIzK29KYLN0Ii93ovkSktoxhqbbtqVC9r0atsvxbbW3fd6TSv3fYceQAlfL0Ef4hvhsGUNS5WNxR2Ow91CgH22/5ZgSawmaguKhaE+ypKDPHPacD9EXn7sBn87duznstfJFX3OkaHUtKqC+ohKLmVNlbHPH0L7wK5c9yL5hDMJlYSnpENO95IKWiyLG3jZH2g= 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: There is no need to move skipped wb to local list. Only move wb which is going to be cleanup to avoid unnecessary work. Signed-off-by: Kemeng Shi --- mm/backing-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 039dc74b505a..681548f848c5 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -773,8 +773,6 @@ static void cleanup_offline_cgwbs_workfn(struct work_struct *work) while (!list_empty(&offline_cgwbs)) { wb = list_first_entry(&offline_cgwbs, struct bdi_writeback, offline_node); - list_move(&wb->offline_node, &processed); - /* * If wb is dirty, cleaning up the writeback by switching * attached inodes will result in an effective removal of any @@ -790,6 +788,8 @@ static void cleanup_offline_cgwbs_workfn(struct work_struct *work) if (!wb_tryget(wb)) continue; + list_move(&wb->offline_node, &processed); + spin_unlock_irq(&cgwb_lock); while (cleanup_offline_cgwb(wb)) cond_resched();