diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c --- a/sys/kern/kern_rangelock.c +++ b/sys/kern/kern_rangelock.c @@ -313,15 +313,8 @@ rlqentry_alloc(vm_ooffset_t start, vm_ooffset_t end, int flags) { struct rl_q_entry *e; - struct thread *td; - - td = curthread; - if (td->td_rlqe != NULL) { - e = td->td_rlqe; - td->td_rlqe = NULL; - } else { - e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); - } + + e = uma_zalloc_smr(rl_entry_zone, M_WAITOK); e->rl_q_next = NULL; e->rl_q_free = NULL; e->rl_q_start = start; @@ -333,12 +326,6 @@ return (e); } -void -rangelock_entry_free(struct rl_q_entry *e) -{ - uma_zfree_smr(rl_entry_zone, e); -} - void rangelock_init(struct rangelock *lock) { @@ -401,19 +388,12 @@ rangelock_free_free(struct rl_q_entry *free) { struct rl_q_entry *x, *xp; - struct thread *td; - td = curthread; for (x = free; x != NULL; x = xp) { MPASS(!rl_e_is_marked(x)); xp = x->rl_q_free; MPASS(!rl_e_is_marked(xp)); - if (td->td_rlqe == NULL) { - smr_synchronize(rl_smr); - td->td_rlqe = x; - } else { - uma_zfree_smr(rl_entry_zone, x); - } + uma_zfree_smr(rl_entry_zone, x); } } diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -460,7 +460,6 @@ td->td_allocdomain = vm_phys_domain(vtophys(td)); td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); - td->td_rlqe = NULL; EVENTHANDLER_DIRECT_INVOKE(thread_init, td); umtx_thread_init(td); td->td_kstack = 0; @@ -480,7 +479,6 @@ EVENTHANDLER_DIRECT_INVOKE(thread_fini, td); turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); - rangelock_entry_free(td->td_rlqe); umtx_thread_fini(td); MPASS(td->td_sel == NULL); } diff --git a/sys/sys/proc.h b/sys/sys/proc.h --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -247,7 +247,7 @@ struct seltd *td_sel; /* Select queue/channel. */ struct sleepqueue *td_sleepqueue; /* (k) Associated sleep queue. */ struct turnstile *td_turnstile; /* (k) Associated turnstile. */ - struct rl_q_entry *td_rlqe; /* (k) Associated range lock entry. */ + void *td_pad1; /* Available */ struct umtx_q *td_umtxq; /* (c?) Link for when we're blocked. */ lwpid_t td_tid; /* (b) Thread ID. */ sigqueue_t td_sigqueue; /* (c) Sigs arrived, not delivered. */ diff --git a/sys/sys/rangelock.h b/sys/sys/rangelock.h --- a/sys/sys/rangelock.h +++ b/sys/sys/rangelock.h @@ -65,7 +65,6 @@ vm_ooffset_t end); void *rangelock_trywlock(struct rangelock *lock, vm_ooffset_t start, vm_ooffset_t end); -void rangelock_entry_free(struct rl_q_entry *e); void rangelock_may_recurse(struct rangelock *lock); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _rangelock_cookie_assert(void *cookie, int what, const char *file,