git: kernel - Fix races in the vm_map and vm_object page-scanning code

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Jan 28 14:12:46 PST 2017


commit 07540d375a7f9dfdadc9976982dd8d0a1fd6794e
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Jan 28 14:08:39 2017 -0800

    kernel - Fix races in the vm_map and vm_object page-scanning code
    
    * Calling lwkt_yield() while depending on the vm_object token to stabilize
      a vm_page_t is a bad idea.  Move the calls to the end of the routine
      where they don't hurt anyone (the RB tree scanning code can handle
      ripouts, the callback functions cannot).
    
    * Unconditionally busying a vm_page_t in a RB tree scanning callback
      and then trying to re-check it to see if its still ok is a bad idea.
      Instead, use vm_page_busy_try() so as not to break the object token
      lock.  If it fails, sleep on the page and set a retry condition but
      do not act on it.
    
    * Fix an issue in vm_object_pmap_remove() where the function operates
      incorrect if passed a 0-length address range.

Summary of changes:
 sys/vm/vm_map.c     |  97 +++++++++++++++++++++++++--------------------
 sys/vm/vm_map.h     |   2 +
 sys/vm/vm_object.c  | 110 ++++++++++++++++++++++++++++++----------------------
 sys/vm/vm_pageout.c |   4 ++
 4 files changed, 124 insertions(+), 89 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/07540d375a7f9dfdadc9976982dd8d0a1fd6794e


-- 
DragonFly BSD source repository



More information about the Commits mailing list