aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-11-11 18:43:51 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-11-11 18:43:51 +0000
commitc5315f51960d853151756a1f4ffc8858665b2934 (patch)
tree7e900a7eb0b36b2ea9fca1e2e6ca87e4b6fb77bd /sys/sys/proc.h
parent54bf96fb4f167fdbc66232f5ec4a7f3f15d2db8f (diff)
downloadsrc-c5315f51960d853151756a1f4ffc8858665b2934.tar.gz
src-c5315f51960d853151756a1f4ffc8858665b2934.zip
thread: lockless zombie list manipulation
This gets rid of the most contended spinlock seen when creating/destroying threads in a loop. (modulo kstack) Tested by: alfredo (ppc64), bdragon (ppc64)
Notes
Notes: svn path=/head/; revision=367597
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 474dc0f2c5b7..21b0a2f0a41c 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -229,7 +229,10 @@ struct thread {
struct proc *td_proc; /* (*) Associated process. */
TAILQ_ENTRY(thread) td_plist; /* (*) All threads in this proc. */
TAILQ_ENTRY(thread) td_runq; /* (t) Run queue. */
- TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */
+ union {
+ TAILQ_ENTRY(thread) td_slpq; /* (t) Sleep queue. */
+ struct thread *td_zombie; /* Zombie list linkage */
+ };
TAILQ_ENTRY(thread) td_lockq; /* (t) Lock queue. */
LIST_ENTRY(thread) td_hash; /* (d) Hash chain. */
struct cpuset *td_cpuset; /* (t) CPU affinity mask. */