Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1889735pxb; Sun, 17 Apr 2022 02:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9hdi3dySlkSAn6TlpdzBhynNohY1w3JAXbFbJ1MmAGdcsbU1xsbji8JQgqpAHZPAviLmM X-Received: by 2002:a17:907:3e1d:b0:6d7:1031:7e0 with SMTP id hp29-20020a1709073e1d00b006d7103107e0mr5113413ejc.580.1650187706713; Sun, 17 Apr 2022 02:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650187706; cv=none; d=google.com; s=arc-20160816; b=AwDGQhUegYiHF3L8GZUF6r9FzMmbHAOhb982qyl0N69sHYNBzc3byz+ReuGzLRZxw+ SIhpuExSOpB4sY3McEgjF6Ug0mYah1k++wWLQKEi6dYJc5u5gmaksuXL/+UFv0/hXqoT OTtBzJopmBn2qEpp7ykhb8HfHKaocry8Ko77tOxzulzkNXU9hedcDsbBT8ZmIeQzP2fG nMIg+c/r7ZBDLrwE9gRlKpTnEp3tI+mqGUnbZ8Yyb5/3LQQhK+1XI/Y4mUMwcy+NdOcR yy+LH25dypsB9TG7urkQOVeA0KH1k7U5HOlX8WGvu6bkCA/fZRksnvCj8p98IUNrq4WX dIyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-filter; bh=31MK01da//PmDIUg+teCmL/tGV8rQMjTAZsF8oKMOT4=; b=L/iXkD4oyvsDu7wyySXGLnwPKEP3eFuchH0n3EPg24XTLNgiYJukjMoEE1Zy6l8+6/ dHhPrPvFWK6YZWRWVW4GAVLP6Bx/2dVZQcX2sZGmEzijkvdEO+v2waxE7RW6AcVH007g 5J7cfoG5HMvg0GdVDuRIIb6HcLXaZC182PnDUOv8pUnQn8s3UhadjB3o2zLyz4/5tuU+ Om20/aPZSMorPVnqAUaMT+qVEtWLQvlPhNSZuEJ9IlcPRqqQS9MaIBcTcH3+6OjeJhv1 RVRWnW8P+UXCIbCdH5gr+s4A4sDRvz7C4h8hMj7rNkZoXVQCmEHP39i3feL1zpAo+Zo1 XRNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd20-20020a170906ce3400b006df76385cfasi3818670ejb.410.2022.04.17.02.27.46; Sun, 17 Apr 2022 02:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232439AbiDPUQe (ORCPT + 99 others); Sat, 16 Apr 2022 16:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232069AbiDPUQe (ORCPT ); Sat, 16 Apr 2022 16:16:34 -0400 X-Greylist: delayed 514 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 16 Apr 2022 13:14:01 PDT Received: from mx.ewheeler.net (mx.ewheeler.net [173.205.220.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B934136322 for ; Sat, 16 Apr 2022 13:14:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mx.ewheeler.net (Postfix) with ESMTP id BF98481; Sat, 16 Apr 2022 13:05:26 -0700 (PDT) X-Virus-Scanned: amavisd-new at ewheeler.net Received: from mx.ewheeler.net ([127.0.0.1]) by localhost (mx.ewheeler.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jJdcDIU-romd; Sat, 16 Apr 2022 13:05:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.ewheeler.net (Postfix) with ESMTPSA id C76C440; Sat, 16 Apr 2022 13:05:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mx.ewheeler.net C76C440 Date: Sat, 16 Apr 2022 13:05:23 -0700 (PDT) From: Eric Wheeler To: Christoph Hellwig cc: Ming Lei , linux-block@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: loop: it looks like REQ_OP_FLUSH could return before IO completion. In-Reply-To: Message-ID: <2815ce9-85f-7b56-be3f-7835eb9bb2c6@ewheeler.net> References: <5b3cb173-484e-db3-8224-911a324de7dd@ewheeler.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, 15 Apr 2022, Christoph Hellwig wrote: > On Fri, Apr 15, 2022 at 10:29:34PM +0800, Ming Lei wrote: > > If ext4 expects the following order, it is ext4's responsibility to > > maintain the order, and block layer may re-order all these IOs at will, > > so do not expect IOs are issued to device in submission order > > Yes, and it has been so since REQ_FLUSH (which later became > REQ_OP_FLUSH) replaced REQ_BARRIER 12 years ago: > > commit 28e7d1845216538303bb95d679d8fd4de50e2f1a > Author: Tejun Heo > Date: Fri Sep 3 11:56:16 2010 +0200 > > block: drop barrier ordering by queue draining > > Filesystems will take all the responsibilities for ordering requests > around commit writes and will only indicate how the commit writes > themselves should be handled by block layers. This patch drops > barrier ordering by queue draining from block layer. Thanks Christoph. I think this answers my original question, too. You may have already answered this implicitly above. If you would be so kind as to confirm my or correct my understanding with a few more questions: 1. Is the only way for a filesystem to know if one IO completed before a second IO to track the first IO's completion and submit the second IO when the first IO's completes (eg a journal commit followed by the subsequent metadata update)? If not, then what block-layer mechanism should be used? 2. Are there any IO ordering flags or mechanisms in the block layer at this point---or---is it simply that all IOs entering the block layer can always be re-ordered before reaching the media? Thanks! -- Eric Wheeler