commit 2ff38d69a93f6aa8531efe07a1c71554657432c9 Author: Mateusz Guzik Date: Thu Nov 19 19:40:08 2020 +0100 fix diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 3cab9554b4e..79bb8a1c48a 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -346,6 +346,7 @@ thread_ctor(void *mem, int size, void *arg, int flags) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; td->td_lastcpu = td->td_oncpu = NOCPU; + td->td_allocdomain = vm_phys_domain(vtophys(td)); /* * Note that td_critnest begins life as 1 because the thread is not @@ -544,7 +545,7 @@ thread_zombie(struct thread *td) struct thread_domain_data *tdd; struct thread *ztd; - tdd = &thread_domain_data[vm_phys_domain(vtophys(td))]; + tdd = &thread_domain_data[td->td_allocdomain]; ztd = atomic_load_ptr(&tdd->tdd_zombies); for (;;) { td->td_zombie = ztd; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index c593b500599..6989ea027e7 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -243,6 +243,7 @@ struct thread { struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ struct umtx_q *td_umtxq; /* (c?) Link for when we're blocked. */ lwpid_t td_tid; /* (b) Thread ID. */ + int td_allocdomain; /* (b) NUMA domain backing the object. */ sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ #define td_siglist td_sigqueue.sq_signals u_char td_lend_user_pri; /* (t) Lend user pri. */