Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
To: Barret Rhoden <brho@google.com>, Dan Williams <dan.j.williams@intel.com>
Cc: X86 ML <x86@kernel.org>, "Zhang, Yu C" <yu.c.zhang@intel.com>,
	KVM list <kvm@vger.kernel.org>,
	rkrcmar@redhat.com, linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	zwisler@kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>Zhang,
Subject: Re: [PATCH v2 0/3] kvm: Use huge pages for DAX-backed files
Date: Mon, 03 Dec 2018 10:32:00 -0800	[thread overview]
Message-ID: <714716fde90865e195848f1a9a38e9134e75ad29.camel@linux.intel.com> (raw)
In-Reply-To: <20181203124051.05c1d2ce@gnomeregan.cam.corp.google.com>

On Mon, 2018-12-03 at 12:40 -0500, Barret Rhoden wrote:
> On 2018-11-14 at 16:55 Dan Williams <dan.j.williams@intel.com> wrote:
> > [ add Alex who is looking into removing PageReserved for DAX pages. ]
> 
> Thanks.  I can keep my eye out for his patches and repost once that's
> done.  
> 
> Alternatively, if you all want to merge this before the PageReserved /
> DAX changes, then I can repost - just Ack/Review tags.  It's harmless
> with the existing PageReserved behavior.
> 
> Thanks,
> 
> Barret

So the latest version of my generic memory init patches are up at:

https://lore.kernel.org/lkml/154361452447.7497.1348692079883153517.stgit@ahduyck-desk1.amr.corp.intel.com/

To be honest I am not entirely convinced that dropping PageReserved is
the right thing to do for DAX pages. I've been trying to work out a few
different issues but not having much luck. It seems like the main issue
is that the PageReserved bit is being used to indicate 2 different
things in a few spots throughout the kernel.

The definition of the PG_reserved flag reads like it should apply to
DAX pages:
  PG_reserved is set for special pages, which can never be swapped out.
  Some of them might not even exist...

PageReserved essentially means you aren't supposed to be migrating or
swapping the page. The problem here is that I believe this logic should
apply to DAX pages and so in many cases it makes sense to leave the
flag set for DAX pages. Otherwise you have to go through and start
special casing all the spots where normal memory falls through and add
a check to see if we have a DAX page.

The second use for the PG_reserved flag is to test for if you can pin
the page or not. This I think is the reason why many are just assuming
PageReserved == MMIO like KVM does. However this is a bad assumption to
be making since the introduction of DAX, HMM, and P2PDMA allows MMIO
memory to start doing different things like supporting pinning. I also
believe it would be a bad reason to clear the flag for DAX pages.

Thanks.

- Alex

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      reply	other threads:[~2018-12-03 18:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09 20:39 [PATCH 0/2] kvm: Use huge pages for DAX-backed files Barret Rhoden
2018-11-09 20:39 ` [PATCH 1/2] mm: make dev_pagemap_mapping_shift() externally visible Barret Rhoden
2018-11-13  9:28   ` David Hildenbrand
2018-11-09 20:39 ` [PATCH 2/2] kvm: Use huge pages for DAX-backed files Barret Rhoden
2018-11-12 19:31   ` Paolo Bonzini
     [not found]     ` <861c4adb-e2f0-2caf-8f6e-9f09ecb0b624-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-11-13 16:21       ` Barret Rhoden
2018-11-13 18:22         ` Paolo Bonzini
2018-11-13  9:36   ` David Hildenbrand
2018-11-13 10:02     ` Pankaj Gupta
2018-11-13 12:41       ` Paolo Bonzini
     [not found]       ` <286665658.33247363.1542103353780.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-11-13 15:56         ` Barret Rhoden
2018-11-14  9:09           ` Pankaj Gupta
     [not found]     ` <043a592d-6592-3053-15a0-68cc54a26deb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-11-13 15:50       ` Barret Rhoden
     [not found] ` <20181109203921.178363-1-brho-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2018-11-14 21:51   ` [PATCH v2 0/3] " Barret Rhoden
2018-11-14 21:51     ` [PATCH v2 1/3] mm: make dev_pagemap_mapping_shift() externally visible Barret Rhoden
2018-11-26 16:50       ` Paolo Bonzini
2018-11-26 18:32       ` Dan Williams
     [not found]     ` <20181114215155.259978-1-brho-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2018-11-14 21:51       ` [PATCH v2 2/3] kvm: Use huge pages for DAX-backed files Barret Rhoden
2018-11-14 21:51       ` [PATCH v2 3/3] kvm: remove redundant PageReserved() check Barret Rhoden
2018-11-27 13:31         ` David Hildenbrand
2018-11-15  0:55     ` [PATCH v2 0/3] kvm: Use huge pages for DAX-backed files Dan Williams
2018-12-03 17:40       ` Barret Rhoden
2018-12-03 18:32         ` Alexander Duyck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=714716fde90865e195848f1a9a38e9134e75ad29.camel@linux.intel.com \
    --to=alexander.h.duyck@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brho@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yu.c.zhang@intel.com \
    --cc=zwisler@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox