Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5918081pxb; Thu, 27 Jan 2022 02:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGZMdFqvX4ztHP81p5haXH9pG7WE+bpZvCb5qwShcAMMa0jeq3UFQF5KIa5xIkYJFi6ize X-Received: by 2002:a17:907:7b85:: with SMTP id ne5mr2360222ejc.572.1643279046279; Thu, 27 Jan 2022 02:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643279046; cv=none; d=google.com; s=arc-20160816; b=BOMZuJZCblG6U1OYNy3GjzOANX+wiqcDLcotqT9FVjDlvsWfhlXPMgNupZy/4Clgt6 a3pZuKD5cZKax2zAhUSXqQMWvczfZEYwqIuCgtlXOwHDO7rSJLVH7KslMzwDntkieuN5 qktAjVHoHLCLbGBYl+EN0hnllXFM5vQpR8e+M0IaovdvlcDkpOuhzdSxHkFzh1j69b/Q WUQ9wi/kygJZEE5cm6T9W+aO0pdj/BZf/77PWrwhIfKZYY/tU1SY2eAe48LKT8BpBBzK RmA1R5+/I+4NPAWxRPfR/VTWz8XgGliB9INqQ0dsaAHzE2UY3/Lh0WjmB2DMwR6Q48f/ hHSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:dkim-signature; bh=VLryoRKmUuPESAB8QyVLfrgvCJTCmPKkdu4P/OX5YBg=; b=M4CCN04zwWXXo6D99eWfAANNe7datfecpqv8ghfUJBmiM0fe9vDcGO2d2m/baj6L3+ 4jr7LNrAn+RpGoHUXfNUNoB5V9SWEzJatJzBwpTZSzqp9ExT+MHBuuU6U58qpgFNNAaR tzOXuibmSYv2Owhe48WVKm6eTjw4TLExjTrZdLn9As+GcLLt59a9phgb/mY5tfEr0+lC JjLFSiHCNdoq79DbOUcAG2v5c7dcuhr4Ejl1s3dLjL69uiD6QJvkxFLvt0qkhtisPXAp RP7vZbSTZ2GUZKVekI2ovFGi4D1S0KUj2Bfs8Ox1oB5gbeb4NuPslraaT+gNuBMRxYPb 18dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Qti4P3ee; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si1024725ejl.52.2022.01.27.02.23.39; Thu, 27 Jan 2022 02:24:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Qti4P3ee; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbiA0CsL (ORCPT + 99 others); Wed, 26 Jan 2022 21:48:11 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:55164 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbiA0CsL (ORCPT ); Wed, 26 Jan 2022 21:48:11 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6B0A521959; Thu, 27 Jan 2022 02:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643251689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VLryoRKmUuPESAB8QyVLfrgvCJTCmPKkdu4P/OX5YBg=; b=Qti4P3eej7SwU9djhiMhUMgJ1ckOKm8O/J1pSaUAEHDRhQb1izQ4dQZrO97++mAvn3WVVr T2k2nCp5oMqLD8x4f8vee6NJClS2lg1UPexxPkHMg0zJIBN6c452+a+u50wURMgo/tIfRv rD3QIr1LCF3psUh7SWng5ZjcDzYoDdQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643251689; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VLryoRKmUuPESAB8QyVLfrgvCJTCmPKkdu4P/OX5YBg=; b=uJ63TZZVZJQxUDYCfYcbm2ZGgBe9Q6Vwcu+8BWf/uQNpUEqXNKCc6PHt7MlRhE+A1sBtn6 UgWYWcQsDNRd9WCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E9B1C13E46; Thu, 27 Jan 2022 02:47:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8ZsrKd4H8mH6KwAAMHmgww (envelope-from ); Thu, 27 Jan 2022 02:47:58 +0000 Subject: [PATCH 4/9] f2f2: replace some congestion_wait() calls with io_schedule_timeout() From: NeilBrown To: Andrew Morton , Jaegeuk Kim , Chao Yu , Jeff Layton , Ilya Dryomov , Miklos Szeredi , Trond Myklebust , Anna Schumaker , Ryusuke Konishi , "Darrick J. Wong" , Philipp Reisner , Lars Ellenberg , Paolo Valente , Jens Axboe Cc: linux-mm@kvack.org, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, ceph-devel@vger.kernel.org, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Date: Thu, 27 Jan 2022 13:46:29 +1100 Message-ID: <164325158957.29787.2116312603613564596.stgit@noble.brown> In-Reply-To: <164325106958.29787.4865219843242892726.stgit@noble.brown> References: <164325106958.29787.4865219843242892726.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org As congestion is no longer tracked, contestion_wait() is effectively equivalent to io_schedule_timeout(). It isn't clear to me what these contestion_wait() calls are waiting for, so I cannot change them to wait for some particular event. So simply change them to io_schedule_timeout(), which will have exactly the same behaviour. Signed-off-by: NeilBrown --- fs/f2fs/segment.c | 14 ++++++++------ fs/f2fs/super.c | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1dabc8244083..78e3fbc24e77 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -313,8 +313,8 @@ void f2fs_drop_inmem_pages_all(struct f2fs_sb_info *sbi, bool gc_failure) skip: iput(inode); } - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); - cond_resched(); + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(DEFAULT_IO_TIMEOUT); if (gc_failure) { if (++looped >= count) return; @@ -802,9 +802,10 @@ int f2fs_flush_device_cache(struct f2fs_sb_info *sbi) do { ret = __submit_flush_wait(sbi, FDEV(i).bdev); - if (ret) - congestion_wait(BLK_RW_ASYNC, - DEFAULT_IO_TIMEOUT); + if (ret) { + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(DEFAULT_IO_TIMEOUT); + } } while (ret && --count); if (ret) { @@ -3133,7 +3134,8 @@ static unsigned int __issue_discard_cmd_range(struct f2fs_sb_info *sbi, blk_finish_plug(&plug); mutex_unlock(&dcc->cmd_lock); trimmed += __wait_all_discard_cmd(sbi, NULL); - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(DEFAULT_IO_TIMEOUT); goto next; } skip: diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 76e6a3df9aba..ae8dcbb71596 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2135,8 +2135,8 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi) /* we should flush all the data to keep data consistency */ do { sync_inodes_sb(sbi->sb); - cond_resched(); - congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT); + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(DEFAULT_IO_TIMEOUT); } while (get_pages(sbi, F2FS_DIRTY_DATA) && retry--); if (unlikely(retry < 0)) @@ -2504,8 +2504,8 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, &page, &fsdata); if (unlikely(err)) { if (err == -ENOMEM) { - congestion_wait(BLK_RW_ASYNC, - DEFAULT_IO_TIMEOUT); + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(DEFAULT_IO_TIMEOUT); goto retry; } set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);