From mboxrd@z Thu Jan 1 00:00:00 1970 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 EBD86C433F5 for ; Mon, 18 Apr 2022 08:19:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3667D8D0008; Mon, 18 Apr 2022 04:19:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 315B78D0007; Mon, 18 Apr 2022 04:19:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DDAA8D0008; Mon, 18 Apr 2022 04:19:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 0C39D8D0007 for ; Mon, 18 Apr 2022 04:19:38 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AF0B18249980 for ; Mon, 18 Apr 2022 08:19:37 +0000 (UTC) X-FDA: 79369300794.30.D2E5826 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf13.hostedemail.com (Postfix) with ESMTP id D3F5320009 for ; Mon, 18 Apr 2022 08:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650269976; h=from:from:reply-to:subject:subject: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=CbSlwIMBsmUQ2btaZklk9txorHfyUp9hbUvmVQpF0EI=; b=O4v7jWGJ5ldxRDxMTR31LtkE3Fxy6qk8JbIfudoyNJvSkBy1hSm8uHIjwvrgqlP+HpbmbZ BumK5VHC2nF9iP4VUGskpeS61AIZCxVeyJLJPaJ+YdHWlJXVEoTlhlxPkGGAbBQQ/ZtrUQ 3J46ldf3U5G2/G7crrFfY40dvBCVvqM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-UmfjE_gIMMiENiNezl8JNw-1; Mon, 18 Apr 2022 04:19:27 -0400 X-MC-Unique: UmfjE_gIMMiENiNezl8JNw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C1B8C1C05AA6; Mon, 18 Apr 2022 08:19:26 +0000 (UTC) Received: from T590 (ovpn-8-28.pek2.redhat.com [10.72.8.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FC417C28; Mon, 18 Apr 2022 08:19:14 +0000 (UTC) Date: Mon, 18 Apr 2022 16:19:09 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, Changhui Zhong Subject: Re: [PATCH V2] block: avoid io timeout in case of sync polled dio Message-ID: References: <20220415034703.2081695-1-ming.lei@redhat.com> <20220415051844.GA22762@lst.de> <20220416054913.GA7405@lst.de> <20220418051234.GA3559@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220418051234.GA3559@lst.de> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Rspam-User: X-Rspamd-Queue-Id: D3F5320009 X-Stat-Signature: gmppdnng9krnrshnscxnqdp5r547i78j Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=O4v7jWGJ; spf=none (imf13.hostedemail.com: domain of ming.lei@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam01 X-HE-Tag: 1650269976-337023 Content-Transfer-Encoding: quoted-printable 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: On Mon, Apr 18, 2022 at 07:12:34AM +0200, Christoph Hellwig wrote: > On Sat, Apr 16, 2022 at 05:03:35PM +0800, Ming Lei wrote: > > > Yes. But not doing this automatically also means you keep easily > > > forgetting callsites. For example iomap still does not flush the p= lug > > > in your patch. > >=20 > > It is reasonable for flush user(usually submission) to be responsible > > for finishing/flushing plug. >=20 > Well, I very much disagree here. blk_flush_plug is not a publ=D1=96c, > exported API, and that is for a reason. A bio submission interface > that requires flushing the plug to be useful is rather broken. But there isn't any such users from module now. Maybe never, since sync polled dio becomes legacy after io_uring is invented. Do we have such potential use case in which explicit flush plug is needed except for polled io in __blkdev_direct_IO_simple() and swap_readp= age()? If there is, I am happy to add one flag for bypassing plug in blk core code. >=20 > > iomap is one good example to show this point, since it does flush the= plug > > before call bio_poll(), see __iomap_dio_rw(). >=20 > iomap does not do a manual plug flush anywhere. >=20 > iomap does finish the plug before polling, which makes sense. >=20 > Now of course __blkdev_direct_IO_simple doesn't even use a plug > to start with, so I'm wondering what plug this patch even tries > to flush? =20 At least blkdev_write_iter(), and __swap_writepage() might call into ->direct_IO with one plug too. Not mention loop driver can call into ->direct_IO directly, and we should have applied plug for batching submission in loop_process_work(). Thanks, Ming