git: kernel - Fix a SMP race in the 64-bit pmap code

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Oct 1 17:01:58 PDT 2013


commit 5e78aef9c66d402e1a066898964ad1bdd0ea8fa4
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Oct 1 16:53:38 2013 -0700

    kernel - Fix a SMP race in the 64-bit pmap code
    
    * Some of the pmap code was assuming that pv_entry's would remain stable
      under circumstance where they might not actually remain stable.
    
      Specifically, when the vm_page spinlock is held while issuing a
      pv_hold_try() call on the pv, the pv is not necessarily stable
      and its pmap and pindex must be double-checked after a successful
      lock is acquired.  This case occurs in two places in the code.
    
    * Do this check in all cases (when the pmap spinlock OR the vm_page spin
      lock is used to access a pv_entry), just to be sure that we have covered
      all the bases.
    
    * This SMP race is virtually impossible to reproduce on 8-thread boxes
      but appears to be easy to reproduce on monster (48-way opteron).
    
    * As of this commit it is not 100% clear if the patch fixes the assertion
      seen, but it probably fixes some things.
    
      panic: bad *ptep 000000078592b425 sva 00007ffffffff000 pte_pv NULL
    
    Reported-by: ftigeot

Summary of changes:
 sys/platform/pc64/x86_64/pmap.c | 64 ++++++++++++++++++++---------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e78aef9c66d402e1a066898964ad1bdd0ea8fa4


-- 
DragonFly BSD source repository


More information about the Commits mailing list