Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4499967pja; Thu, 21 Nov 2019 20:41:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwVJ9KLFjM18lT4DA7lOL9rvQB4EyueULIoVrBo30oQSQHJRSk3opRqIItqwu66yQDp/Q3n X-Received: by 2002:a17:906:5959:: with SMTP id g25mr18895392ejr.248.1574397666845; Thu, 21 Nov 2019 20:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574397666; cv=none; d=google.com; s=arc-20160816; b=HSDnIfUv1f9XQ4RKxNtbQH55P5etjs4QUoVvcjlCBbxJ6B2GA6zpNzr4E4lkpgIKmS XANFaA5oeUdpR121l1HjdoAd02QGT70qWQ9SfKlOboyXbK7EwRO/6lCAYq+X2syz9YP2 QCjsxDtvODzA9PsufIS5aO7QB/wShWpAKJLmlXhFPv6oddYOMImVR3cMGfDsatJeuJMV 7BY0SXpLYSymS7Q3BnKR/k0VHvaOA1ZX9z4hABUEPlg2y1A1bYEdee+ca0HXt1wFic3s 0J0rdG0baivlQl2LpWa7gOJUDToxinVoDlOAgtCKmExFgEroKrr0uSvohab5mJO2hV0G XJ0A== 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=eGSHBQja7qoAUYzMf3cEFcK/LDtr3a+1zdNJojEp37E=; b=TaCwjXOXMx0DVPbkuKegQSi+/tIBjqo+DDUiolIwTW712zUZo8qoC8w84H/GLA3+Lx H2+Ku5dtFsO67L4pTki0C13/rADvxxnal0kyeOMjxYrJzhdAH6Axf0Nbzy1yrpYLkHDP PHLKV191ilMe/OBZuUr/ReGzUKdkQlyXw0YRDZQSCMmUynyrjJT3A2equMqhkJUtXOn6 W61vRyO3sovQ7AFCXg32a4y/z66btYPYThD/ocxs7FqbGHEUJ7zp1hADQ5QSondzbU7S fYqTlWVafQPHHkhKiVZLqGXRpIdtu1RE8bIfGJUbcnT/15jlyA5QP75PiTtWhxcFu1I7 06Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="E3Nds/5q"; 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 rl7si3464790ejb.340.2019.11.21.20.40.42; Thu, 21 Nov 2019 20:41:06 -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="E3Nds/5q"; 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 S1726721AbfKVEiu (ORCPT + 99 others); Thu, 21 Nov 2019 23:38:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54924 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726529AbfKVEiu (ORCPT ); Thu, 21 Nov 2019 23:38:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574397529; 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=eGSHBQja7qoAUYzMf3cEFcK/LDtr3a+1zdNJojEp37E=; b=E3Nds/5qjcFsI7um6PHPrHZYl7ar5/9vKJ8aug1JQxa1Oi6z/Tp9umeI7fX1VK/KvxbOFh KkxN8ti6UjvSPmH6AUPeWO++JqwtANeqvhFtImtHEuIeKVffDMIK3HlcV+ANg1YqeA8z5Y QHjtS4i4KHS9V5R0LCfNeSZxng2GJT8= 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-213-K6V0ySTOOYGesCDyUuoUIw-1; Thu, 21 Nov 2019 23:38:44 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3EE2107ACC4; Fri, 22 Nov 2019 04:38:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9719028D18; Fri, 22 Nov 2019 04:38:42 +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 D29F64BB5C; Fri, 22 Nov 2019 04:38:41 +0000 (UTC) Date: Thu, 21 Nov 2019 23:38:41 -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: <560894997.35969622.1574397521533.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20191120092831.6198-1-pagupta@redhat.com> <1617854972.35808055.1574323227395.JavaMail.zimbra@redhat.com> Subject: Re: [PATCH] virtio pmem: fix async flush ordering MIME-Version: 1.0 X-Originating-IP: [10.67.116.36, 10.4.195.13] Thread-Topic: virtio pmem: fix async flush ordering Thread-Index: LSm9oNBEmc1YyqOBo3tZ7gh0w041hg== X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: K6V0ySTOOYGesCDyUuoUIw-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 w= hich > > > > > > causes child bio to get executed after parent bio > > > > > > 'pmem_make_request' > > > > > > completes. This resulted in wrong ordering of REQ_PREFLUSH wit= h > > > > > > the > > > > > > data write request. > > > > > > > > > > > > Instead we are performing flush from the parent bio to maintai= n > > > > > > the > > > > > > correct order. Also, returning from function 'pmem_make_reques= t' > > > > > > 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_flus= h > > > > > were > > > > > converted to -EIO. Now, they are reported as-is. I think this i= s > > > > > 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 fac= t > > > > that now the guest will synchronously wait for flushing to occur. T= he > > > > 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. Do= es > > > > 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? > > > > > > Why not just swap the parent child relationship in the PREFLUSH case? > > > > I we are already inside parent bio "make_request" function and we creat= e > > child > > bio. How we exactly will swap the parent/child relationship for PREFLUS= H > > case? > > > > Child bio is queued after parent bio completes. >=20 > Sorry, I didn't quite mean with bio_split, but issuing another request > in front of the real bio. See md_flush_request() for inspiration. o.k. Thank you. Will try to post patch today to be considered for 5.4. Best regards, Pankaj >=20 >=20