1. 09 Sep, 2017 1 commit
  2. 25 Apr, 2017 1 commit
  3. 14 Feb, 2017 1 commit
    • Artemy Kovalyov's avatar
      IB/umem: Update on demand page (ODP) support · d07d1d70
      Artemy Kovalyov authored
      Currently ODP MR may explicitly register virtual address space area
      of limited length.
      This change allows MR to cover entire process virtual address space
      dynamicaly adding/removing translation entries to device MTT.
      
      Add following changes to support implicit MR:
      * Allow umem to be zero size to back-up implicit MR.
      * Add new function ib_alloc_odp_umem() to add virtual memory regions
        to implicit MR dynamically on demand.
      * Add new function rbt_ib_umem_lookup() to find dynamically added
        virtual memory regions.
      * Expose function rbt_ib_umem_for_each_in_range() to other modules and
        make it safe
      Signed-off-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      d07d1d70
  4. 16 Dec, 2014 2 commits
    • Haggai Eran's avatar
      IB/core: Implement support for MMU notifiers regarding on demand paging regions · 882214e2
      Haggai Eran authored
      * Add an interval tree implementation for ODP umems. Create an
        interval tree for each ucontext (including a count of the number of
        ODP MRs in this context, semaphore, etc.), and register ODP umems in
        the interval tree.
      * Add MMU notifiers handling functions, using the interval tree to
        notify only the relevant umems and underlying MRs.
      * Register to receive MMU notifier events from the MM subsystem upon
        ODP MR registration (and unregister accordingly).
      * Add a completion object to synchronize the destruction of ODP umems.
      * Add mechanism to abort page faults when there's a concurrent invalidation.
      
      The way we synchronize between concurrent invalidations and page
      faults is by keeping a counter of currently running invalidations, and
      a sequence number that is incremented whenever an invalidation is
      caught. The page fault code checks the counter and also verifies that
      the sequence number hasn't progressed before it updates the umem's
      page tables. This is similar to what the kvm module does.
      
      In order to prevent the case where we register a umem in the middle of
      an ongoing notifier, we also keep a per ucontext counter of the total
      number of active mmu notifiers. We only enable new umems when all the
      running notifiers complete.
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarShachar Raindel <raindel@mellanox.com>
      Signed-off-by: default avatarHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarYuval Dagan <yuvalda@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      882214e2
    • Shachar Raindel's avatar
      IB/core: Add support for on demand paging regions · 8ada2c1c
      Shachar Raindel authored
      * Extend the umem struct to keep the ODP related data.
      * Allocate and initialize the ODP related information in the umem
        (page_list, dma_list) and freeing as needed in the end of the run.
      * Store a reference to the process PID struct in the ucontext.  Used to
        safely obtain the task_struct and the mm during fault handling,
        without preventing the task destruction if needed.
      * Add 2 helper functions: ib_umem_odp_map_dma_pages and
        ib_umem_odp_unmap_dma_pages. These functions get the DMA addresses
        of specific pages of the umem (and, currently, pin them).
      * Support for page faults only - IB core will keep the reference on
        the pages used and call put_page when freeing an ODP umem
        area. Invalidations support will be added in a later patch.
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarShachar Raindel <raindel@mellanox.com>
      Signed-off-by: default avatarHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarMajd Dibbiny <majd@mellanox.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      8ada2c1c