diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 3cab9554b4e2..79bb8a1c48a8 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 c593b500599c..95e73fa19e2f 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -246,6 +246,7 @@ struct thread { 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. */ + u_char td_allocdomain; /* (b) NUMA domain backing this struct thread. */ /* Cleared during fork1() */ #define td_startzero td_flags