Received: by 10.192.165.148 with SMTP id m20csp796629imm; Wed, 25 Apr 2018 07:50:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48l/maxmEVPrFe9t9gqPAHPmTzRRfxG4pxl/lluFsEc8lKy2pLV+qC5IkkK8aJHu05VbJX9 X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr29967139plk.32.1524667803064; Wed, 25 Apr 2018 07:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524667803; cv=none; d=google.com; s=arc-20160816; b=vEbP6ZVUKsxqvJ0Kbbk8b9f9Pb5ogkojc7CxVlkiYMWP2Zun8RzTWx0yz5RadGWhhl CA6qGPhQ1OJKRR0JCRWwJQqLWw+EooKCTXjH/XtWcFeAcW0hkwu87RXMwuy+KubJNsh9 p62m+ovJio8ugYSA5+ydHjp63KhcGQa9ke47N01ryA5uuY3PuyIBrVUpF+sjqaDyRF54 2KonvV5Jz5456djN9ToE4FoOyj3oSG5fkBkzteysVwaL7yYoCODOUzq8x6OqwT+hbUnM ub3d6k73CMQtfX4Gq4myIaq4+unHG9Lbs2zS2eCoAN92TQagUK5GO3MtGQ92giorv0RP 629A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:arc-authentication-results; bh=2rmDArhuUGXMZknhDVcodOtIdD8cRJ1tk8pQjfbkSLU=; b=aWh+ak4Sxhl8wPtSnQN9EZmKWhq2vnDXDpoqT12n0c01Rij7Cp050/le/NSs/ullyP dqZZFwAbcSKVyUDeAT4zNvbddIABtTKz8aOH22bq30JUSbiRL5gSwwFPybYvio7LEUzV 1xWPJVqX4TE2gzmDRhTQX9XMojIXXeLQ5HPyM974rO+CVzM6OkZhKgnL+I8DH8McEuul GOhSzQdCHwHrLldQiD15uH4Ve3lQ2sYbsrl7V2fR0CXgOwRDcFsGt4oDp7Hx6fVuXZdr aALVJ1tlwonNaGEw8HJ9L7CEkLT3rKSSNJGCDXG0Cycz5EUIRLc/tzKzhLA9ewMqx8Ae 20Dw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 h67si11800792pfk.15.2018.04.25.07.49.48; Wed, 25 Apr 2018 07:50:03 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754797AbeDYOsB (ORCPT + 99 others); Wed, 25 Apr 2018 10:48:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3635 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbeDYOr6 (ORCPT ); Wed, 25 Apr 2018 10:47:58 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A5C25C047B94; Wed, 25 Apr 2018 14:47:57 +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 801E43142179; Wed, 25 Apr 2018 14:47:57 +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 D5B2718033EB; Wed, 25 Apr 2018 14:47:56 +0000 (UTC) Date: Wed, 25 Apr 2018 10:47:56 -0400 (EDT) From: Pankaj Gupta To: Dan Williams Cc: Linux Kernel Mailing List , KVM list , Qemu Developers , linux-nvdimm , Linux MM , Jan Kara , Stefan Hajnoczi , Rik van Riel , Haozhong Zhang , Nitesh Narayan Lal , Kevin Wolf , Paolo Bonzini , Ross Zwisler , David Hildenbrand , Xiao Guangrong , Christoph Hellwig , Marcel Apfelbaum , "Michael S. Tsirkin" , niteshnarayanlal@hotmail.com, Igor Mammedov , lcapitulino@redhat.com Message-ID: <458087373.22645020.1524667676533.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20180425112415.12327-1-pagupta@redhat.com> <20180425112415.12327-3-pagupta@redhat.com> Subject: Re: [RFC v2 2/2] pmem: device flush over VIRTIO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.116.111, 10.4.195.23] Thread-Topic: pmem: device flush over VIRTIO Thread-Index: RGAJX2p9n07JgwlroFp9vISyZdXRBQ== X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 25 Apr 2018 14:47:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > On Wed, Apr 25, 2018 at 4:24 AM, Pankaj Gupta wrote: > > This patch adds functionality to perform > > flush from guest to hosy over VIRTIO > > when 'ND_REGION_VIRTIO'flag is set on > > nd_negion. Flag is set by 'virtio-pmem' > > driver. > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/nvdimm/region_devs.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c > > index a612be6..6c6454e 100644 > > --- a/drivers/nvdimm/region_devs.c > > +++ b/drivers/nvdimm/region_devs.c > > @@ -20,6 +20,7 @@ > > #include > > #include "nd-core.h" > > #include "nd.h" > > +#include > > > > /* > > * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is > > @@ -1074,6 +1075,12 @@ void nvdimm_flush(struct nd_region *nd_region) > > struct nd_region_data *ndrd = dev_get_drvdata(&nd_region->dev); > > int i, idx; > > > > + /* call PV device flush */ > > + if (test_bit(ND_REGION_VIRTIO, &nd_region->flags)) { > > + virtio_pmem_flush(&nd_region->dev); > > + return; > > + } > > + > > I'd rather introduce a ->flush() operation hanging off of 'struct > nd_region' so that this multiplexing can be a static setting. Sure! will make the change. Thanks, Pankaj