git: kernel - Reoptimize sys_pipe

Matthew Dillon dillon at
Mon Oct 16 11:30:37 PDT 2017

commit 9e465b5ea7afd8442d93d9391f9754b36ba07b88
Author: Matthew Dillon <dillon at>
Date:   Fri Oct 13 21:26:30 2017 -0700

    kernel - Reoptimize sys_pipe
    * Use atomic ops for state updates, allowing us to avoid acquiring
      the other side's token.  This removes all remaining contention.
    * Performance boosted by around 35%.  On the ryzen, bulk buffer
      write->read tests between localized cpu cores went from 9.2 GB/sec
      to around 13 GBytes/sec.  Cross-die performance increased from
      2.5 GB/sec to around 4.5 GB/sec (gigabytes/sec).
      1-byte ping-ponging (write-1/read-1/turn-around/write-back-1/
      read-back1) fell from 1.0-2.0uS to 0.7uS to 1.7uS.
    * Add kern.pipe.size, allowing the kernel pipe buffer size to be
      changed (effects new pipes only).  The default buffer size has
      been increased to 32KB (it was 16KB).
    * Refactor pipelining optimizations, further reducing unnecessary
      tsleep/wakeup IPIs.
    * Improve kern.pipe.delay operation (an IPI avoidance mechanism),
      and reduce from 5uS to 4uS.
      Also add cpu_pause() in the TSC loop (suggested-by mjg_).

Summary of changes:
 sys/kern/sys_pipe.c | 297 +++++++++++++++++++++++++++-------------------------
 1 file changed, 154 insertions(+), 143 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list