Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp479406ybc; Fri, 22 Nov 2019 08:11:05 -0800 (PST) X-Google-Smtp-Source: APXvYqz0fzBc+/N+IU4OQleGGgMpj4ZNw5Y+bqv7pg6m0d3VUDInKw75Livo/91Gy27/5+ccSSZc X-Received: by 2002:a50:ec89:: with SMTP id e9mr2029346edr.104.1574439064992; Fri, 22 Nov 2019 08:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574439064; cv=none; d=google.com; s=arc-20160816; b=KsCW87hRa2ExpwMA1DpFxjDXJvBOxsyFEiV9yB1bp8jfiULNO2O7Lb3jKG8BQP1NHW F7JWVvmae5jsANKnbfrylDe2Nj8VV6nrgUSDwwHbF0b3xqbPlq+nlobSZcTkDpMvuWYd fdDtLiwTQtoKWJGHKDOZ4W3mRJuuiISMy5FkwG3R//Yye/iWzk5d7G1sAougvcG0UC/d 5rfYELisR34yJydypRUU44Lz52M+OeMSdWlYGrdVP4Ly+fwFGkqyAvtD1jghLCES6pAY xjslrUndPAIcNysBYrcBr9zjJQvG5Nq3Jkr6aUMBcD/ZlDXRmOt/idAlX/QLHtmvT8rr 2H1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=aChokPuSf/E1/myJnN2scacEgSwoRMHnNtyJ+8WYM+U=; b=ggs+r8bUqNZyL/SgPXEbS9lT52EWrmtR5RO4cdeXQXZ9XMNVsPdDUo+xw3Hsz6i+TG D+kYaW0JbIyeO0GvMwe1rN6IuFc2hBhFD2i1zrDx1EG5WHlRRWB0FDZt7FRSyyBZe9cX VyeumjF6uy9NzZ7UWk1PsECBVhYVqXi6YGK4m2r8P4j5NCvQHFLvQ9eI0vtLUe0YBWZ/ 863qjoeDk4Wqzgd9e7JLUxMTr2F5RjMNSAHOY8ZwLyxT6HuqI0M7pt55tkHeTWLbsBf0 PXHRecoP22QLBQePSNFy5t31baeSRRf2EzANqOcd+SIXijT/XykCjldLCfzK1IwXRS6+ fOZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPcd75AM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z35si5294412edz.260.2019.11.22.08.10.40; Fri, 22 Nov 2019 08:11:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPcd75AM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfKVQIz (ORCPT + 99 others); Fri, 22 Nov 2019 11:08:55 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57816 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726546AbfKVQIz (ORCPT ); Fri, 22 Nov 2019 11:08:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574438934; 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=aChokPuSf/E1/myJnN2scacEgSwoRMHnNtyJ+8WYM+U=; b=PPcd75AMJjannlJf7Bcq4CKSt/4O0/Tio3udOIxTQ9TFlE5W3pLXAr+xqKuB0seprqMJwj CF9BuiN+LlAnYkJSrI50Hgghrg+7BICQbagYV5/AmdqX2CYsJFcQz2FSQi2GY3XQVmO7x8 AOI/ISOeTVfVZ4D5r1lBEg/jV9wumvc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-paFjoYLyMj6EbrgB8Ql3JA-1; Fri, 22 Nov 2019 11:08:51 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 889F01005510; Fri, 22 Nov 2019 16:08:49 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B08A8516; Fri, 22 Nov 2019 16:08:48 +0000 (UTC) From: Jeff Moyer To: Dan Williams Cc: Pankaj Gupta , linux-nvdimm , Linux Kernel Mailing List , Linux ACPI , Vishal L Verma , Dave Jiang , "Weiny\, Ira" , "Rafael J. Wysocki" , Len Brown , Vivek Goyal , Keith Busch Subject: Re: [PATCH] virtio pmem: fix async flush ordering References: <20191120092831.6198-1-pagupta@redhat.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Fri, 22 Nov 2019 11:08:46 -0500 In-Reply-To: (Dan Williams's message of "Wed, 20 Nov 2019 23:23:46 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: paFjoYLyMj6EbrgB8Ql3JA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > On Wed, Nov 20, 2019 at 9:26 AM Jeff Moyer wrote: >> >> Pankaj Gupta writes: >> >> > Remove logic to create child bio in the async flush function which >> > causes child bio to get executed after parent bio 'pmem_make_request' >> > completes. This resulted in wrong ordering of REQ_PREFLUSH with the >> > data write request. >> > >> > Instead we are performing flush from the parent bio to maintain the >> > correct order. Also, returning from function 'pmem_make_request' if >> > REQ_PREFLUSH returns an error. >> > >> > Reported-by: Jeff Moyer >> > Signed-off-by: Pankaj Gupta >> >> There's a slight change in behavior for the error path in the >> virtio_pmem driver. Previously, all errors from virtio_pmem_flush were >> converted to -EIO. Now, they are reported as-is. I think this is >> actually an improvement. >> >> I'll also note that the current behavior can result in data corruption, >> so this should be tagged for stable. > > I added that and was about to push this out, but what about the fact > that now the guest will synchronously wait for flushing to occur. The > goal of the child bio was to allow that to be an I/O wait with > overlapping I/O, or at least not blocking the submission thread. Does > the block layer synchronously wait for PREFLUSH requests? You *have* to wait for the preflush to complete before issuing the data write. See the "Explicit cache flushes" section in Documentation/block/writeback_cache_control.rst. -Jeff