1. 29 3月, 2016 1 次提交
  2. 10 3月, 2016 5 次提交
  3. 07 3月, 2016 1 次提交
  4. 06 3月, 2016 11 次提交
  5. 24 2月, 2016 2 次提交
    • A
      nvdimm: use 'u64' for pfn flags · c4544205
      Arnd Bergmann 提交于
      A recent bugfix changed pfn_t to always be 64-bit wide, but did not
      change the code in pmem.c, which is now broken on 32-bit architectures
      as reported by gcc:
      
      In file included from ../drivers/nvdimm/pmem.c:28:0:
      drivers/nvdimm/pmem.c: In function 'pmem_alloc':
      include/linux/pfn_t.h:15:17: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
       #define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))
      
      This changes the intermediate pfn_flags in struct pmem_device to
      be 64 bit wide as well, so they can store the flags correctly.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: db78c222 ("mm: fix pfn_t vs highmem")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      c4544205
    • D
      nfit: update address range scrub commands to the acpi 6.1 format · 4577b066
      Dan Williams 提交于
      The original format of these commands from the "NVDIMM DSM Interface
      Example" [1] are superseded by the ACPI 6.1 definition of the "NVDIMM Root
      Device _DSMs" [2].
      
      [1]: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
      [2]: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
           "9.20.7 NVDIMM Root Device _DSMs"
      
      Changes include:
      1/ New 'restart' fields in ars_status, unfortunately these are
         implemented in the middle of the existing definition so this change
         is not backwards compatible.  The expectation is that shipping
         platforms will only ever support the ACPI 6.1 definition.
      
      2/ New status values for ars_start ('busy') and ars_status ('overflow').
      
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Linda Knippers <linda.knippers@hpe.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      4577b066
  6. 20 2月, 2016 1 次提交
  7. 17 2月, 2016 1 次提交
  8. 30 1月, 2016 2 次提交
    • T
      x86, kexec, nvdimm: Use walk_iomem_res_desc() for iomem search · f0f4711a
      Toshi Kani 提交于
      Change the callers of walk_iomem_res() scanning for the
      following resources by name to use walk_iomem_res_desc()
      instead.
      
       "ACPI Tables"
       "ACPI Non-volatile Storage"
       "Persistent Memory (legacy)"
       "Crash kernel"
      
      Note, the caller of walk_iomem_res() with "GART" will be removed
      in a later patch.
      Signed-off-by: NToshi Kani <toshi.kani@hpe.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NDave Young <dyoung@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Chun-Yi <joeyli.kernel@gmail.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Lee, Chun-Yi <joeyli.kernel@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Luis R. Rodriguez <mcgrof@suse.com>
      Cc: Minfei Huang <mnfhuang@gmail.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Takao Indoh <indou.takao@jp.fujitsu.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Toshi Kani <toshi.kani@hp.com>
      Cc: kexec@lists.infradead.org
      Cc: linux-arch@vger.kernel.org
      Cc: linux-mm <linux-mm@kvack.org>
      Cc: linux-nvdimm@lists.01.org
      Link: http://lkml.kernel.org/r/1453841853-11383-15-git-send-email-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      f0f4711a
    • D
      libnvdimm, pfn: fix restoring memmap location · 45eb570a
      Dan Williams 提交于
      This path was missed when turning on the memmap in pmem support.  Permit
      'pmem' as a valid location for the map.
      Reported-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      45eb570a
  9. 27 1月, 2016 1 次提交
  10. 16 1月, 2016 6 次提交
    • D
      mm, dax, pmem: introduce {get|put}_dev_pagemap() for dax-gup · 5c2c2587
      Dan Williams 提交于
      get_dev_page() enables paths like get_user_pages() to pin a dynamically
      mapped pfn-range (devm_memremap_pages()) while the resulting struct page
      objects are in use.  Unlike get_page() it may fail if the device is, or
      is in the process of being, disabled.  While the initial lookup of the
      range may be an expensive list walk, the result is cached to speed up
      subsequent lookups which are likely to be in the same mapped range.
      
      devm_memremap_pages() now requires a reference counter to be specified
      at init time.  For pmem this means moving request_queue allocation into
      pmem_alloc() so the existing queue usage counter can track "device
      pages".
      
      ZONE_DEVICE pages always have an elevated count and will never be on an
      lru reclaim list.  That space in 'struct page' can be redirected for
      other uses, but for safety introduce a poison value that will always
      trip __list_add() to assert.  This allows half of the struct list_head
      storage to be reclaimed with some assurance to back up the assumption
      that the page count never goes to zero and a list_add() is never
      attempted.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Tested-by: NLogan Gunthorpe <logang@deltatee.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5c2c2587
    • D
      libnvdimm, pmem: move request_queue allocation earlier in probe · 468ded03
      Dan Williams 提交于
      Before the dynamically allocated struct pages from devm_memremap_pages()
      can be put to use outside the driver, we need a mechanism to track
      whether they are still in use at teardown.  Towards that goal reorder
      the initialization sequence to allow the 'q_usage_counter' from the
      request_queue to be used by the devm_memremap_pages() implementation (in
      subsequent patches).
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      468ded03
    • D
      libnvdimm, pfn, pmem: allocate memmap array in persistent memory · d2c0f041
      Dan Williams 提交于
      Use the new vmem_altmap capability to enable the pmem driver to arrange
      for a struct page memmap to be established in persistent memory.
      
      [linux@roeck-us.net: mn10300: declare __pfn_to_phys() to fix build error]
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d2c0f041
    • D
      x86, mm: introduce vmem_altmap to augment vmemmap_populate() · 4b94ffdc
      Dan Williams 提交于
      In support of providing struct page for large persistent memory
      capacities, use struct vmem_altmap to change the default policy for
      allocating memory for the memmap array.  The default vmemmap_populate()
      allocates page table storage area from the page allocator.  Given
      persistent memory capacities relative to DRAM it may not be feasible to
      store the memmap in 'System Memory'.  Instead vmem_altmap represents
      pre-allocated "device pages" to satisfy vmemmap_alloc_block_buf()
      requests.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4b94ffdc
    • D
      mm: introduce find_dev_pagemap() · 9476df7d
      Dan Williams 提交于
      There are several scenarios where we need to retrieve and update
      metadata associated with a given devm_memremap_pages() mapping, and the
      only lookup key available is a pfn in the range:
      
      1/ We want to augment vmemmap_populate() (called via arch_add_memory())
         to allocate memmap storage from pre-allocated pages reserved by the
         device driver.  At vmemmap_alloc_block_buf() time it grabs device pages
         rather than page allocator pages.  This is in support of
         devm_memremap_pages() mappings where the memmap is too large to fit in
         main memory (i.e. large persistent memory devices).
      
      2/ Taking a reference against the mapping when inserting device pages
         into the address_space radix of a given inode.  This facilitates
         unmap_mapping_range() and truncate_inode_pages() operations when the
         driver is tearing down the mapping.
      
      3/ get_user_pages() operations on ZONE_DEVICE memory require taking a
         reference against the mapping so that the driver teardown path can
         revoke and drain usage of device pages.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Tested-by: NLogan Gunthorpe <logang@deltatee.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9476df7d
    • D
      mm, dax, pmem: introduce pfn_t · 34c0fd54
      Dan Williams 提交于
      For the purpose of communicating the optional presence of a 'struct
      page' for the pfn returned from ->direct_access(), introduce a type that
      encapsulates a page-frame-number plus flags.  These flags contain the
      historical "page_link" encoding for a scatterlist entry, but can also
      denote "device memory".  Where "device memory" is a set of pfns that are
      not part of the kernel's linear mapping by default, but are accessed via
      the same memory controller as ram.
      
      The motivation for this new type is large capacity persistent memory
      that needs struct page entries in the 'memmap' to support 3rd party DMA
      (i.e.  O_DIRECT I/O with a persistent memory source/target).  However,
      we also need it in support of maintaining a list of mapped inodes which
      need to be unmapped at driver teardown or freeze_bdev() time.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34c0fd54
  11. 10 1月, 2016 7 次提交
  12. 06 1月, 2016 1 次提交
    • D
      libnvdimm: fix namespace object confusion in is_uuid_busy() · e07ecd76
      Dan Williams 提交于
      When btt devices were re-worked to be child devices of regions this
      routine was overlooked.  It mistakenly attempts to_nd_namespace_pmem()
      or to_nd_namespace_blk() conversions on btt and pfn devices.  By luck to
      date we have happened to be hitting valid memory leading to a uuid
      miscompare, but a recent change to struct nd_namespace_common causes:
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
       IP: [<ffffffff814610dc>] memcmp+0xc/0x40
       [..]
       Call Trace:
        [<ffffffffa0028631>] is_uuid_busy+0xc1/0x2a0 [libnvdimm]
        [<ffffffffa0028570>] ? to_nd_blk_region+0x50/0x50 [libnvdimm]
        [<ffffffff8158c9c0>] device_for_each_child+0x50/0x90
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e07ecd76
  13. 25 12月, 2015 1 次提交
    • D
      libnvdimm, pfn: move 'memory mode' indication to sysfs · 0731de0d
      Dan Williams 提交于
      'Memory mode' is defined as the capability of a DAX mapping to be the
      source/target of DMA and other "direct I/O" scenarios.  While it
      currently requires allocating 'struct page' for each page frame of
      persistent memory in the namespace it will not always be the case.  Work
      continues on reducing the kernel's dependency on 'struct page'.
      
      Let's not maintain a suffix that is expected to lose meaning over time.
      In other words a future 'raw mode' pmem namespace may be as capable as
      today's 'memory mode' namespace.  Undo the encoding of the mode in the
      device name and leave it to other tooling to determine the mode of the
      namespace from its attributes.
      Reported-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      0731de0d