Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp191365imm; Tue, 18 Sep 2018 19:44:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ5aIsMoN+3w1AogvrO3mw07eSB3IgQSlDMNB6tltwrnmwNtLsHw3l87qYc8YRh3VTTY17k X-Received: by 2002:a63:f657:: with SMTP id u23-v6mr28247630pgj.258.1537325088322; Tue, 18 Sep 2018 19:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537325088; cv=none; d=google.com; s=arc-20160816; b=R0ndulRIY73ffHD88TM5m5/ZTaz+AOLuu4t53P38OwIl5okQVTP/nmdGcfvxH6TehZ Bhdo1FGiZf3VcxBLMQb9VUt/kx1cvenDVl/V6+A+652epKtwHyREcVS/oiU5gSqWo6og wSWQe/SA1u7QJ7cCukcpr1P30wlgL7SmBrd+OOzNvwjtE1+Tdwog+QXbamsxNj2XQcnD jvOlMiA9ObM2hIOERXhA7JdyHr4+7QmPd9ZsaXQV8gh2HI1vkqpN8Oj69GWQUTbsxPQ6 MNqz8jeN7M/0c99stZbd0H/8TZrMgAV3aKESll6G7dfK1wYJeSQIHJbJdtz147Egzjqr KAdQ== 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; bh=3owSXmnVF5Ri8Ok/m/3YeC/N/tuew9hfqQmITNZYGpE=; b=L6rBz+kWNyL/mnCGwW1/+cRfRFs+z2s4Ty1cqVU8MJc3PdvfPHNsVHIq7FFcmY/Tpl KV/t0dxPqj3FXGEJrPmI9TDP1euJ8/iqpybknZaYUGd9JmOGrCLaRrv+pkQYEuLQJfJU g/zLtQYxHsiZF5vfSVxYl8H5usuFutICxZ9hYP72Vw24be0Tkinmq9oypaY7hpQyTElU J4F0mIMSetTtp6ze8sDpDHxNp/AJOh4bvHVbbCiLLuTAfIn2KfowQ9/xgWONCiCmOyEn +DPSP/xiv9f2sHDjvnEOYW0KB8vi7rACKGBvw7/ffXKOLKjq9ICOGXBFdfS8p/QeHeeV W7kg== 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 h3-v6si2845064plh.469.2018.09.18.19.44.32; Tue, 18 Sep 2018 19:44:48 -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 S1728249AbeISITK (ORCPT + 99 others); Wed, 19 Sep 2018 04:19:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbeISITK (ORCPT ); Wed, 19 Sep 2018 04:19:10 -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 07DC892E1B; Wed, 19 Sep 2018 02:43:32 +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 E5E2C308BDA0; Wed, 19 Sep 2018 02:43:31 +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 CCE854BB74; Wed, 19 Sep 2018 02:43:31 +0000 (UTC) Date: Tue, 18 Sep 2018 22:43:31 -0400 (EDT) From: Pankaj Gupta To: Zhang Yi Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, pbonzini@redhat.com, dan j williams , dave jiang , yu c zhang , david@redhat.com, jack@suse.cz, hch@lst.de, linux-mm@kvack.org, rkrcmar@redhat.com, jglisse@redhat.com, yi z zhang Message-ID: <1394508970.13987303.1537325011734.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: [PATCH V4 2/4] mm: introduce memory type MEMORY_DEVICE_DEV_DAX MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.116.79, 10.4.195.12] Thread-Topic: introduce memory type MEMORY_DEVICE_DEV_DAX Thread-Index: OFqm6aQlhMGxhCDm/axIixZAe4oqXg== 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.39]); Wed, 19 Sep 2018 02:43:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Currently, NVDIMM pages will be marked 'PageReserved'. However, unlike > other reserved PFNs, pages on NVDIMM shall still behave like normal ones > in many cases, i.e. when used as backend memory of KVM guest. This patch > introduces a new memory type, MEMORY_DEVICE_DEV_DAX. And set this flag > while dax driver hotplug the device memory. > > Signed-off-by: Zhang Yi > Signed-off-by: Zhang Yu > Reviewed-by: Jan Kara suse.cz> > --- > drivers/dax/pmem.c | 1 + > include/linux/memremap.h | 8 ++++++++ > 2 files changed, 9 insertions(+) > > diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c > index fd49b24..fb3f363 100644 > --- a/drivers/dax/pmem.c > +++ b/drivers/dax/pmem.c > @@ -111,6 +111,7 @@ static int dax_pmem_probe(struct device *dev) > return rc; > > dax_pmem->pgmap.ref = &dax_pmem->ref; > + dax_pmem->pgmap.type = MEMORY_DEVICE_DEV_DAX; > addr = devm_memremap_pages(dev, &dax_pmem->pgmap); > if (IS_ERR(addr)) > return PTR_ERR(addr); > diff --git a/include/linux/memremap.h b/include/linux/memremap.h > index f91f9e7..cd07ca8 100644 > --- a/include/linux/memremap.h > +++ b/include/linux/memremap.h > @@ -53,11 +53,19 @@ struct vmem_altmap { > * wakeup event whenever a page is unpinned and becomes idle. This > * wakeup is used to coordinate physical address space management (ex: > * fs truncate/hole punch) vs pinned pages (ex: device dma). > + * > + * MEMORY_DEVICE_DEV_DAX: > + * Device memory that support raw access to persistent memory. Without need > + * of an intervening filesystem, it could be directed mapped via an mmap > + * capable character device. Together with the type MEMORY_DEVICE_FS_DAX, > + * we could distinguish the persistent memory pages from normal ZONE_DEVICE > + * pages. > */ > enum memory_type { > MEMORY_DEVICE_PRIVATE = 1, > MEMORY_DEVICE_PUBLIC, > MEMORY_DEVICE_FS_DAX, > + MEMORY_DEVICE_DEV_DAX, > }; > > /* > -- Reviewed-by: Pankaj Gupta > 2.7.4 > >