From patchwork Thu Feb 8 17:20:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 198255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp49036dyd; Thu, 8 Feb 2024 01:36:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGb+QcZDV7uB44L7wv9MVADsH//a3DzFHyadS4TnZKUwegna4gJxiNb7fAJ9iQnEVyrlblS X-Received: by 2002:a17:902:da88:b0:1d9:791b:7dda with SMTP id j8-20020a170902da8800b001d9791b7ddamr8261737plx.36.1707384965629; Thu, 08 Feb 2024 01:36:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384965; cv=pass; d=google.com; s=arc-20160816; b=x+6BZ5D0vcpjNNFCmVgcSeAwygMIMIq0ETZUQaywEui6nPAcYtf2TuRL0JB6L7nNo3 ju+Yzb8B/O8WBfeC9MYknkjwKvAOQky4ZwFbBvBUor1k2ZfW0+GsBk6jA5WANWc4ci3T e0WO65FBmEEXmdC/3pqXXtB5jAzTrtQ0rKrbVMesCUTkBmLpOejxJhPv1a05bbFu6y+r cInUjwfgkzQ7jEP3PBZqpc7p7PimSikH/cuyuHxSjMzSKRtVaFazkfAFZm36os48xJCV fxPbvY7wbQH3jVmal5/B5BDNU9P/wMZsdCwa4HPS1Es34NiLc66kktmrNYlhYOPDDF4P y+UA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=lfuUFvekbxRoJg7zAOTIpU2D7nehHC6bVn+Uui/j3EU=; fh=52/hpvQLyfJ8tSjUIBmXmBpjAhGQP0qCtaNWbJOmiT8=; b=IYep7fdFp4BD1u3CYQ4t8Ck9Y+nXZMzRWs7Ofn+vE6FwnRP2KTrHLOkdc/VlBfhmdb soEFOIHXZOJ0tS9LjGZVk3GVgwc8EKkGZLbAd3Tzr6UAjO2dS/gpUOFEXoVzWzpLMmeS PV//HrXABjeunta2r1Cs5ORcWkQyezjeD+T/U4P8t5Hfg7OfHPO1z9wJmRBa4BBekldz 9OwEFvZzrj83I14J3Up4FU6Fh+czFSqColb5K+KbjUjIFEP5jjhTxmqOthc4lwdmNytr uAJjGGIJG/doVU8YQQGMYWLUdt3v+KyKuWxi7KfIbC5hwzGEGkiaXnTjBXGrW+p8PmJY NFQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57733-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUGB6HxC7uWLagf9TjwNSsYK/q7cTxpkMlpg3NY4sM6IIcdmytkvqO7s9IzSoCeaozNkEbRSLlH14HUVAfO1/HnVk8fyQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a17-20020a170902ecd100b001d8dd447a5dsi3786536plh.453.2024.02.08.01.36.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:36:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57733-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57733-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF835B2746D for ; Thu, 8 Feb 2024 09:27:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B337768E9; Thu, 8 Feb 2024 09:23:16 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 106956EB61; Thu, 8 Feb 2024 09:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; cv=none; b=Yc8EpRz+NvRC5G4lDmNLVbNK1yCuPI27H1r/V55XeYqy0HMxFOf/6kxqYvF0ibPVPP+rG+ouIGppVAn25HT1GHekTPPmJwgTou9OpjYZyw2dnlrmk73C0rqtS//WS4tg8O+tan6+O7qYBXEktPB3bccMBSXah3cPhKvlM0WuUIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; c=relaxed/simple; bh=IRBmSe+WJDODnV0rMri69fdXUTnMB3uoZQW0SYzVzPI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XbAD24y9jIAvfYUDABHdhNasr+PLedsgue2ENXlCas121PByEKavymKc6Q8wT0biFrIyB2WlH41ayQ+tsD2EkKdqs0Vbv6plivd+ArqtPeBYkCOOMSka9MwHEjxgMnJli/4tmYHHQycDVLRDRkcU7qQNCjS1RYSg2vsaGTNZDzw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TVs380PM2z4f3mHQ; Thu, 8 Feb 2024 17:23:00 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id C96031A027B; Thu, 8 Feb 2024 17:23:06 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S3; Thu, 08 Feb 2024 17:23:06 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] fs/writeback: avoid to writeback non-expired inode in kupdate writeback Date: Fri, 9 Feb 2024 01:20:18 +0800 Message-Id: <20240208172024.23625-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZF4rJF1xuw4xXF4kJr4rGrg_yoW5uw1DpF W5Gr15Jr4qva4xWrn3Aa429r15t3yrJF47JryfWay2q3W7XFW0gFy8WFy0yF48Jry3XrZa qF4FyryxCr40kaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9Eb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY020Ec7CjxVAFwI0_Jrv_JF4l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU0a0PDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322897625985235 X-GMAIL-MSGID: 1790322897625985235 In kupdate writeback, only expired inode (have been dirty for longer than dirty_expire_interval) is supposed to be written back. However, kupdate writeback will writeback non-expired inode left in b_io or b_more_io from last wb_writeback. As a result, writeback will keep being triggered unexpected when we keep dirtying pages even dirty memory is under threshold and inode is not expired. To be more specific: Assume dirty background threshold is > 1G and dirty_expire_centisecs is > 60s. When we running fio -size=1G -invalidate=0 -ioengine=libaio --time_based -runtime=60... (keep dirtying), the writeback will keep being triggered as following: wb_workfn wb_do_writeback wb_check_background_flush /* * Wb dirty background threshold starts at 0 if device was idle and * grows up when bandwidth of wb is updated. So a background * writeback is triggered. */ wb_over_bg_thresh /* * Dirtied inode will be written back and added to b_more_io list * after slice used up (because we keep dirtying the inode). */ wb_writeback Writeback is triggered per dirty_writeback_centisecs as following: wb_workfn wb_do_writeback wb_check_old_data_flush /* * Write back inode left in b_io and b_more_io from last wb_writeback * even the inode is non-expired and it will be added to b_more_io * again as slice will be used up (because we keep dirtying the * inode) */ wb_writeback Fix this by moving non-expired inode in io list from last wb_writeback to dirty list in kudpate writeback. Test as following: /* make it more easier to observe the issue */ echo 300000 > /proc/sys/vm/dirty_expire_centisecs echo 100 > /proc/sys/vm/dirty_writeback_centisecs /* create a idle device */ mkfs.ext4 -F /dev/vdb mount /dev/vdb /bdi1/ /* run buffer write with fio */ fio -name test -filename=/bdi1/file -size=800M -ioengine=libaio -bs=4K \ -iodepth=1 -rw=write -direct=0 --time_based -runtime=60 -invalidate=0 Result before fix (run three tests): 1360MB/s 1329MB/s 1455MB/s Result after fix (run three tests); 790MB/s 1820MB/s 1804MB/s Signed-off-by: Kemeng Shi --- fs/fs-writeback.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 5ab1aaf805f7..a9a918972719 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2046,6 +2046,23 @@ static long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, return nr_pages - work.nr_pages; } +static void filter_expired_io(struct bdi_writeback *wb) +{ + struct inode *inode, *tmp; + unsigned long expired_jiffies = jiffies - + msecs_to_jiffies(dirty_expire_interval * 10); + + spin_lock(&wb->list_lock); + list_for_each_entry_safe(inode, tmp, &wb->b_io, i_io_list) + if (inode_dirtied_after(inode, expired_jiffies)) + redirty_tail(inode, wb); + + list_for_each_entry_safe(inode, tmp, &wb->b_more_io, i_io_list) + if (inode_dirtied_after(inode, expired_jiffies)) + redirty_tail(inode, wb); + spin_unlock(&wb->list_lock); +} + /* * Explicit flushing or periodic writeback of "old" data. * @@ -2070,6 +2087,9 @@ static long wb_writeback(struct bdi_writeback *wb, long progress; struct blk_plug plug; + if (work->for_kupdate) + filter_expired_io(wb); + blk_start_plug(&plug); for (;;) { /* From patchwork Thu Feb 8 17:20: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: 198246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45498dyd; Thu, 8 Feb 2024 01:27:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWXQW8KzurXOoGGjqznAFKbn4DW3svjpAu2p7bF7AwRvvBdTNjZAce3Q0NCJdFCn5EjugbPt9ZdFkQy11CgxyE4dq/NLg== X-Google-Smtp-Source: AGHT+IEcNEchWo8epFOoYe5nDdaXGTyoBAb7O3BvHcC46T8/GnjQveZ9hxU8KZ3gVLuySD5r3Tou X-Received: by 2002:a05:6358:33aa:b0:176:8a8e:213c with SMTP id i42-20020a05635833aa00b001768a8e213cmr5845239rwd.3.1707384446274; Thu, 08 Feb 2024 01:27:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384446; cv=pass; d=google.com; s=arc-20160816; b=S7ncyNfOGd7vMUmxr/gCm97v/Q9pxsy3UVwWIa0o7eq3Ol1yzRFssP3jmRKd6yB4Mn hSRlK/qD/ilux7Vs6Sw/TK+AnSkV74rzznBgM+jneBZjQNrSYN+PuhvkTjvAj1lce57i 2EPqBDoyeOsR97EUowZBLnxYkoKXyfwmCBtWXc2a7cS+GDY56MfLPolMOiH5+CnJRD8h lFjXmjd6X1g1o50F54kapHeZ+RHU6BTn6opodKoNnInI9hujKR3qj0p2mWw9E/kdHlg9 cIrNVb9+eiR/Ly5XxxZ6EzkzRphVKiBtAw2+vpwFFzVsbad9EnUlShe/KBy2VygMyYOV 3D7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=2mxSBJYuYMG6vdbu8HHidrvDlVlGrXNtMoc83GOkPY0=; fh=3QjNKZAk6JjDQJ7oat7s3Yy3ZQTh/fYlNW8K/VnUMdE=; b=i99Dl8KAVASvo2IkSzFcfeOSNSyCvzn8bMQBeOGT88mFhArZMoFa5ZC2wC3DxFin+e 673Qw00t4mAHQYQV6jpDwDi1uX5XAkC6hBiwh8Ad8fFf6KFPTmijTLV3xNd3fhJ+vVXi 7o8bEh+BwoVn9HjELhTzruTM6h4Cz/iznLkd8XZDyaAzTtOMMgPu3bE9Fwg9xzqlZsfg Su93htnQAWvGhx7GgnnTIbELilacftxul28/QPrvpl0w8mdOUyzWEhBpVNkZM1MO4A9x lrGUhsYZCqbfnG869fdMQ3in8/6qBx6p5OcGyWNZg9GGKGewfhb3nHFX7Vz1H6Wt758K kuUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57732-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57732-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCU5VBZTWj/09U2g27GAFmfb7ib0ggIWPPg8TDaNQ3m+3Uz96cPOF+Ol3ZWEO43uR1pExPNwl2UzHjDIbjx8lMmHt/fzew== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s15-20020a62e70f000000b006e03dd4fc24si3334265pfh.278.2024.02.08.01.27.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:27:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57732-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57732-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57732-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 07ABB28312B for ; Thu, 8 Feb 2024 09:27:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EEF9763F0; Thu, 8 Feb 2024 09:23:15 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1076B6EB6D; Thu, 8 Feb 2024 09:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; cv=none; b=A+GcOuQUivRro7pAOnVFRkAQuFi5pVZULECLNzAL3K9ukA3yn+63POmQnmjAVlT86ReqXrFEbPYYcMD4BLmwwh82CUKsOg1o8DE95g5m7KDpyV9baJXehv9gyjVNDHUYyOar4xI0eeqZ4JNOpfuDt2mMzglyGn7/QTuSqMtZnp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; c=relaxed/simple; bh=aCreZ5MUO5xBIYGsOG1qJHRg7BTL70NtVzxDdZwBTxc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=oCGKZan12fwqyrv1cLAkfi7xnYvh9WlBStvT4ywUwb3S1WsC0ysS14IEu73ASHqgXcE5zZ2AScZkcnzZP83MasP0eGtYaJkpjAd/nC7S6XvUJJ0Je8sM1oQC03+mItaWCw2wKGx8jPIFG6+4aIzwALxJohnRaUbzWXMAoYKVEdI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TVs382cnhz4f3mHl; Thu, 8 Feb 2024 17:23:00 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 20A531A0232; Thu, 8 Feb 2024 17:23:07 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S4; Thu, 08 Feb 2024 17:23:06 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] fs/writeback: bail out if there is no more inodes for IO and queued once Date: Fri, 9 Feb 2024 01:20:19 +0800 Message-Id: <20240208172024.23625-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Zr1rArWxJry5ArWrZFykGrg_yoW8Gr47pF W5tryUtrWYv3yxurykCa42vw1Ygw4DtFW7XFyfua17trn3ZFWFgFy0gw10yr4xJ39xuFWS vrZYv3y8Jr1xt3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBjb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jTQ6JUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322352960005044 X-GMAIL-MSGID: 1790322352960005044 For case there is no more inodes for IO in io list from last wb_writeback, We may bail out early even there is inode in dirty list should be written back. Only bail out when we queued once to avoid missing dirtied inode. This is from code reading... Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- fs/fs-writeback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index a9a918972719..edb0cff51673 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2086,6 +2086,7 @@ static long wb_writeback(struct bdi_writeback *wb, struct inode *inode; long progress; struct blk_plug plug; + bool queued = false; if (work->for_kupdate) filter_expired_io(wb); @@ -2131,8 +2132,10 @@ static long wb_writeback(struct bdi_writeback *wb, dirtied_before = jiffies; trace_writeback_start(wb, work); - if (list_empty(&wb->b_io)) + if (list_empty(&wb->b_io)) { queue_io(wb, work, dirtied_before); + queued = true; + } if (work->sb) progress = writeback_sb_inodes(work->sb, wb, work); else @@ -2155,7 +2158,7 @@ static long wb_writeback(struct bdi_writeback *wb, /* * No more inodes for IO, bail */ - if (list_empty(&wb->b_more_io)) { + if (list_empty(&wb->b_more_io) && queued) { spin_unlock(&wb->list_lock); break; } From patchwork Thu Feb 8 17:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 198248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45617dyd; Thu, 8 Feb 2024 01:27:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IETGGo/aSNzHprrdcz4QuZXbsVG5ZpZY3fFprYEz9WNelAZCeB5rAzBpZtDTB9JxD6tQh4w X-Received: by 2002:a05:6870:46a2:b0:219:4033:a215 with SMTP id a34-20020a05687046a200b002194033a215mr9244934oap.7.1707384471482; Thu, 08 Feb 2024 01:27:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384471; cv=pass; d=google.com; s=arc-20160816; b=SvWSkoOqUMdlHjfRCfNbJDWbRl9wxk1Fiqvq2jlt7RW32FfwE49jS6bjM+DMglBC0g fEN27RhhuKiBLcExJR+vp6zQ1kH8ikU3RrmAFP0YFo6WIdBwbN61c30Himy4J7v0orAp cLHlcN/lhrHdu4xELm0YZVu0yVqr6YZK0Lk/N4jfLP29RjVc0RyEqrBWUnal9MAUSQOu AzIFjo6d6uv0y0cMXDiY6G1sXcA5o6SnB0vY/oSJRqwtIOx3kSkvdRdt/IS8v2OtDBGR r61MTgkgukqas5ggiTLcnf3sbeyUcgJo8IIX+NAGMSf176NPqa1caJo7TPGfIWt7r2Uv 9I0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ktE1ckKOJCPNgXPXdi/5acIKqdJz5MC/I++Xo/qlKGw=; fh=lD/xcg9NMZOqk1752ymnnG6ybxgNzWHM2JXiHYWVuds=; b=ez22lCTOu6TfevlBZILES4oyIKUEGLrk9PdB9aksNVwsziMadFmt8IXgK7rEsU+Moc Lh6+2L3yoA79eV1uM9v1yD0MzlHZJcIbwRlggsE7aAZ5nyytAB23UFhUF7tCbA9ciw9z T+BoM3+eF8M7iUA7oP5gvZgDcRtB4Fm3nrqZ3TT208gZlnW4u7SzZipmDNTWJUr1byY/ xHOh3/7G6/kw03LQGqJKtsHalxhEqRJwhn3eB1wFoGxSFxCsWv/WUZbGG3QDUzcT3zL7 Nw7E3c78dzy/4b5lCu1t0i0wCIm37AKZta8rN40+Q5ZtvWbNWl/1fxxaKscSCBHHqfm7 zpDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57735-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVfOpVcD76J8Q2IFPsZh1rhZhkTf3KFN4Uw2SWJz/7fK4EjjHhKRGqjpR+XxHQmNdnOnaHcFaC45QVZaLwdiDNoZtQbCw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y28-20020a63b51c000000b005dc494e62d8si673864pge.543.2024.02.08.01.27.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:27:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57735-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57735-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3F75A285051 for ; Thu, 8 Feb 2024 09:27:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DC3D76418; Thu, 8 Feb 2024 09:23:16 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C6DE6EB75; Thu, 8 Feb 2024 09:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; cv=none; b=Q0iErvCqDvW3KYs22BjHOUgcMQi6NkHbJ3GMkwtqsrKM3cbEz7DfRTVPvm4kjGO5L0pP86hzTepIf7G3MDf7vBMf+wWdJwCH/BvPJ+zNaBtW6hEAfTz3d4pJoIcT2viup3NdHCf4bP8d2axUiD+/sscDzHsWTny2RnFPxNnVdjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; c=relaxed/simple; bh=5OM/RsInbbF774iZl5AEDt/9K4ap0ekY6wYxHcth7Gk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Dc3GtmuEfXfiMXMBiWiS5RIXMgA98zUznQvzK5CgWqtKrW4yYcAAC9OLMiEqtS1GcdZnDSsSAOBITtXxqRWgnXht7+nwiE+plHGtqkcRG3dxRVCYs7UrD3aABEKVLGI7Qt+OSvuDZt3qpdyUYqj+Thm/0/p3i1L8Go5KfVrDvhY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TVs3B6c7Cz4f3js1; Thu, 8 Feb 2024 17:23:02 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 6BBC11A09D8; Thu, 8 Feb 2024 17:23:07 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S5; Thu, 08 Feb 2024 17:23:07 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] fs/writeback: remove unused parameter wb of finish_writeback_work Date: Fri, 9 Feb 2024 01:20:20 +0800 Message-Id: <20240208172024.23625-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S5 X-Coremail-Antispam: 1UD129KBjvJXoW7Ar1fCF47Jr4DtFWrKF1xZrb_yoW8JFyrpr y5Kr1DJFW2vr47KF4Duay2grnrK3ykKry3Gr4rWa12qr1SvF43Kay0gFy8tr1UJr9xZFWf Zr4vvrW8Jr40yr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBjb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUWwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2 z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jy0PhUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322379109647364 X-GMAIL-MSGID: 1790322379109647364 Remove unused parameter wb of finish_writeback_work. Signed-off-by: Kemeng Shi Reviewed-by: Tim Chen Reviewed-by: Jan Kara --- fs/fs-writeback.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index edb0cff51673..2619f74ced70 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -166,8 +166,7 @@ static void wb_wakeup_delayed(struct bdi_writeback *wb) spin_unlock_irq(&wb->work_lock); } -static void finish_writeback_work(struct bdi_writeback *wb, - struct wb_writeback_work *work) +static void finish_writeback_work(struct wb_writeback_work *work) { struct wb_completion *done = work->done; @@ -196,7 +195,7 @@ static void wb_queue_work(struct bdi_writeback *wb, list_add_tail(&work->list, &wb->work_list); mod_delayed_work(bdi_wq, &wb->dwork, 0); } else - finish_writeback_work(wb, work); + finish_writeback_work(work); spin_unlock_irq(&wb->work_lock); } @@ -2285,7 +2284,7 @@ static long wb_do_writeback(struct bdi_writeback *wb) while ((work = get_next_work_item(wb)) != NULL) { trace_writeback_exec(wb, work); wrote += wb_writeback(wb, work); - finish_writeback_work(wb, work); + finish_writeback_work(work); } /* From patchwork Thu Feb 8 17:20: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: 198247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45542dyd; Thu, 8 Feb 2024 01:27:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWMgKj6wrH6Ox1zZf/kVlXN7BZvzdZfi57NRMx0K0i51jkZiKxl8rZTYR0wIl2XfJ+M3UTqYNImMJzwUzihoOH4EmkK+w== X-Google-Smtp-Source: AGHT+IHrEENiMTWJ6J6gQUdMPicHIXiaU98nmhCXJa+0xtGbB8EYeWx/8hhBaTmbPsyVjFpyfdEG X-Received: by 2002:a50:d583:0:b0:55c:8d17:1bea with SMTP id v3-20020a50d583000000b0055c8d171beamr1863115edi.17.1707384455183; Thu, 08 Feb 2024 01:27:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384455; cv=pass; d=google.com; s=arc-20160816; b=dl4KeDCdKxwjfpvcTd93d+0hNvjITZNKb+sAxENS6RSq+rzQ76SxF89vyYwJN3UUI6 xvWSATayf7k4tw9sRmbKvw2ItkEMo/253ckCNC/TdlnM+ZD+ZSIBGkdsgHFTbLCoDW1a +pfxE6zcfMEavPz1AaJa6zHZZDZQIiEdXiqfpAZxyvLn08RqvU5vwc1K+2EHEI3CxCFb JBN06iVAxkipczPTQ8Yk3hWtbhJ2b1Mh3kVNsaVbQDNamru8Jj326w66MB69hxF2Vx5j bJvdaQhrj7fjNpEjI2au8jE7I5YClW1rmQz4BRQ1nAhYoSHk6mRrP8vcd6sYZCBzA/dz ScrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=YbNlLXJJ1GmVIQzMn5Hy3DEaIjecZGBt+MBYpEugQ6A=; fh=FENSxzwc0PR496Tch1tcjf4kH5ReTA7wNQzNfPCsHo4=; b=OtAIj+uXxQ8N19tCfpdnI6izye8sNwVjs/R3RHE4LAHYH+0pCB6b17tL9RgA76JSLT tLYJyOVP+t0mzwElb/YJ+1M9TiXwwwOxJM1DcgKKUzzruT5He+DdK+xpxIGorx1ccbTT P4RZnpHOeUXc0pkwe3qJjJBSHjjySqXT0dPPgvRL3hQ6EofcxGegJKLrVL+9ZTFeh8Ci CzQsj3/wLr5R0zPbpRf+hpYtwla0ZxDDXeIYw/244FvD79tPwO+T8W9KGhAXYMn2fZDA oICyXd98++nWrLb2U3gBz+S5iLblj56JJHHca5QIlnZ2Zy06O2WATp4JYClncGcayWuF 9nwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57734-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57734-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWeHtZ4ljhiZ+aHMqMJUD0cX5gtvN8U4CqNA2LLTCGz8Ihp0ytbY3Mk4twkY9NDYfnMl40OCOzSCQkkBM37jTPYnetFnQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r16-20020a50aad0000000b0055ed802c22bsi715032edc.528.2024.02.08.01.27.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:27:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57734-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57734-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57734-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C5BB51F22099 for ; Thu, 8 Feb 2024 09:27:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DD276F07B; Thu, 8 Feb 2024 09:23:15 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 107316EB6C; Thu, 8 Feb 2024 09:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; cv=none; b=j2vyj8OLsEY5XzXYG3OyVhbS4fhtLQawSXu0fhSLHCe4/wSpMtIYZXZRl66N8Qg3+Vj5QaCg/XHrthjO9G2VVGVP4mIteZUNhINOPYdzR3ZHU7jr//a50aScqdHPSPxYKbT+XN9RBI4chYu0PX3Umc5LZOZnYNcpMZ3aP+XHTXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; c=relaxed/simple; bh=c8ghA0u9LWy+i3HgbXNw12xdIMNRO454mnesp/BH9+0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AKSf1JbLJE4vQpCyKzw+FYGTavI/HtCAWsjjK9p+EgKrIDqUgbY+XkMbJwkXlFYmNCuz0hjBPIDHbixjimPuW0d+eO3X5WrcHkKOn0hSXWSb6SpVYBrCF2RUoQ3zYNgFlqzVWRqPRpaIp9rF5D7qrfRwgoLQZqqMKgXiLworOU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TVs3D6Vl8z4f3k6W; Thu, 8 Feb 2024 17:23:04 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id B76A11A027B; Thu, 8 Feb 2024 17:23:07 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S6; Thu, 08 Feb 2024 17:23:07 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] fs/writeback: remove unneeded check in writeback_single_inode Date: Fri, 9 Feb 2024 01:20:21 +0800 Message-Id: <20240208172024.23625-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S6 X-Coremail-Antispam: 1UD129KBjvdXoW7XF1rXrWDtFykZF48Cw4kWFg_yoW3WFc_XF 4qyr4kAr4FvFyrAw4kCF9aqrnY9w1UGr93JF13KFn0ga4YqryDZ39YqrZ8A34qvFW2gFZx Kwn7JrW7tFWfKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW8JVW5JwA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0D M28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUnr9NDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322362681280045 X-GMAIL-MSGID: 1790322362681280045 I_DIRTY_ALL consists of I_DIRTY_TIME and I_DIRTY, so I_DIRTY_TIME must be set when any bit of I_DIRTY_ALL is set but I_DIRTY is not set. Signed-off-by: Kemeng Shi --- fs/fs-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 2619f74ced70..b61bf2075931 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1788,7 +1788,7 @@ static int writeback_single_inode(struct inode *inode, else if (!(inode->i_state & I_SYNC_QUEUED)) { if ((inode->i_state & I_DIRTY)) redirty_tail_locked(inode, wb); - else if (inode->i_state & I_DIRTY_TIME) { + else { inode->dirtied_when = jiffies; inode_io_list_move_locked(inode, wb, From patchwork Thu Feb 8 17:20:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 198250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45716dyd; Thu, 8 Feb 2024 01:28:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo+feSjIz1Xrel+rXQZKI5x2Tyoo8k5xCvpYiFHIKM5lehuCOd69BXH2/7ti6lq6DpxdIM X-Received: by 2002:a05:620a:31a4:b0:785:a443:6a49 with SMTP id bi36-20020a05620a31a400b00785a4436a49mr3071545qkb.19.1707384490539; Thu, 08 Feb 2024 01:28:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384490; cv=pass; d=google.com; s=arc-20160816; b=wpt8wE5giMRuSBf0yoNXRUTZxitHXn13c8lIPu9e2AY6KcDaXiqvQYi8FgwBFZEjsb M5+FqtKboWPVwxh6AQC6xeWJtqIw3qkCVeT5INc9IQ1VUvr2SbeuNOe9lyJYPeGj83n6 rGByk1nXr26GMkUbNl8N5ZefIVwqeIqC2iYHSeAXtuM4MtdEVZxAaMa9L5irj2QlDbfu QXmPm0DsHHa3O79yab9HDW5DK6cfBTL7X3f8u8GCq8uP0Bq/++Fr5PqjjYG76jyJgAAs fYNOSETbzpCpBJzbRFlBguMnAFbQvi6RC3tpdBxVhBGvkgwaaE6bAg6T8vGOrDhoXwdR dDHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=d5gDhkwcs4L5yBRyFroHJbX+9G2HHje3LIbIQe5Bqzo=; fh=abu9K+ki0tHJ08NCLzg7MhwXzxLxq+0CcisqBBsiC30=; b=gKAJp/TIf+hBhRQkVxiPh6CWiiZ6lhpXEx8kFRiqpk+cKcr3LjdKQLs0aqPqblY0Ax 2tq0CMou5wC3cMZfGRBdrHofmoLC3DqvAVPLkxkY5LFWc1QcbHPoJwB64boZfMnD4QJj el7R74/IrUkQcKCLXcfBNX4w9yfc2cvJ8LFJLbegctzIQ9GxOt7YmBtlu5mMC/e2IEvO XG+fPJehk5jGEyOXTUtXnusVdzniGlINLemH+/ADAnjpDHYVKXAiStdZagc/6sCokcoi UNCOu/CSt5RcHyOyKt2b4I/0mn/jge4ljBiD3QprxmqOD2AkRzBGh/OzBZzkyuQOPrCz Qr+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57737-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57737-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXMRTa03N3uw0NQ9iWCOk69FJq21NFwVo9aqUn41biDZ02zZ4zMVr+mjAB/KZzBjAaGp5zbAP5L4pKIVGifbOlQl9L2NQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h20-20020ac85854000000b0042beb657032si2986154qth.276.2024.02.08.01.28.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:28:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57737-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57737-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57737-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5717E1C22137 for ; Thu, 8 Feb 2024 09:28:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ABE076C8C; Thu, 8 Feb 2024 09:23:16 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1063A6BB49; Thu, 8 Feb 2024 09:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384194; cv=none; b=bgBkcWns0VY01dhoJeNvXQqUZTRdFOv6wtlBOxCdxclVpbBtC9BzAp9Rv/kYBFCiSkKkyeDzzt1gTnC4zqwzIcZT+pK3j5DxuxDdw1zt/LXEJ6fv5cnDJqlPSsY8qAyMRMeEVd0Lbqf5DTVVq/wPtE98zYMyBAtlG04XkEKljcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384194; c=relaxed/simple; bh=r/VLr9jN9dklOWb2ltJL6vuxoLRUWPZW50wD8+UThOQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MB4cZ+4h79T4h0/3i4n4559+Ka57OdyxqTkugR2bTrMPEL65Y7nCAKqFMtgrAB2q+EKEAI8vOGz/suU06cRNWrnaePJLRs7Be4+Q98AfB+pKxRBCftRnKd4Cj9GxOnEcwcS0BnzDnM99R/ZP+YaO9swMrtPl0ikctEMQgUiVY9s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TVs3F1MYsz4f3kk5; Thu, 8 Feb 2024 17:23:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 05B111A016E; Thu, 8 Feb 2024 17:23:08 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S7; Thu, 08 Feb 2024 17:23:07 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] fs/writeback: only calculate dirtied_before when b_io is empty Date: Fri, 9 Feb 2024 01:20:22 +0800 Message-Id: <20240208172024.23625-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S7 X-Coremail-Antispam: 1UD129KBjvJXoW7tFykCr17uFy7tFWxur4kZwb_yoW8GFWrpF Zxt3sxKr4jvw4Sgrn7A3W29r1rWw4xGF47A34xZFyIvw13Za42ga4vq348Kw1kJr47Zr9a vws8GFWxC348t3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBFb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7Jw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jstxDUUUUU= X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322399596656222 X-GMAIL-MSGID: 1790322399596656222 The dirtied_before is only used when b_io is not empty, so only calculate when b_io is not empty. Signed-off-by: Kemeng Shi --- fs/fs-writeback.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index b61bf2075931..e8868e814e0a 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2118,20 +2118,21 @@ static long wb_writeback(struct bdi_writeback *wb, spin_lock(&wb->list_lock); - /* - * Kupdate and background works are special and we want to - * include all inodes that need writing. Livelock avoidance is - * handled by these works yielding to any other work so we are - * safe. - */ - if (work->for_kupdate) { - dirtied_before = jiffies - - msecs_to_jiffies(dirty_expire_interval * 10); - } else if (work->for_background) - dirtied_before = jiffies; - trace_writeback_start(wb, work); if (list_empty(&wb->b_io)) { + /* + * Kupdate and background works are special and we want to + * include all inodes that need writing. Livelock avoidance is + * handled by these works yielding to any other work so we are + * safe. + */ + if (work->for_kupdate) { + dirtied_before = jiffies - + msecs_to_jiffies(dirty_expire_interval * + 10); + } else if (work->for_background) + dirtied_before = jiffies; + queue_io(wb, work, dirtied_before); queued = true; } From patchwork Thu Feb 8 17:20:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 198251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45787dyd; Thu, 8 Feb 2024 01:28:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHsG4zng219kWzmlfP2cfB1zBdwLoxrRIjRViA/ah7ieZVcPiSaUnVuHMH+LG2A0lODQipQ X-Received: by 2002:a25:bc92:0:b0:dc6:d7b6:cce9 with SMTP id e18-20020a25bc92000000b00dc6d7b6cce9mr8184884ybk.57.1707384499009; Thu, 08 Feb 2024 01:28:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384498; cv=pass; d=google.com; s=arc-20160816; b=AduMOpozIV2keSWG3gda5fxRSFAJeqLt0gXmUybV+hTjTQBLHOZC+V1FKuJA1fxrQV gUK2c5Cf8QPAIkdY2KjmFoPrUX0AJdF1BfITSja2FcRnRukQqNVXZhHNgcNQ3ITXmltw lXDsGXyVO/wEaF/cI8JqhIn1g9C+CkPRCOu9ZW1Yiw9th6gkLMbDS0ZPzLQnISjvD/CG Du/qGgZ8PnMl9IE6T8Qr3I1LuC+GSsS2wm3kwqbjQuDV5hXN8RKoQQ888vTSAY0NDGOX 98lrdEmkcjUTEzHUSvSpTp6ifoxsMZC6Xf1OR4PiEOW2Q4jg29Aauoqx5+vMsIKRuJjI V+oQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=WGk0ITX1+D1LANQg31ZBRZNR3Vo7h96pnJQyOWxzpB0=; fh=b3Oua5JyTSS1E1Ud9OuJcg72ErcXaKs2f8iSK2uQbKw=; b=d460VzSjN7OLZAEKUekGeTpkbbc/0FJDB991Jdf6i08oEJNlRgD7eI5KpnMB0DUMJa XsGWth77lxN1MUn1bzM4VzFZ/nchEej52mY4tarwly1ri+A6heT5Krg7fsQrZpB2YBf6 FBh8cl6eXU09tUmd+3VFYWM1Egc5OtGI658+awWGWiQ7zy2OxxZjxDPg+jEQBwm5PQrm /2wmdX5uJAVp28a55BdYhZ2C0wGxsbhGguflPBpS1DtaBv0aauUCb/lEDAH7YN8/nGiP qwspPQTcIVLvFd468gVjBZikP4beczLbGCaOBejBLPay84i1p/Ww9V62GWjXbi3TLuRn UL3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57738-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57738-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXpHrylabdDXQhxJVyc+VTU1Ent7DSU69C2Ukj0JcYFeXYZzeDFydppGuF0Mu8ahshlBWcajjBI4644TKE5A12P28B6uQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n68-20020a632747000000b005cee61cfde6si3476229pgn.437.2024.02.08.01.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57738-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57738-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57738-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B6D57286471 for ; Thu, 8 Feb 2024 09:28:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B13F7867B; Thu, 8 Feb 2024 09:23:17 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 434476EB70; Thu, 8 Feb 2024 09:23:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384195; cv=none; b=RIfMk8sRY4aN7zI4aO0yUfSUBvVU/1i/+3C2gPfe4WpMYUsCipDtFjFm59rf6UC7nxgF7mAQooWGVT0ytIpLgWiuKzUEqsjj9D6AUflFauxmWj/PS2F0v8KVpX0uTHTjNY8pPwLRJhfs3wVh5XfsIvnuRBdiDl++InKISW5cQl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384195; c=relaxed/simple; bh=lHarguMikZ9Dwi9bzYFO+dQtmAomG+c+e8LUgIJpUgA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pw/0Lm4l9YWuAGcRqwthZa5Y5O6KNTWiCp5cQs6Iv0ierJd5KPEzLdNARLtPB0S5SiMzXF8nc31e7e/SRSIAAwfAIBWjS8oC87EZaHARTS+NsAdU5dG7bdR2py0T5CtplBr9q5r45unKLDTY6HhnfXCXM1nF6625z/xO/8JSFxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TVs3F3W4yz4f3kk6; Thu, 8 Feb 2024 17:23:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 50E361A0172; Thu, 8 Feb 2024 17:23:08 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S8; Thu, 08 Feb 2024 17:23:08 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] fs/writeback: correct comment of __wakeup_flusher_threads_bdi Date: Fri, 9 Feb 2024 01:20:23 +0800 Message-Id: <20240208172024.23625-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S8 X-Coremail-Antispam: 1UD129KBjvdXoWrZFy8Zw4kZr4xXr45ZFykAFb_yoWfWFc_JF W8tr4DGFZFgFs8J3WxZ3Z3JF92g3ykCF45uFySkF98J3WY9r97Zr4kZFyDJw1jvayUWFWx G347Wr40v39IkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0D M28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322408604653226 X-GMAIL-MSGID: 1790322408604653226 Commit e8e8a0c6c9bfc ("writeback: move nr_pages == 0 logic to one location") removed parameter nr_pages of __wakeup_flusher_threads_bdi and we try to writeback all dirty pages in __wakeup_flusher_threads_bdi now. Just correct stale comment. Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- fs/fs-writeback.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index e8868e814e0a..816505d74b2f 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2345,8 +2345,7 @@ void wb_workfn(struct work_struct *work) } /* - * Start writeback of `nr_pages' pages on this bdi. If `nr_pages' is zero, - * write back the whole world. + * Start writeback of all dirty pages on this bdi. */ static void __wakeup_flusher_threads_bdi(struct backing_dev_info *bdi, enum wb_reason reason) From patchwork Thu Feb 8 17:20:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 198249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp45665dyd; Thu, 8 Feb 2024 01:28:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUeSeTCDnqkNLu6jMC0tCZVVtB3eE4UHlGTeruLPR1eFLKNMHBCiOasnv+BOWYKCNAe30vej3YbpqK67i6G42sDMd4INA== X-Google-Smtp-Source: AGHT+IE/sPOLvC5e5Rla2YYO6NJPupBtJo0nz+9yrhr1P55Cw3f2CztRHbk20L8S2qqAXFspKpr+ X-Received: by 2002:ac8:454e:0:b0:42a:96ef:6deb with SMTP id z14-20020ac8454e000000b0042a96ef6debmr7276396qtn.61.1707384481142; Thu, 08 Feb 2024 01:28:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707384481; cv=pass; d=google.com; s=arc-20160816; b=R88rK6U60vZo1vvUib40vtR7bmP+Qx3cdrN9zaWAxNjV2dxCTFzFBe2zsIIFeEM7hR 1vaMVo527bjRsNHOZvlaqxEBtAevkcDkaDQZ7+xfT6U6Kg4nzigklmlWwxpmHNUYttiZ jJ2SaBE90XGJqVRnGPFbZdMQiSGiLbeeM7WdXwjPUQ4quvDBibjn6wmpN3sgGfb5TOWM adD6Q2obJ9vA2S5Jkfy75SPXfy8ti4rLIqLCspTEmrCXU8IrgL2MqE2Nvi0oj5W9d29o lczvYfsSwfOkcswzwrtqIylUx952TLPa6YNas/JT7wkkqxG4lxv/F1RD0OTBJJJ9bJmT 85ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uRgxtSRe+aHkeKP35HBHFBgSFXsf6ADHQcQjN7k8Vn8=; fh=x85EirHbooYiAvcb1YqhxzDZRTlqnv1jx7pFZsxYu2Q=; b=CrVYJmfRzC75qCk27UaIzGcew9d6SxNYthNpTOwmTiPTsnaFGeiCqBgPUdnpnXq9Xk EoplvXNg/nzzcMlfX9S99EL6Rg7IbUpq++BZTflyZVvnvqrx5A1r8EdKazQI7MrIyJwr 3CASLfaKb48z1U21r0ZSfTUuIE/Ffxatprl7a4CkhJgSZjzA0n1lgfkvvqyqt6Fn8Deq mMIhK2/Vpd6XNG0VML82ZahfO4Qz3882bsYSflnLR1xJczirzlTvKDvEGBQMrf+0WahT 6PZPdtyX3+t46iedqNKkCra7XIkNBLMlpOU9AFxaF508WFxEI4cgEAQX8cgF74M9n18H a7RQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57736-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57736-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXqZHZEEXu57c6Q1jf8/yAxAkZDaYo933larKJBAD7d5RHmD3JjpUvJTCZ5AAzD90CrT1HdJBPtyO+f4j1OXcJYFNwVWw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d1-20020a05622a100100b0042c43f8f5d3si2412787qte.145.2024.02.08.01.28.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 01:28:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57736-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-57736-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57736-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E68B31C25F58 for ; Thu, 8 Feb 2024 09:28:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D58676910; Thu, 8 Feb 2024 09:23:16 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C6A26EB6E; Thu, 8 Feb 2024 09:23:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; cv=none; b=QD+/COhVfOuXYPc1le1V9NssKF1ReevqzdBlvMeIBirooiDRzDKVFsiB2LVNFZR9T+V0NB0L+tenbG/gtvIsgJatmoG9veB0/ezo9JJhdBLGIe8tjaf1irheEHtRRG3Ox4YoIodS6Tk5e8nrShEQ0WeVxyoG1GxkUu7yC0aoldM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707384193; c=relaxed/simple; bh=buq5LdcGq+scmwclurdsaNhgHllZWHnoWJ875s8+pn8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cxHCj02f2lcmIO2YxpiDjIJj9/+nmk9l00aO1AeHSsUOtRa2dUd6vjMMcHJqg9mhndPydXPNaes7+RWW0Atj0mxhFUGC0T1nCWU3FFyblfC/fzuDwqZFFesa6CgcTU4FX6k23kj59xHHmm9gSROu/b0NnpkkgpLk/e6a65qWA4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TVs3D0zk1z4f3kF8; Thu, 8 Feb 2024 17:23:04 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 9E4A91A0B93; Thu, 8 Feb 2024 17:23:08 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgAnSQx4ncRl3tGXDQ--.8574S9; Thu, 08 Feb 2024 17:23:08 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] fs/writeback: remove unnecessary return in writeback_inodes_sb Date: Fri, 9 Feb 2024 01:20:24 +0800 Message-Id: <20240208172024.23625-8-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240208172024.23625-1-shikemeng@huaweicloud.com> References: <20240208172024.23625-1-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: Syh0CgAnSQx4ncRl3tGXDQ--.8574S9 X-Coremail-Antispam: 1UD129KBjvdXoW7Jry8Cw1kKr1UXFWrXrW3Awb_yoW3Jrc_XF 15XFs2yFnFqF45Aay8Zas3JF4v9Fn5CF1kJFySkF98J3WY9rykZr4vvw4DJryv9a47XFWD Gw1fXrWUtrWkKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbfAYFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0D M28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790322389428235216 X-GMAIL-MSGID: 1790322389428235216 writeback_inodes_sb doesn't have return value, just remove unnecessary return in it. Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara --- fs/fs-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 816505d74b2f..eb62196777dd 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2748,7 +2748,7 @@ EXPORT_SYMBOL(writeback_inodes_sb_nr); */ void writeback_inodes_sb(struct super_block *sb, enum wb_reason reason) { - return writeback_inodes_sb_nr(sb, get_nr_dirty_pages(), reason); + writeback_inodes_sb_nr(sb, get_nr_dirty_pages(), reason); } EXPORT_SYMBOL(writeback_inodes_sb);