git: kernel - Reduce spin-lock contention issues in page allocator

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Feb 26 23:17:07 PST 2023


commit 297fb5983274cf927b65e91acaf66cbe34f0c0cf
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Feb 26 20:50:18 2023 -0800

    kernel - Reduce spin-lock contention issues in page allocator
    
    * The primary source for cpu-localized exhaustion of VM page queues
      is bio_page_alloc().  Mostly because the related pages tend to be
      very long-lived.  When this occurs, multiple cpus wind up being
      funneled to alternative page queues and wind up with lock
      contention.
    
    * As a first-order solution, use cpuid + ticks to rotate through
      cpu-localized page queues when allocating BIO pages.
    
      Note that this is not really NUMA friendly, but the kernel has
      a hard time determining which BIO pages might be useful when
      NUMA-localized and which might not be.  We might need to make
      adjustments in the future to retain some localization.
    
    * Significantly reduces vm_page_alloc() contention on heavily
      loaded systems.

Summary of changes:
 sys/kern/vfs_bio.c | 14 ++++++++++++--
 sys/vm/vm_object.c |  5 +++++
 2 files changed, 17 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/297fb5983274cf927b65e91acaf66cbe34f0c0cf


-- 
DragonFly BSD source repository


More information about the Commits mailing list