Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1356519

Re: [PATCH 1/3] pfn_t: Change the encoding

Path csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Matthew Wilcox <willy@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] pfn_t: Change the encoding
Date Sat, 12 Mar 2016 19:40:01 +0100
Message-ID <rbWCd-1UK-11@gated-at.bofh.it> (permalink)
References <rbCDv-3NU-5@gated-at.bofh.it> <rbCDw-3NU-15@gated-at.bofh.it> <rbD6x-43l-3@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.24,326,1455004800"; d="scan'208";a="922577015"
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 38
Organization linux.* mail to news gateway
X-Original-Cc Matthew Wilcox <matthew.r.wilcox@intel.com>, "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Linux MM <linux-mm@kvack.org>, Dave Hansen <dave.hansen@linux.intel.com>
X-Original-Date Sat, 12 Mar 2016 13:30:05 -0500
X-Original-Message-ID <20160312183005.GA2525@linux.intel.com>
X-Original-References <1457730784-9890-1-git-send-email-matthew.r.wilcox@intel.com> <1457730784-9890-2-git-send-email-matthew.r.wilcox@intel.com> <CAPcyv4g82US298_mCd75toj9kEeyDhw0cP_Ott0R8fOydWNsSg@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1356519

Show key headers only | View raw


On Fri, Mar 11, 2016 at 01:40:20PM -0800, Dan Williams wrote:
> On Fri, Mar 11, 2016 at 1:13 PM, Matthew Wilcox
> <matthew.r.wilcox@intel.com> wrote:
> > By moving the flag bits to the bottom, we encourage commonality
> > between SGs with pages and those using pfn_t.  We can also then insert
> > a pfn_t into a radix tree, as it uses the same two bits for indirect &
> > exceptional indicators.
> 
> It's not immediately clear to me what we gain with SG entry
> commonality.  The down side is that we lose the property that
> pfn_to_pfn_t() is a nop.  This was Dave's suggestion so that the
> nominal case did not change the binary layout of a typical pfn.

I understand that motivation!

> Can we just bit swizzle a pfn_t on insertion/retrieval from the radix?

Of course we *can*, but we end up doing more swizzling that way than we
do this way.  In the Brave New Future where we're storing pfn_t in the
radix tree, on a page fault we find the pfn_t in the radix tree then
we want to insert it into the page tables.  So DAX would first have to
convert the radix tree entry to a pfn_t, then the page table code has to
convert the pfn_t into a pte/pmd/pud (which we currently do by converting
a pfn_t to a pfn, then converting the pfn to a pte/pmd/pud, but I assume
that either the compiler optimises that into a single conversion, or we'll
add pfn_t_pte to each architecture in future if it's actually a problem).

Much easier to look up a pfn_t in the radix tree and pass it directly
to vm_insert_mixed().

If there's any part of the kernel that is doing a *lot* of conversion
between pfn_t and pfn, that surely indicates a place in the kernel where
we need to convert an interface from pfn to pfn_t.

(It occurs to me we can make the code simpler on architectures that
don't support PUDs.  The PFN_HUGE bit is still available to distinguish
between PMDs and PTEs, but we won't need to clear the bottom bit of the
PFN if PFN_HUGE is set, since nobody can add a PUD pfn to the radix tree).

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Make pfn_t suitable for placing in the radix tree Matthew Wilcox <matthew.r.wilcox@intel.com> - 2016-03-11 22:20 +0100
  [PATCH 3/3] pfn_t: New functions pfn_t_add and pfn_t_cmp Matthew Wilcox <matthew.r.wilcox@intel.com> - 2016-03-11 22:20 +0100
  [PATCH 1/3] pfn_t: Change the encoding Matthew Wilcox <matthew.r.wilcox@intel.com> - 2016-03-11 22:20 +0100
    Re: [PATCH 1/3] pfn_t: Change the encoding Dan Williams <dan.j.williams@intel.com> - 2016-03-11 22:50 +0100
      Re: [PATCH 1/3] pfn_t: Change the encoding Matthew Wilcox <willy@linux.intel.com> - 2016-03-12 19:40 +0100
        Re: [PATCH 1/3] pfn_t: Change the encoding Dan Williams <dan.j.williams@intel.com> - 2016-03-14 00:10 +0100
          Re: [PATCH 1/3] pfn_t: Change the encoding Matthew Wilcox <willy@linux.intel.com> - 2016-03-14 16:10 +0100

csiph-web