freebsd-dev/sys
Alexander Motin f91aa773be Add wakeup_any(), cheaper wakeup_one() for taskqueue(9).
wakeup_one() and underlying sleepq_signal() spend additional time trying
to be fair, waking thread with highest priority, sleeping longest time.
But in case of taskqueue there are many absolutely identical threads, and
any fairness between them is quite pointless.  It makes even worse, since
round-robin wakeups not only make previous CPU affinity in scheduler quite
useless, but also hide from user chance to see CPU bottlenecks, when
sequential workload with one request at a time looks evenly distributed
between multiple threads.

This change adds new SLEEPQ_UNFAIR flag to sleepq_signal(), making it wakeup
thread that went to sleep last, but no longer in context switch (to avoid
immediate spinning on the thread lock).  On top of that new wakeup_any()
function is added, equivalent to wakeup_one(), but setting the flag.
On top of that taskqueue(9) is switchied to wakeup_any() to wakeup its
threads.

As result, on 72-core Xeon v4 machine sequential ZFS write to 12 ZVOLs
with 16KB block size spend 34% less time in wakeup_any() and descendants
then it was spending in wakeup_one(), and total write throughput increased
by ~10% with the same as before CPU usage.

Reviewed by:	markj, mmacy
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D20669
2019-06-20 01:15:33 +00:00
..
amd64 Implement VT-d capability detection on chipsets that have multiple 2019-06-19 06:41:07 +00:00
arm Implement the ofw_bus_get_node method in aw_pwm(4) so that ofw_pwmbus can 2019-06-17 03:40:00 +00:00
arm64 Correct an error in r349122. pmap_unwire() should update the pmap's wired 2019-06-19 03:33:00 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam Minor white space changes. 2019-06-11 20:48:19 +00:00
cddl Minimize aggsum_compare(&arc_size, arc_c) calls. 2019-06-14 20:04:28 +00:00
compat Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
conf Add ACPI support for USB driver. 2019-06-17 23:03:30 +00:00
contrib Make ipf_objbytes a constant. ipf_objbytes is a table of internal data 2019-06-17 20:10:55 +00:00
crypto aesni(4): Fix trivial type typo 2019-05-27 00:47:51 +00:00
ddb Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
dev random(4): Fix a regression in short AES mode reads 2019-06-18 18:50:58 +00:00
dts arm64: Add support for NanoPI NEO2 2019-05-02 12:56:13 +00:00
fs Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
gdb
geom Use sbuf_cat() in GEOM confxml generation. 2019-06-19 15:36:02 +00:00
gnu dts: Import files from Linux 5.1 2019-05-08 19:27:30 +00:00
i386 Implement an alternative solution to the amd64 and i386 pmap problem that we 2019-06-09 03:36:10 +00:00
isa
kern Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
kgssapi Make the warning intervals for deprecated crypto algorithms tunable. 2019-06-11 23:00:55 +00:00
libkern Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
mips Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). 2019-06-07 18:23:29 +00:00
modules Add ACPI support for USB driver. 2019-06-17 23:03:30 +00:00
net V_ip6_forwarding and V_ipforwarding have been defined in ip6_var.h / 2019-06-19 08:49:24 +00:00
net80211 Enhance the comment ieee80211_add_channel() to avoid a 2019-06-10 14:31:18 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet Add the ability to limit how much the code will fragment the RACK send map 2019-06-19 13:55:00 +00:00
netinet6 Sort opt_foo.h #includes and add a missing blank line in ip_output(). 2019-06-11 22:07:39 +00:00
netipsec Make the warning intervals for deprecated crypto algorithms tunable. 2019-06-11 23:00:55 +00:00
netpfil Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Fix prio vs. nonprio tagged traffic in RDMACM 2019-06-04 06:21:31 +00:00
opencrypto Move declaration of warninterval out from under COMPAT_FREEBSD32. 2019-06-11 23:28:07 +00:00
powerpc Fix bug on newbus device deletion: we should delete the child's devinfo 2019-06-16 21:56:45 +00:00
riscv RISC-V: expose extension bits in AT_HWCAP 2019-06-11 00:55:54 +00:00
rpc Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled. 2019-04-04 01:23:06 +00:00
security Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
sparc64 FCP-101: Remove wb(4) 2019-05-17 15:24:34 +00:00
sys Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools Add SDIO support. 2019-06-08 16:26:56 +00:00
ufs Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
vm Group vm_page_activate()'s definition with other related functions. 2019-06-19 21:36:00 +00:00
x86 Currently, MCA entries remain on an every-growing linked list. This means 2019-06-08 18:26:48 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile