summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:05:37 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:26 -0700
commit2e98b39c62af46f59cec82d1055849f6994e9acc (patch)
tree10e0ea4fcc3178e6452ab9448ca0c20cce753023 /usr
parentd1eb6177a21e17ec6264bf2f8edc97aa914c8836 (diff)
xfs: minimize overhead of drain wakeups by using jump labels
To reduce the runtime overhead even further when online fsck isn't running, use a static branch key to decide if we call wake_up on the drain. For compilers that support jump labels, the call to wake_up is replaced by a nop sled when nobody is waiting for intents to drain. From my initial microbenchmarking, every transition of the static key between the on and off states takes about 22000ns to complete; this is paid entirely by the xfs_scrub process. When the static key is off (which it should be when fsck isn't running), the nop sled adds an overhead of approximately 0.36ns to runtime code. For the few compilers that don't support jump labels, runtime code pays the cost of calling wake_up on an empty waitqueue, which was observed to be about 30ns. However, most architectures that have sufficient memory and CPU capacity to run XFS also support jump labels, so this is not much of a worry. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions