Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2919628ybc; Thu, 21 Nov 2019 00:01:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxCsrzx7DxrG4cjf2VLW4hGwjd/XC2mcHw8j3CGZajFtI4EU2lLZ3X9LH+DcmD07mSB13s8 X-Received: by 2002:a17:906:459:: with SMTP id e25mr11718729eja.259.1574323318529; Thu, 21 Nov 2019 00:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574323318; cv=none; d=google.com; s=arc-20160816; b=sru3YqiEHKLOAvQtmBneT64J2kGqoBBL/8I/rn6SQuCFXmQpDZZXYTRPe+otq+YLBt qSR5TXlZBaA5wiqZN2oRpJTneKXeP72eVVjgUlAoPtN9u/HiYm4rkOK1gwMCH746MRXt CZ1pUUxBj/KL0xOioaulPeKFZnHpqvdvyskSDsyitYJXnlu78burZm+1vkirDpGMk30z 6WpFxW7fcgFp/9xPCR192jP8kaoHq/mwRopzxB9Oo8zdIcsetuQdsNq0mTXLOun3AI4/ 6D3y+nqkb5fBEOMcCbk2MrZ/axYOw7y3+upFw2+raitYoEC229qabf+mIP1qh94ETG0N 6akQ== 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:thread-index :thread-topic:mime-version:subject:references:in-reply-to:message-id :cc:to:from:date:dkim-signature; bh=BTQFAcYNqFBxu18ZqL1l7wDUq1TFcKVDobQ6ovOgA/g=; b=v1nBHr7QAn09TzrtJINHU1RjSvxPaTEXwQ3rRsXv8CQYUpep1L1ngebLCYtrUMcAnA 7vYzpL721+xrS0lX3SXIa1knLKFfxvsI9Lu6yLPCuwwF3/b17enL4E1d9NFVkIiUUqkL zFFT2dnUe5Ll/Gl/dx5YWST8nye5cLlfkSFHhZsGGafFt/L01+H+6FalrxgOyBPvGhIF tbUvTJFSbOZWGFTCy71EDHjXor8JlUUlgB5A/mCO8SUdIVLNND4nOxdQs4oxcZf05Wiz mox/P2dd2yDSDZw9h537pcQFNg5e84nbFPne5Ev+fjGeUNCL1HeMtNdSF/K5RojPpmPL 44jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aoIaUXgl; 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 ov16si1192513ejb.274.2019.11.21.00.01.33; Thu, 21 Nov 2019 00:01:58 -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=aoIaUXgl; 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 S1726522AbfKUIAf (ORCPT + 99 others); Thu, 21 Nov 2019 03:00:35 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:42362 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725842AbfKUIAe (ORCPT ); Thu, 21 Nov 2019 03:00:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574323233; 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=BTQFAcYNqFBxu18ZqL1l7wDUq1TFcKVDobQ6ovOgA/g=; b=aoIaUXglZCMDMs/YcLbGuZgBcb1p0spJiDDpRKugF+dJR/mvPC+RYGnLS5Xz/YhHWoPtFT qVt6+EDxqpl55sxEPOy4yEdFipQJOCP9KrykS2kL10vUUawumVLR++mk7Hf1iO0J5onyo1 3p/3tn7V4tiWRZILWoQgPH8G4s44Hyk= 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-247-HvnOAqsgPY2_30n_0UNCFA-1; Thu, 21 Nov 2019 03:00:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EADBD107ACC9; Thu, 21 Nov 2019 08:00:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE9EC5D6D2; Thu, 21 Nov 2019 08:00:27 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A18E218089C8; Thu, 21 Nov 2019 08:00:27 +0000 (UTC) Date: Thu, 21 Nov 2019 03:00:27 -0500 (EST) From: Pankaj Gupta To: Dan Williams Cc: Jeff Moyer , linux-nvdimm , Linux Kernel Mailing List , Linux ACPI , Vishal L Verma , Dave Jiang , Ira Weiny , "Rafael J. Wysocki" , Len Brown , Vivek Goyal , Keith Busch Message-ID: <1617854972.35808055.1574323227395.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20191120092831.6198-1-pagupta@redhat.com> Subject: Re: [PATCH] virtio pmem: fix async flush ordering MIME-Version: 1.0 X-Originating-IP: [10.67.116.169, 10.4.195.1] Thread-Topic: virtio pmem: fix async flush ordering Thread-Index: 7Sg2VvKEGXDulgOI6hZ7i2wjSlDdeQ== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: HvnOAqsgPY2_30n_0UNCFA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > > > Remove logic to create child bio in the async flush function which > > > > causes child bio to get executed after parent bio 'pmem_make_reque= st' > > > > completes. This resulted in wrong ordering of REQ_PREFLUSH with th= e > > > > data write request. > > > > > > > > Instead we are performing flush from the parent bio to maintain th= e > > > > correct order. Also, returning from function 'pmem_make_request' i= f > > > > 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 we= re > > > 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 corruptio= n, > > > 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? If not I > > think a synchronous wait is going to be a significant performance > > regression. Are there any numbers to accompany this change? >=20 > Why not just swap the parent child relationship in the PREFLUSH case? I we are already inside parent bio "make_request" function and we create ch= ild bio. How we exactly will swap the parent/child relationship for PREFLUSH ca= se? Child bio is queued after parent bio completes. Thanks, Pankaj =20 >=20 >=20