]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pipe: reduce atime precision
authormjg <mjg@FreeBSD.org>
Wed, 5 Aug 2020 19:15:59 +0000 (19:15 +0000)
committermjg <mjg@FreeBSD.org>
Wed, 5 Aug 2020 19:15:59 +0000 (19:15 +0000)
commitdfd1d15e596d1c3f69c7d2da9d3e8cac9ec5c67e
tree80db3312bb2a3899a99dda4bd715018246b6c2a1
parenta47af2bb4ffd8c092c344f3bea2f1c0e15252eba
pipe: reduce atime precision

The routine is called on successful write and read, which on pipes happens a
lot and for small sizes.

Precision provided by default seems way bigger than necessary and it causes
problems in vms on amd64 (it rdtscp's which vmexits). getnanotime seems to
provide the level roughly in lines of Linux so we should be good here.

Sample result from will-it-scale pipe1_processes -t 1 (ops/s):
before: 426464
after: 3247421

Note the that atime handling for named pipes is broken with and without the
patch. The filesystem code is never used for updating atime and never looks
at the updated field. Consequently, while there are no provisions added to
handle named pipes separately, the change is a nop for that case.

Differential Revision:  https://reviews.freebsd.org/D23964
sys/kern/sys_pipe.c