From patchwork Thu Jan 20 02:09:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12718210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A3D8C433FE for ; Thu, 20 Jan 2022 02:09:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E24D06B00C3; Wed, 19 Jan 2022 21:09:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DD6A86B00C4; Wed, 19 Jan 2022 21:09:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC4F36B00C5; Wed, 19 Jan 2022 21:09:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id B9C6F6B00C3 for ; Wed, 19 Jan 2022 21:09:53 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7BBD3181CA331 for ; Thu, 20 Jan 2022 02:09:53 +0000 (UTC) X-FDA: 79049034666.17.4A0DD1B Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf14.hostedemail.com (Postfix) with ESMTP id 1DD7A10001B for ; Thu, 20 Jan 2022 02:09:52 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 15A81B81CA0; Thu, 20 Jan 2022 02:09:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4604C004E1; Thu, 20 Jan 2022 02:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642644590; bh=OGoH40tmNboM4Q9w0ReRvZcrS1vzgLhJ/ARQ2rU3RiQ=; h=Date:From:To:Subject:In-Reply-To:From; b=hB9FXAkhau7OUL3gdFK2dI0aMam+Uil/3HSX538YXog9+toHKMg+50Pb8JqW0jzZf oCVz1fcFjqLs0oeFFEOf3LgqJCuIOVrooZo+plMmK84S1CMWhq1Ns9IrpDt6xBLVhD F2ZdDjQTQBFTfEOA6xMIb07643/ConlaaPHlc1fc= Date: Wed, 19 Jan 2022 18:09:50 -0800 From: Andrew Morton To: akpm@linux-foundation.org, hirofumi@mail.parknet.co.jp, linux-mm@kvack.org, mm-commits@vger.kernel.org, neilb@suse.de, torvalds@linux-foundation.org Subject: [patch 40/55] FAT: use io_schedule_timeout() instead of congestion_wait() Message-ID: <20220120020950.xuF6ThKFO%akpm@linux-foundation.org> In-Reply-To: <20220119180714.9e187ce100e4510de3cd9f7d@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1DD7A10001B X-Stat-Signature: yisfcfqs1qiikirzbccrwnj9uuuxxpeh Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=hB9FXAkh; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1642644592-307169 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "NeilBrown" Subject: FAT: use io_schedule_timeout() instead of congestion_wait() congestion_wait() in this context is just a sleep - block devices do not support congestion signalling any more. The goal for this wait, which was introduced in Commit ae78bf9c4f5f ("[PATCH] add -o flush for fat") is to wait for any recently written data to get to storage. We currently have no direct mechanism to do this, so a simple wait that behaves identically to the current congestion_wait() is the best we can do. This is a step towards removing congestion_wait() Link: https://lkml.kernel.org/r/163936544519.22433.13400436295732112065@noble.neil.brown.name Signed-off-by: NeilBrown Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton --- fs/fat/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/fat/file.c~fat-use-io_schedule_timeout-instead-of-congestion_wait +++ a/fs/fat/file.c @@ -175,9 +175,10 @@ long fat_generic_ioctl(struct file *filp static int fat_file_release(struct inode *inode, struct file *filp) { if ((filp->f_mode & FMODE_WRITE) && - MSDOS_SB(inode->i_sb)->options.flush) { + MSDOS_SB(inode->i_sb)->options.flush) { fat_flush_inodes(inode->i_sb, inode, NULL); - congestion_wait(BLK_RW_ASYNC, HZ/10); + set_current_state(TASK_UNINTERRUPTIBLE); + io_schedule_timeout(HZ/10); } return 0; }