freebsd-dev/share
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
..
colldef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
ctypedef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
dict
doc
dtrace
examples vmrun: Add a missing close-paren to the usage message. 2019-06-07 17:54:26 +00:00
i18n
keys
man Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
misc Whitespace 2019-06-19 11:22:09 +00:00
mk Follow-up r349065: Fix .TARGET flag ambiguity with PROGS which broke MK_TESTS. 2019-06-19 19:19:37 +00:00
monetdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
msgdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
numericdef Add ga_IE.UTF-8 locale. 2018-11-26 19:39:49 +00:00
security
sendmail
skel Make sh(1) support \u in PS1. This removes one fork/exec on interactive 2019-01-24 11:59:46 +00:00
snmp
syscons Fix .depend files to work for build tools. 2019-06-15 17:08:13 +00:00
tabset
termcap pkgbase: Really move termcap.small 2019-05-22 07:41:20 +00:00
tests
timedef Fix various issues with Chinese locales: 2018-12-30 23:04:02 +00:00
vt allow vt(4) fonts to be built from .bdf files 2019-06-16 12:44:49 +00:00
zoneinfo Update the spelling of my name 2019-04-22 17:52:46 +00:00
Makefile
Makefile.inc