Skip to content
Snippets Groups Projects
  1. Apr 07, 2014
    • Gleb Natapov's avatar
      zfs: mmu: take vma_list_mutex before tearing down PT during ARC buffer eviction · 82f881a2
      Gleb Natapov authored
      
      Without the lock page mapping and buffer eviction can run in parallel
      which may cause following race:
      
      page mapper thread               thread calling arc_evict()
      map_addr() {
        page = arc_get_page();
        add_mapping(page, ptep);
                                        evict(page) {
                                          ptep = get_mapping(page);
                                          ptep.write(0);
                                          free(page);
                                        }
      
        ptep.write(page);
      }
      
      ARC code has no well defined order for taking its mutexes. It uses trylock()
      and skips a buffer if required locks cannot be acquired. This patch uses
      same approach for vma_list_mutex: if evicted buffer is shared try to
      lock vma_list_mutex and skip the buffer if this fails.
      
      Signed-off-by: default avatarGleb Natapov <gleb@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      82f881a2
  2. Apr 06, 2014
  3. Apr 04, 2014
  4. Apr 03, 2014
  5. Apr 02, 2014
Loading