Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8872971imu; Tue, 4 Dec 2018 16:03:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/VkHUe6iiDqcENxWcPXsbogzbVHBoR5zgxENOsTkX5FWu6BFX982hPNzpLSJGzWb27PO0E2 X-Received: by 2002:aa7:868f:: with SMTP id d15mr21798685pfo.225.1543968227632; Tue, 04 Dec 2018 16:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543968227; cv=none; d=google.com; s=arc-20160816; b=MW1Ac5JVL7bqoa8S9BovdfLLbp29B+wljufahQ0g43rD4xsqPcCyBdPmgcUmCDhgDe FXN0iRR/2fc6q7gatIklNQhYBUBqSm5pkFfM/aJwz9cQY1+d8ogHs6cN6GXHAj/Fwn1m Wit3t5X/mBn3td8rG9xvXVKFBL0Jt6GZNkmMAeqc2wejfqIaHxAF11Lp4vqDCJSCJRjk vUlsH0b21cJ1qIJYRpxkTVVcPPqY1K5+mp+/SV45kocczg0Xu9HJDlgDKTYfcxofvC3h BL1HXowQeaDMo7d/gBvG4a7tHqxrd4Lv24tl8ZRwHWY/aVbssFouNpct9AARQCZNP3d5 PWgg== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=2+Gx4V5PuwUXL6ddmkQrGDOluy8e2IFFF4zHVwthBa4=; b=jc2B9jbdMZQuSuaEimj224j18W/MCDX3bLERRiH0iHtuGIEqowB9HOObk+IjG9Zywz KC0mzq5r3M1IBQx1Q5OD+JlTBeK5OzIB9CvCVA6uofcF/EVb6fSqc91W5cXeZaPbkGNi b9xLVeahHZIb41oLRXH1PDwu/16VVGfNiiGToUbYA/ukHNGiuPxKrIjeGvBYiGJ47n+i xvezOaR/0H85weyhKVgNZ4Xdg6CNK9XCXc9NPWk2/C1Ly+xsM7aDkppwwLo5j3NKswW8 tGPnOkXWOF8RhYU7Bcd7yyrI8BnU19GXt33touDxw4e/RuIuv5QdZSjhvSABehARrq2w bc3A== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si17146963pgb.319.2018.12.04.16.03.31; Tue, 04 Dec 2018 16:03:47 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbeLEABV (ORCPT + 99 others); Tue, 4 Dec 2018 19:01:21 -0500 Received: from mga04.intel.com ([192.55.52.120]:39583 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbeLEABV (ORCPT ); Tue, 4 Dec 2018 19:01:21 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Dec 2018 16:01:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,316,1539673200"; d="scan'208";a="98686061" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008.jf.intel.com with ESMTP; 04 Dec 2018 16:01:20 -0800 Message-ID: Subject: Re: [PATCH RFC 2/3] mm: Add support for exposing if dev_pagemap supports refcount pinning From: Alexander Duyck To: Barret Rhoden Cc: Dan Williams , Paolo Bonzini , Zhang Yi , KVM list , linux-nvdimm , Linux Kernel Mailing List , Linux MM , Dave Jiang , "Zhang, Yu C" , Pankaj Gupta , David Hildenbrand , Jan Kara , Christoph Hellwig , rkrcmar@redhat.com, =?ISO-8859-1?Q?J=E9r=F4me?= Glisse Date: Tue, 04 Dec 2018 16:01:20 -0800 In-Reply-To: <20181204182428.11bec385@gnomeregan.cam.corp.google.com> References: <154386493754.27193.1300965403157243427.stgit@ahduyck-desk1.amr.corp.intel.com> <154386513120.27193.7977541941078967487.stgit@ahduyck-desk1.amr.corp.intel.com> <97943d2ed62e6887f4ba51b985ef4fb5478bc586.camel@linux.intel.com> <2a3f70b011b56de2289e2f304b3d2d617c5658fb.camel@linux.intel.com> <30ab5fa569a6ede936d48c18e666bc6f718d50db.camel@linux.intel.com> <20181204182428.11bec385@gnomeregan.cam.corp.google.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-12-04 at 18:24 -0500, Barret Rhoden wrote: > Hi - > > On 2018-12-04 at 14:51 Alexander Duyck > wrote: > > [snip] > > > > I think the confusion arises from the fact that there are a few MMIO > > > resources with a struct page and all the rest MMIO resources without. > > > The problem comes from the coarse definition of pfn_valid(), it may > > > return 'true' for things that are not System-RAM, because pfn_valid() > > > may be something as simplistic as a single "address < X" check. Then > > > PageReserved is a fallback to clarify the pfn_valid() result. The > > > typical case is that MMIO space is not caught up in this linear map > > > confusion. An MMIO address may or may not have an associated 'struct > > > page' and in most cases it does not. > > > > Okay. I think I understand this somewhat now. So the page might be > > physically there, but with the reserved bit it is not supposed to be > > touched. > > > > My main concern with just dropping the bit is that we start seeing some > > other uses that I was not certain what the impact would be. For example > > the functions like kvm_set_pfn_accessed start going in and manipulating > > things that I am not sure should be messed with for a DAX page. > > One thing regarding the accessed and dirty bits is that we might want > to have DAX pages marked dirty/accessed, even if we can't LRU-reclaim > or swap them. I don't have a real example and I'm fairly ignorant > about the specifics here. But one possibility would be using the A/D > bits to detect changes to a guest's memory for VM migration. Maybe > there would be issues with KSM too. > > Barret I get that, but the issue is that the code associated with those bits currently assumes you are working with either an anonymous swap backed page or a page cache page. We should really be updating that logic now, and then enabling DAX to access it rather than trying to do things the other way around which is how this feels. - Alex