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


Groups > linux.kernel > #1207044

Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA
Date 2015-08-13 20:20 +0200
Message-ID <pX5gB-2FH-3@gated-at.bofh.it> (permalink)
References <pWR3X-7zZ-1@gated-at.bofh.it> <pWR3Y-7zZ-15@gated-at.bofh.it> <pX4DW-1Gi-47@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 13, 2015 at 10:35 AM, Matthew Wilcox <willy@linux.intel.com> wrote:
> On Wed, Aug 12, 2015 at 11:01:09PM -0400, Dan Williams wrote:
>> +static inline __pfn_t page_to_pfn_t(struct page *page)
>> +{
>> +     __pfn_t pfn = { .val = page_to_pfn(page) << PAGE_SHIFT, };
>> +
>> +     return pfn;
>> +}
>
> static inline __pfn_t page_to_pfn_t(struct page *page)
> {
>         __pfn_t __pfn;
>         unsigned long pfn = page_to_pfn(page);
>         BUG_ON(pfn > (-1UL >> PFN_SHIFT))
>         __pfn.val = pfn << PFN_SHIFT;
>
>         return __pfn;
> }
>
> I have a problem wih PFN_SHIFT being equal to PAGE_SHIFT.  Consider a
> 32-bit kernel; you're asserting that no memory represented by a struct
> page can have a physical address above 4GB.
>
> You only need three bits for flags so far ... how about making PFN_SHIFT
> be 6?  That supports physical addresses up to 2^38 (256GB).  That should
> be enough, but hardware designers have done some strange things in the
> past (I know that HP made PA-RISC hardware that can run 32-bit kernels
> with memory between 64GB and 68GB, and they can't be the only strange
> hardware people out there).

Sounds good, especially given we only use 4-bits today.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v5 0/5] introduce __pfn_t for unmapped pfn I/O and DAX  lifetime Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 1/5] mm: move __phys_to_pfn and __pfn_to_phys to  asm/generic/memory_model.h Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 5/5] scatterlist: convert to __pfn_t Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 3/5] dax: drop size parameter to ->direct_access() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
    Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 08:00 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 15:00 +0200
        Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 15:30 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Christoph Hellwig <hch@lst.de> - 2015-08-13 16:50 +0200
            Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 17:10 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Christoph Hellwig <hch@lst.de> - 2015-08-13 16:40 +0200
        Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 16:50 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 17:30 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Dave Hansen <dave@sr71.net> - 2015-08-13 19:40 +0200
    Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Matthew Wilcox <willy@linux.intel.com> - 2015-08-13 19:40 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 20:20 +0200
  [PATCH v5 4/5] dax: fix mapping lifetime handling,  convert to __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
    Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 08:30 +0200
      Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 17:30 +0200
        Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 18:40 +0200
          Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 21:00 +0200

csiph-web