From patchwork Wed Feb 28 09:19:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071684dyb; Tue, 27 Feb 2024 17:25:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWFaabmx0s3sJ6dPWtceKbh1MFlWpPp8ffiZoG5el8eKyNVmDsTuEkMq70/oPrFOkKLCmGANWOar21ULtxeJl+WCmkbMA== X-Google-Smtp-Source: AGHT+IFT17PWlzsxcNU1aJKdURV4Lk7d0W62I38TEdMwrcMv53eDFZyVocq3RMFlL0Zf4BXxug2k X-Received: by 2002:a05:6a00:189d:b0:6e4:62ff:d74 with SMTP id x29-20020a056a00189d00b006e462ff0d74mr12935231pfh.3.1709083541215; Tue, 27 Feb 2024 17:25:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083541; cv=pass; d=google.com; s=arc-20160816; b=UFXCjOOVeFs6N8Soi2gp6G2q8JfzKhSEIWTADmnLpaJ42D1I3SPyttMMDKFZWQSWkF XBixczmfjjqyuJ9Ay8k8q36z0CdA79MxYddElLLxhONUJqs8zb43+4Jibrw3KYOAASVU kFpH+T9z26OXJYCMQvv+U61RMySAtLaiQjoZXcREHhIRroDG66Wozo7/6qjEuxFJH6m5 5Ik9zAbY2jnqN6mxLji40J4YsFBCp0/mG//wNnr4gZnWDXbi+pTWkWvJKoOhuNFluq0Q BRtfHb6sqAc+MGxy3Xzo+2QBIQjl1E6PRkG10C4WgfqEnbYERLEfSgOv7bvNuVns8DML BbzQ== 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=t7XHLkhOTr7QGEDtlWCOy2rmljbbIqUSpih2a/vVYI4=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=UaoMpi4RWnPE8764ekTtw3ARx4KZudXhw6ydJRzRnsTqd7mBOVKyCtw6frQTN5DWLX bKEP4jPSi/zWJuInJyfJVMS5QstbFERyMbWSpwnINwN7fMY8z45fGlifeYAmt/hOArQt R/53/Xb5nzF1tYB8pCk7O/Fws9hP8P+svOFYr9mC+cWdHfNnAQAFoNNWfeEkP7fRN9Uz qK9g4kU8xcrzHoGkuRGVXfjsCCqzLbF/Gw3A+9igL0n77ujvwBGd41+ZQNmQOEJCtRG4 hp0pHMAdwcbmLJ41GvoNskRgNw+hbWUZD3CAcuiIDyrsXz8B6NGijgEmp2Wwu6xEQlCl TFlw==; 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-84324-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84324-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y16-20020a056a00181000b006e5497a3053si2097400pfa.375.2024.02.27.17.25.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:25:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84324-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-84324-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84324-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 551A4283B6A for ; Wed, 28 Feb 2024 01:25:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4444E20DCC; Wed, 28 Feb 2024 01:23:17 +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 E32ECDDD7; Wed, 28 Feb 2024 01:23:12 +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=1709083395; cv=none; b=BtPNewxsQrcFjA4E9MpH49snJQSFcRfk7fEIVZ8Oe3LTHZ0zrWfn45T8tTCvy0JoavGnfAXOAOUDGG+WlviS6wR4TcsdqpxGiL2NvF5iDX+hDwtXUuTAxcppFqUAfVH/I9Xha1R+1QM3JKLEaFl4ysd8SD5/ibj2c4Z+9YiFjSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083395; c=relaxed/simple; bh=tnwjWLmdbreP655Xgb5OPUq8EXE9EbebF4RSySrntEk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CZixu8KFCFEJ5jROMtKxwGybEQ3qVV/J6nfTDNsulaJC5WTTrEd8jczBR2lkFANVG4NtEsRSHQ8hCOFQqlMyGbmFlcMi3M9GrKhxEcnOxJTDudhW5FHoN7iGSpqEuS+z3neqJJCvd+mufmKvDtbINqlCUb43NbdjGvtYN9bI2OE= 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.235]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TkxS82TBZz4f3jsq; Wed, 28 Feb 2024 09:23:04 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 8CDA31A0572; Wed, 28 Feb 2024 09:23:09 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S3; Wed, 28 Feb 2024 09:23:09 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] fs/writeback: avoid to writeback non-expired inode in kupdate writeback Date: Wed, 28 Feb 2024 17:19:53 +0800 Message-Id: <20240228091958.288260-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZF4rJF1xuw4xXF4kJr4rGrg_yoWrCF1xpF WUGr15tr4qvFWxWrnaka429r13tay8AF47Jr1xWay2q3WjqFWUtFyUuFy2yr18Jr93WrWS qF4vvryxAr40yaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUsgyZUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792103983501681116 X-GMAIL-MSGID: 1792103983501681116 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 to dirty list instead of more io list for kupdate writeback in requeue_inode. 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 Fio result before fix (run three tests): 1360MB/s 1329MB/s 1455MB/s Fio result after fix (run three tests): 1737MB/s 1729MB/s 1789MB/s Writeback for non-expired inode is gone as expeted. Observe this with trace writeback_start and writeback_written as following: echo 1 > /sys/kernel/debug/tracing/events/writeback/writeback_start/enab echo 1 > /sys/kernel/debug/tracing/events/writeback/writeback_written/enable cat /sys/kernel/tracing/trace_pipe Signed-off-by: Kemeng Shi --- fs/fs-writeback.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 5ab1aaf805f7..4e6166e07eaf 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1561,7 +1561,8 @@ static void inode_sleep_on_writeback(struct inode *inode) * thread's back can have unexpected consequences. */ static void requeue_inode(struct inode *inode, struct bdi_writeback *wb, - struct writeback_control *wbc) + struct writeback_control *wbc, + unsigned long dirtied_before) { if (inode->i_state & I_FREEING) return; @@ -1594,7 +1595,8 @@ static void requeue_inode(struct inode *inode, struct bdi_writeback *wb, * We didn't write back all the pages. nfs_writepages() * sometimes bales out without doing anything. */ - if (wbc->nr_to_write <= 0) { + if (wbc->nr_to_write <= 0 && + !inode_dirtied_after(inode, dirtied_before)) { /* Slice used up. Queue for next turn. */ requeue_io(inode, wb); } else { @@ -1862,6 +1864,11 @@ static long writeback_sb_inodes(struct super_block *sb, unsigned long start_time = jiffies; long write_chunk; long total_wrote = 0; /* count both pages and inodes */ + unsigned long dirtied_before = jiffies; + + if (work->for_kupdate) + dirtied_before = jiffies - + msecs_to_jiffies(dirty_expire_interval * 10); while (!list_empty(&wb->b_io)) { struct inode *inode = wb_inode(wb->b_io.prev); @@ -1967,7 +1974,7 @@ static long writeback_sb_inodes(struct super_block *sb, spin_lock(&inode->i_lock); if (!(inode->i_state & I_DIRTY_ALL)) total_wrote++; - requeue_inode(inode, tmp_wb, &wbc); + requeue_inode(inode, tmp_wb, &wbc, dirtied_before); inode_sync_complete(inode); spin_unlock(&inode->i_lock); From patchwork Wed Feb 28 09:19:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071492dyb; Tue, 27 Feb 2024 17:25:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURxioMqnkjpxhjP53/i67sl9CoLVMBBUp1cZK4+7yg8CRLY2yF3V8mE6P3+jBXzPLd+kMUycsSOmaz9XhdxjPBc9+Jwg== X-Google-Smtp-Source: AGHT+IGs/l2RaiLSEiciovEK27uSqjolO3x/SaGm89ISEmLgVF29RnfzoIpwoZCvxWgXdw0T2Se+ X-Received: by 2002:a05:6808:164c:b0:3c1:a512:ad25 with SMTP id az12-20020a056808164c00b003c1a512ad25mr3541386oib.1.1709083507904; Tue, 27 Feb 2024 17:25:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083507; cv=pass; d=google.com; s=arc-20160816; b=eYMby4w3f7/tm2R9nZ0cdRdwlLFQceu0H5jYAshRnQwMcUY0k3M2U4M0AKoM/6Sls7 WyjU9BFGUyB+3D3GXIDAdOC974448CErlQkOp7ktsooa4+PDGXzDIna5V6jjk6y4YYe/ okZhIvnfnva/KrlBqj3G5MZAbr9/zHSiz3ApZXV7NseDUSY7QSFH7VOWF53Y/0/amBxn pr4Ortx+hUVCSs9ipP3LXX2xyB8qTrdQkD5lgVnl5oC5yT/pLg5gRrbvFZysna0jlyFm ryFFQKlZyyUWly73CUa9onZTPvp/bd3EgfZ2w/xEiV1NAeqhhGpaO+MPGyJSu8Ci6Ne1 rNEg== 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=mi1HwO9ZVrjm1TI2p0dtz0Yr2d+fpdKSiDBuVcb1jgk=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=IG/YgnSxB4B4zT0umKcBBCbpK1ufI031YCb6mDDxjEvcX4zp/uq8HY4xAQsAOZcmUo yl7/IxY/UmmMjuDnFtMtO5Py4P47oG+atooH7bpAhMrb42xIliD08gKfVJ4baRvCjEMb qvPGjpRjdeBrO7BUh/3oB8PaYScgmVK8HvPO+UiJjcl5qQKFtbyxOmWqhuHUnR/hUGZ1 QLSmmWmpm5YmXaBHtNrbKu27nuLV+hi+K3loYcI/YzFn2a3/WqcsrZVeyHXSu+E/vPc0 gaWOOjWgpmxUn1Q+ZBy9AC5IqC8Z8w4I3X9OdqlWbodPg8ql2dUKTwI02cIQ1h1PBSSR Yhpg==; 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-84326-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84326-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m129-20020a633f87000000b005cec8ea155bsi6375695pga.842.2024.02.27.17.25.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84326-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-84326-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84326-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 B0752282DFC for ; Wed, 28 Feb 2024 01:25:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DC4120B28; Wed, 28 Feb 2024 01: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 77E9AF9F7; Wed, 28 Feb 2024 01:23:13 +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=1709083395; cv=none; b=atP9zetar42mMKs/OhJW7DwWXW9+DaPhrVDYD+d2RSlE6lBxDmeOWmUTsCDP6b7eLmVarIWkJDnuoio63rU46+PC+pGSJJR2kU8m6DTxuGzgo3DsTIs8+0pbjb289aZhRuk7Cgo7rudUoAv7SDBdhNtBwuFceeJe1QdujJRYsZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083395; c=relaxed/simple; bh=p9MYk0CCIVQD2VoyNlRvo5eEoCALxgQBIh8yNfbihSE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gnAB72w3mhY/gH8d5Nx9DVM0URqeuOsy2/abyfCIzBLHGqSxLs+62F8/h9UlRAhvaPAYSyXjt7BzrY81qn8EdY8keRH3WLfVBqWnI3R3lTUXvvBAkelkYEtiVBzdP5ZcAYcCW2CJTZRy67ipMnEfXGGLn/thNXh/1Qp2v41ggQI= 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.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TkxS648Rqz4f3m76; Wed, 28 Feb 2024 09:23:02 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id E06021A0DEB; Wed, 28 Feb 2024 09:23:09 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S4; Wed, 28 Feb 2024 09:23:09 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] fs/writeback: bail out if there is no more inodes for IO and queued once Date: Wed, 28 Feb 2024 17:19:54 +0800 Message-Id: <20240228091958.288260-3-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S4 X-Coremail-Antispam: 1UD129KBjvJXoW7Zr1rArW7Kw4DGr13ur1xKrg_yoW8GrW7pF 45tryUtrWjv3yxurykCa42qw15Kw4DtFW7XFyxua17trn3XFWj9Fy0gw10yr48J39xuFWI vrsYyrW8Jr1Iy3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU3K9-UUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792103948332044450 X-GMAIL-MSGID: 1792103948332044450 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 4e6166e07eaf..6fa623277d75 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2076,6 +2076,7 @@ static long wb_writeback(struct bdi_writeback *wb, struct inode *inode; long progress; struct blk_plug plug; + bool queued = false; blk_start_plug(&plug); for (;;) { @@ -2118,8 +2119,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 @@ -2142,7 +2145,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 Wed Feb 28 09:19:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071376dyb; Tue, 27 Feb 2024 17:24:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4PKt7+TZvYKOvO/A+gvztMN/8m6p+7wgp4ODU5U9Y+u6DeKplASLGHLgIjv1ERPzlavoENU0Itpk0o7w1TrZEbRWBAA== X-Google-Smtp-Source: AGHT+IFgzHpQMq3xho8cfStwNh1HudayEK73L0tKaR68dMeLtI3bH7OY8nO6VuN1mzDnxZjFUSO7 X-Received: by 2002:a05:6870:d109:b0:21e:8f7c:1a83 with SMTP id e9-20020a056870d10900b0021e8f7c1a83mr11569863oac.31.1709083487503; Tue, 27 Feb 2024 17:24:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083487; cv=pass; d=google.com; s=arc-20160816; b=lWjgGx68UrbZz0vAnRswF8nMehw3Kvenhg7IvqFTeWkbmzqx68qGvFNe1gQWPlK8Ci RoovtpRZn/AGOHnENL8iX48ddL6VWNDAMaeyFuHHJXuv5q/AI1PF9OqsMcwgqACqql7J 6reuer5ULNIKGkcfbBIiizK5jGqc7a4vlfmhh9McnHcuUmLOK4KE4jcEL7Lj81sHXFyG 6A4UMF0GWDAgmOWvIrOxqYujne56KzNrtKbwFBQze/UghmGC5LT2VCoMj8M5c9SydWZw pUO1xoLabWHx/MZmRxGzh5Jm2iwAsP30K9i1CI2E9XPFjkdsMPIecBoxkvQmyF4CYm7u 9vig== 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=OuDrLH6L2sSiLy9zugmLUa/0S5vbgWyJowdzPmuZu+w=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=jlD/G7msPIEJ8lkrsni9iRTL9oFwPyzDEiDiO+0cBVl3M4iCG9ruO7e7fhyPMzg8O1 wgk+d6px8FY6ZhJDgHVZ5G9h+7m01UIVdslTWD44wrWsiERNmDXN8uB3uzH8LZtrtczf 1VadexhLm4fO4sQS2HZfnujfv2oZDaCB+dt00iwiqsj+V9hwJ8Vuyg2OE+QpN20DBuJR 9cDiGhP3XRsoiQXFUeZlHm2EtrrVR3O8RG4gk0uQqiIzf4O5jdlD7MhTwHhGcEzuZCZP qsfzldeC1FfFrdyh28VcSBAavSyKqpxdivn130tdN/VFgnUFtdBqZi+PBnWdrmJ3DOyU IdtQ==; 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-84323-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84323-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f4-20020a056a0022c400b006e5447c9b10si2634428pfj.95.2024.02.27.17.24.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:24:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84323-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-84323-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84323-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 50AEC282982 for ; Wed, 28 Feb 2024 01:24:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2E8A208C5; Wed, 28 Feb 2024 01: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 18D44E572; Wed, 28 Feb 2024 01:23:12 +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=1709083394; cv=none; b=SBBDFu3yOjBu4hrxqWeUHgxkEq8qdHXtbrBBw1WFZ5mCfoXGBxCLmi/6zkuLBz8e7nz/BX/Jt9YT7a5wuIJ1/wJIZlCbmuXsQe/n+eJf20uqRZ46hAGB7RMR4YiWlOAU6Pw00MaAgEJ+fNjmyLEbWaL52DviFKowRMZNH14h8u4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083394; c=relaxed/simple; bh=fIv7I7JSYRHanVCmYVQAWWmDR1sHd65BZ4L5pKIMp84=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hTWMxaThTgDV8vD4qL5WyWqSggpNqyOS7h74RGRQIyu5eyDNlEzhdr14w0DD/EvoM5UuSAX1pevzuXSQAg8vgvqeHM/MKSHFa1lhENA3xYGrNLpSSK9bVdeCow5HGx1NY97wQUxzdf59hfTb11rkPCohehM6PLv9O32ZilieDoM= 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.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TkxS90DT6z4f3kF9; Wed, 28 Feb 2024 09:23:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 414611A016E; Wed, 28 Feb 2024 09:23:10 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S5; Wed, 28 Feb 2024 09:23:10 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] fs/writeback: remove unused parameter wb of finish_writeback_work Date: Wed, 28 Feb 2024 17:19:55 +0800 Message-Id: <20240228091958.288260-4-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S5 X-Coremail-Antispam: 1UD129KBjvJXoW7Cw1rXFykGFyUKry3CryUWrg_yoW8GF1rpr y5Kr1DJFWjyr47KF4DuFW2vw15K3yDKry3Gr1rWa12qrn2v3W3KayIgFy8tr1UJr9xZFW3 Zr4vvrW8Jr10yr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB0b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUWwA2048vs2IY020Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK 0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4 x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l 84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU3vPSUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792103926861579248 X-GMAIL-MSGID: 1792103926861579248 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 6fa623277d75..1c3134817865 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); } @@ -2272,7 +2271,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 Wed Feb 28 09:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071754dyb; Tue, 27 Feb 2024 17:25:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmgB4x+wUUZv9wtCP9D622EcM4MnEOGtgx68NnfWs/JLNQb2rB+qTqPdK26Odfv9TjrojDzHuhtr/LwKu6cev+MeTm5w== X-Google-Smtp-Source: AGHT+IFSU7FZu/shkV8ZcUX4bg3ar1zjcfNbRThigMFGKBwmoz6kuEFXSCXPIcbP5wjEdQCMfyC4 X-Received: by 2002:a05:6359:4c26:b0:17b:c7b8:be7f with SMTP id kj38-20020a0563594c2600b0017bc7b8be7fmr3167328rwc.32.1709083551809; Tue, 27 Feb 2024 17:25:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083551; cv=pass; d=google.com; s=arc-20160816; b=pmMdGY0RHOvq4rO91J5FJgT1twK8n6esTQc41hM1K6hjh26BNrmwtt05ZwLYSfJjwo P05Sp2qxMk0b36LPRcOl5tg0eCqnfaKIE/0da0RyiMhhW6iT4HfAgpHlsG0AV1/9DoJ0 oY9/gzqHcx9LJViHribX9Pu/ohobIMI9J6/i/3QOL4FRqZxautAYd/qCaNbxoNyUHfil ohA0JSsRndJwGkjvqm1PCElY7GLIn+WSAKh+3u1M0h4dtIJPWGjIvq0cMrDzHnzTHJWI RMV96hIqy3OJEW+VAGWpkbHkU6Vx7+pFJGAB0bq0mKjWqQfWwjHzVBo+abARoauwD85I udvg== 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=FMMKc5dm7oGwPVnCfdovJL3oFncFeHb4dVX3GVkHgkM=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=CAYa6B7/fw0yp3wsU/xTwa6OVAp55ctEChdntpmFifN9PJyschniur29rtzi+1Rk9K hMz3S9I5Wr4UNKKyx9VYw0v+hQtFduC1wNMwEoLBA6zROCr4/MDsaVZ7CwUkYGj94a3E Llfw/m//kkc4FhWZdUztdadFulzoWd26mSL7enPFVjvmxwp9pF1zkFidTnI3rYYcfYRQ vcHC67PgZ/pgew/myCJb9PAeGUWntFj6siblUyrnjpRVwQdYpMd2TPXjBFNAnvkxjakb 6JX3PD1Tsrpim7bxB7g6M/r8YQP/DKevoeIUjXGyD6FPz/v0ApoFzh/Jab4V6PBYqLf+ W31A==; 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-84327-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84327-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y73-20020a638a4c000000b005d778417e50si6578562pgd.587.2024.02.27.17.25.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:25:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84327-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-84327-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84327-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 6CF952838F3 for ; Wed, 28 Feb 2024 01:25:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73A2B2135A; Wed, 28 Feb 2024 01:23:18 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [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 D4326FBED; Wed, 28 Feb 2024 01:23:13 +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=1709083395; cv=none; b=ATPrBcSJO/IskJgntrhEI86rsIddrXQ6w4b8l4dBe5oXBm8QKTJzER39bpRNcIttDzRReZz6iv1Wh0QeVOV2sLX49joR60t48j/m+AQ1YPPd3ZgEvH3bkW2gumRBj4f8VyEY/HREAsV+UmzfLg2+EBRSrTpcy0thvuGrUOeEGgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083395; c=relaxed/simple; bh=wobu9kkXF6/BimHszN+V9hX7lzwqQsw+Tts6H4/vFXE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BiJ6e1Vc76rJ/2BumVQHSej3xnSr0OJcmXAZPBjvSInfNKGAsuXPygAzcTKQW6Ky8FxCQaqqskog8wSnfTB4Txa13xxzjS9RQ/eXB3N05k9LdIsgbj2KBnsPx4Q3VPxqIiVMit/EhkBSvvlqydIe2ALOHLf91D4jXzAdEkY3rrA= 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 4TkxSC1QSLz4f3kK0; Wed, 28 Feb 2024 09:23:07 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 89F3B1A056D; Wed, 28 Feb 2024 09:23:10 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S6; Wed, 28 Feb 2024 09:23:10 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] fs/writeback: only calculate dirtied_before when b_io is empty Date: Wed, 28 Feb 2024 17:19:56 +0800 Message-Id: <20240228091958.288260-5-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S6 X-Coremail-Antispam: 1UD129KBjvJXoW7tFy3uF17Kw17ZF45XFWUJwb_yoW8GFWrpF Zxt34Skr4jva1Sgrn7A3W29r1Fgw48GF47A3yxZFyfZw13Za42ga4Dt348Kw1kJr47Xr9a vws5GFWxC340yr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB2b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJw A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUIL05UUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792103994454564880 X-GMAIL-MSGID: 1792103994454564880 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 1c3134817865..c98684e9e6ba 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2105,20 +2105,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 Wed Feb 28 09:19:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207565 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071439dyb; Tue, 27 Feb 2024 17:24:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsdaARQZlUsNAPbufi24Um31idLU48fHAesOhfgjZtSzqXgbdvdX0GrYuTXGeYlquMdSmOL9CBzBun9U7SaUUxb0qj2g== X-Google-Smtp-Source: AGHT+IE+cfur4S1PBoE+Whzyxt7xnOrfRkg7ZEuryONHpp6p8WexDCTp0X3jNw5dY5ngvlP804Uu X-Received: by 2002:a17:906:13db:b0:a42:f40e:3ac0 with SMTP id g27-20020a17090613db00b00a42f40e3ac0mr7401454ejc.6.1709083498746; Tue, 27 Feb 2024 17:24:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083498; cv=pass; d=google.com; s=arc-20160816; b=VcM8zOxzO2IJNNHH6LHqn5s2msiEwSN0lBsBTx7zclcLMlRxnn1XohYc/wuKLZjnmu zDI821A9Qlx4LZ3S3pTPtigO9oovPcg4cV0FiYxgq5A+xit2bI+NZ2GHv674FFb+aJ3C 1J7mJfD5hOcFYQgMHIIOT9Q77JtfP0Qc1xqhq2TD8KalsVDMSHt20/ettu6sa1tK2MTW wgPNa77hKh27ZKT8836ZosAlWEF0K/1rWUFxWPAh+kqOHwntggQv6hYULPLTk2NhZcUk GZjKeR1GHxkJFVkTmfx143qUBadrOjO8dalAl+nlkgJGEkHkZedEwPIfRu3t+lkqUfv0 ny1g== 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=dzH5729y+5CUwGS5P0tsG+BWCEz86cHTkwp2mdDJfRk=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=HcjpQXFvBXXUnmVncVZSzprKfjz994DDapYCp9LkUO13/rLVdf+lTUC6UfUCFzbRtB ff74CAZulx7AW5kjD4yUf3kFGeYSJ/WHEI7fZyN7VVkANsUxKADAnTWncH7U2ScAdF8q +kNu73DaQWWfM9B8WArGNAMgedzROx+yFDV7iFCbKvYR3TUCfx/QTghO/a6JepYsUv40 Nsjct/kfhSSVXbdRX8Z8ZirnaetOH0crts9htXjS7Qk3sWOXrfuRRLyW37FdzFaUw3m4 H7tr5TRjBDcZ/NmhTClbU5NZmudgCc0l5tJwvg73HJvNyixNLdQpVjjxs4KPNbhAtKi3 HxbA==; 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-84325-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84325-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d6-20020a17090648c600b00a43bf2471e1si813324ejt.604.2024.02.27.17.24.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:24:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84325-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-84325-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84325-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 5D8C81F229C3 for ; Wed, 28 Feb 2024 01:24:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D900C20B00; Wed, 28 Feb 2024 01: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 957DFFBEA; Wed, 28 Feb 2024 01:23:13 +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=1709083395; cv=none; b=YFfTV2aGjVda5esK1rfU+5FzsTVj0zTV+9jAxhIBCpuOhonJ1DAUDG2rkiGjVPU6TZJ0Ldi/jAMnTfX7It/7w9DOTDlzs5J9WaeEuSh7kNXMIt1wGuPELbygg+/mRqR5Y70H61e/9myZQLzk4iu1hO3R8OMrxqDWJIkjJ9LBOdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083395; c=relaxed/simple; bh=T+yVge9mGzkBG9/MMKYIx3R2pe6wng5e7vxmjci1zjY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AHQx0WvIj/IcQHGB8KYJCEzf9FsZnyvznc6CKNUj7eCRANggemOSCbj4b3wOLAMV/y9jqsTAspMd2sEr6vRPKAK8EzlFwYt13lbbkb5UW4iFrI2whQxlZ8ClM+wm6XFKuwbSxMPs1UZ4uscoFxQOCsF+309fyNnIXK1rV8+SbEY= 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.235]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TkxS94jBdz4f3kFH; Wed, 28 Feb 2024 09:23:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id DB3F61A0283; Wed, 28 Feb 2024 09:23:10 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S7; Wed, 28 Feb 2024 09:23:10 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] fs/writeback: correct comment of __wakeup_flusher_threads_bdi Date: Wed, 28 Feb 2024 17:19:57 +0800 Message-Id: <20240228091958.288260-6-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S7 X-Coremail-Antispam: 1UD129KBjvdXoWrZFy8Zw4kZr4xXr45ZFykAFb_yoWfZwb_XF W8tr4DCrZI9Fn8Ja4xZ3Z3tFyvg3ykCF15uF4fKF98J3WY9rn7Zr4kZFWDGr1j9ayUuFWx G3srXr4jyrZI9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbS8YFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 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: 1792103938556577772 X-GMAIL-MSGID: 1792103938556577772 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 c98684e9e6ba..7e344a4e727e 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2332,8 +2332,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 Wed Feb 28 09:19:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kemeng Shi X-Patchwork-Id: 207569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3071717dyb; Tue, 27 Feb 2024 17:25:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW6eQsX1B/sLrWO0qRnWmMi7yGDcO2dQh58+n/mnuycNmm0OloFnuHpbjrCCopwZUy6XZFk9n10HotEH6BtypHG+UBBTQ== X-Google-Smtp-Source: AGHT+IEWvpmM1MjGPQflb6U5QEB4TDZte9Q+DxDEUSwJK8GwhcjZPQ+3J5ZkBehhqDKxFXwJUcxC X-Received: by 2002:aa7:de15:0:b0:565:c814:d891 with SMTP id h21-20020aa7de15000000b00565c814d891mr6051851edv.0.1709083545366; Tue, 27 Feb 2024 17:25:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709083545; cv=pass; d=google.com; s=arc-20160816; b=OV8bZFnW9D0dAMMcgmyLDtlwf2XA/oK0qk8a3VmDTwJIJir48MJuhDZkcEmrUIHIWP dBdCfhDrKGL7GwOh2EhTBJBUo7DoLyFea1aRqbo8/fsjLyZ683ilJ2F3fyEZ5t4YJ2HQ gPi2yI/Fa4uYeYPR2SD2o3bfOYPzjIVzyw4odiouElTFgCmOuIvAAi35jU5ZEUgIGFvf nNaHoplDrlxeW5PQPNYZGANNCQLthZxfRw1y0R9gMlxBxb8nJTOfp62gZo/DitUCHjrg SaFen2v2rOVjYHbB4TYOe8cvMqdkAZfzWhCGx50rKjlKZpX2vgRNd4eMcKtd++ppwCl8 MwNQ== 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=B+M0DFfVJlhZatOa/9gltanZN1rGC6ImdzLNJ2hjdNI=; fh=y/7Wtt5UOSj/SCUlHdmMQBdr226cA96uA6lTOGta4DA=; b=vj6YQRldXAXcYUuzMuEISiFu0oYFhRF3iZ8ZjzCwkF8tbDoPGpjWztJdvK2jOuzlTD eamC/AV0lO4pYitTpf0hfxBh3U5FLiGVshF1agdOtBvAV7/EKcr+xW/U15rvkYDLZHJk LRo5XkBy5jZfl636B5ih1hxV9rGpMKn6kbrX5kOdqoI0qULyDJqgIYsh9L3gkTPvx8tq SPHEScfreDREaMewtkXQoTWRTtkILhu83qpoZ/2FDgcDy1dsDkiDdjL0BpglpB5gVsQx IplAGaH7J83fukhAhpj0aLDSvcEOiJAZKoHWw6u2ez0ZXig5vzmE8mFEGM6HfDVArIAt khkw==; 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-84328-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84328-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v9-20020a056402174900b00565d530babesi1215023edx.70.2024.02.27.17.25.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 17:25:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84328-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-84328-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84328-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 002E91F2312D for ; Wed, 28 Feb 2024 01:25:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76CFF2135B; Wed, 28 Feb 2024 01:23:18 +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 12B441170F; Wed, 28 Feb 2024 01:23:13 +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=1709083395; cv=none; b=uYOpAnveepAsoGxiyxLeBBfsSRSjc03+Hxy9fPf98vYIo+L9zQgMWBJL0oEkK6NuC/9hOHETmn/ubtDEYzUz2aqbzhwfhEr1r8Qedb0rUzJWJ/y8hG7wbmn2kGfU2yLwNi9MTiTpHD6hVyGSL/LsKgCTXQnMYRaSKGAUCYHH3NE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709083395; c=relaxed/simple; bh=70fgOT0vFPjiubuyATTULGAqEv4jfeGA/T40KZH9Jt8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=evkXuxo8zNdVDUUCzUxSUF+EKK7L0EqSpKkV2c5C43w5cwDRgRNL04aT3qQ+5VjiNRXOGj//ugD0rEiiW5abjzt6rd9YXSXMSgWpu8rRvXz2KUbdO8PO8IPPwGT4vcJSueZVbUIe/CRqGMzNctEkM7tsqYctRsP8Udu3B0e9Rkg= 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.235]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TkxSB013Rz4f3kFQ; Wed, 28 Feb 2024 09:23:05 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 39A701A0283; Wed, 28 Feb 2024 09:23:11 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP1 (Coremail) with SMTP id cCh0CgDX8gv7it5lqQx6FQ--.57137S8; Wed, 28 Feb 2024 09:23:11 +0800 (CST) From: Kemeng Shi To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tim.c.chen@linux.intel.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] fs/writeback: remove unnecessary return in writeback_inodes_sb Date: Wed, 28 Feb 2024 17:19:58 +0800 Message-Id: <20240228091958.288260-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240228091958.288260-1-shikemeng@huaweicloud.com> References: <20240228091958.288260-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: cCh0CgDX8gv7it5lqQx6FQ--.57137S8 X-Coremail-Antispam: 1UD129KBjvdXoW7Jry8Cw4UGw18KF45Kr4kJFb_yoW3WFb_XF 15JFs2yFsFqF4xA3y8ZasxtF4v9F1rCF1rJF1akas8J3WY9r97Zr4vyw4DJryv9a47ZFWD Gw1fXrW2yrZY9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbS8YFVCjjxCrM7AC8VAFwI0_Wr0E3s1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl82 xGYIkIc2x26280x7IE14v26r126s0DM28IrcIa0xkI8VCY1x0267AKxVW5JVCq3wA2ocxC 64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM2 8EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq 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: 1792103987623641450 X-GMAIL-MSGID: 1792103987623641450 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 7e344a4e727e..362a5409f92e 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2735,7 +2735,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);