From 193f316ca4f334f3f72dda8dd972766eb44d7405 Mon Sep 17 00:00:00 2001 From: mpi Date: Mon, 8 Feb 2021 10:51:01 +0000 Subject: [PATCH] Revert the convertion of per-process thread into a SMR_TAILQ. We did not reach a consensus about using SMR to unlock single_thread_set() so there's no point in keeping this change. --- lib/libkvm/kvm_proc2.c | 11 +++++------ sys/kern/exec_elf.c | 5 ++--- sys/kern/init_main.c | 4 ++-- sys/kern/kern_exit.c | 7 +++---- sys/kern/kern_fork.c | 9 ++++----- sys/kern/kern_proc.c | 6 +++--- sys/kern/kern_resource.c | 6 +++--- sys/kern/kern_sig.c | 10 +++++----- sys/kern/kern_synch.c | 5 ++--- sys/kern/kern_sysctl.c | 6 +++--- sys/kern/subr_witness.c | 6 +++--- sys/kern/sys_process.c | 10 +++++----- sys/kern/tty.c | 8 ++++---- sys/sys/proc.h | 21 ++++++--------------- sys/uvm/uvm_glue.c | 4 ++-- 15 files changed, 52 insertions(+), 66 deletions(-) diff --git a/lib/libkvm/kvm_proc2.c b/lib/libkvm/kvm_proc2.c index 259fdfe8ec9..7cc2adab450 100644 --- a/lib/libkvm/kvm_proc2.c +++ b/lib/libkvm/kvm_proc2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_proc2.c,v 1.32 2020/12/07 16:55:28 mpi Exp $ */ +/* $OpenBSD: kvm_proc2.c,v 1.33 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kvm_proc.c,v 1.30 1999/03/24 05:50:50 mrg Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -341,9 +341,8 @@ kvm_proclist(kvm_t *kd, int op, int arg, struct process *pr, kp.p_pctcpu = 0; kp.p_stat = (process.ps_flags & PS_ZOMBIE) ? SDEAD : SIDL; - for (p = SMR_TAILQ_FIRST_LOCKED(&process.ps_threads); - p != NULL; - p = SMR_TAILQ_NEXT_LOCKED(&proc, p_thr_link)) { + for (p = TAILQ_FIRST(&process.ps_threads); p != NULL; + p = TAILQ_NEXT(&proc, p_thr_link)) { if (KREAD(kd, (u_long)p, &proc)) { _kvm_err(kd, kd->program, "can't read proc at %lx", @@ -377,8 +376,8 @@ kvm_proclist(kvm_t *kd, int op, int arg, struct process *pr, if (!dothreads) continue; - for (p = SMR_TAILQ_FIRST_LOCKED(&process.ps_threads); p != NULL; - p = SMR_TAILQ_NEXT_LOCKED(&proc, p_thr_link)) { + for (p = TAILQ_FIRST(&process.ps_threads); p != NULL; + p = TAILQ_NEXT(&proc, p_thr_link)) { if (KREAD(kd, (u_long)p, &proc)) { _kvm_err(kd, kd->program, "can't read proc at %lx", diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index dff4c99c341..4fa5ec22aab 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.157 2021/01/17 15:28:21 mvs Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.158 2021/02/08 10:51:01 mpi Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -85,7 +85,6 @@ #include #include #include -#include #include @@ -1361,7 +1360,7 @@ coredump_notes_elf(struct proc *p, void *iocookie, size_t *sizep) * threads in the process have been stopped and the list can't * change. */ - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { if (q == p) /* we've taken care of this thread */ continue; error = coredump_note_elf(q, iocookie, ¬esize); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index dd78c085828..7902f2ea0b6 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.305 2021/01/11 18:49:38 mpi Exp $ */ +/* $OpenBSD: init_main.c,v 1.306 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -521,7 +521,7 @@ main(void *framep) */ LIST_FOREACH(pr, &allprocess, ps_list) { nanouptime(&pr->ps_start); - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { nanouptime(&p->p_cpu->ci_schedstate.spc_runtime); timespecclear(&p->p_rtime); } diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 89326bd6fbc..94e3981151f 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.194 2021/01/17 15:28:21 mvs Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.195 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -63,7 +63,6 @@ #ifdef SYSVSEM #include #endif -#include #include #include @@ -162,7 +161,7 @@ exit1(struct proc *p, int xexit, int xsig, int flags) } /* unlink ourselves from the active threads */ - SMR_TAILQ_REMOVE_LOCKED(&pr->ps_threads, p, p_thr_link); + TAILQ_REMOVE(&pr->ps_threads, p, p_thr_link); if ((p->p_flag & P_THREAD) == 0) { /* main thread gotta wait because it has the pid, et al */ while (pr->ps_refcnt > 1) @@ -728,7 +727,7 @@ process_zap(struct process *pr) if (pr->ps_ptstat != NULL) free(pr->ps_ptstat, M_SUBPROC, sizeof(*pr->ps_ptstat)); pool_put(&rusage_pool, pr->ps_ru); - KASSERT(SMR_TAILQ_EMPTY_LOCKED(&pr->ps_threads)); + KASSERT(TAILQ_EMPTY(&pr->ps_threads)); lim_free(pr->ps_limit); crfree(pr->ps_ucred); pool_put(&process_pool, pr); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index a8d275907de..f8b8cc67da5 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.231 2021/01/17 15:28:21 mvs Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.232 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -180,8 +179,8 @@ process_initialize(struct process *pr, struct proc *p) { /* initialize the thread links */ pr->ps_mainproc = p; - SMR_TAILQ_INIT(&pr->ps_threads); - SMR_TAILQ_INSERT_TAIL_LOCKED(&pr->ps_threads, p, p_thr_link); + TAILQ_INIT(&pr->ps_threads); + TAILQ_INSERT_TAIL(&pr->ps_threads, p, p_thr_link); pr->ps_refcnt = 1; p->p_p = pr; @@ -559,7 +558,7 @@ thread_fork(struct proc *curp, void *stack, void *tcb, pid_t *tidptr, LIST_INSERT_HEAD(&allproc, p, p_list); LIST_INSERT_HEAD(TIDHASH(p->p_tid), p, p_hash); - SMR_TAILQ_INSERT_TAIL_LOCKED(&pr->ps_threads, p, p_thr_link); + TAILQ_INSERT_TAIL(&pr->ps_threads, p, p_thr_link); /* * if somebody else wants to take us to single threaded mode, diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index d84ef5974c5..bbe709ea883 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_proc.c,v 1.89 2020/12/07 16:55:28 mpi Exp $ */ +/* $OpenBSD: kern_proc.c,v 1.90 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */ /* @@ -502,7 +502,7 @@ db_kill_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif) return; } - p = SMR_TAILQ_FIRST_LOCKED(&pr->ps_threads); + p = TAILQ_FIRST(&pr->ps_threads); /* Send uncatchable SIGABRT for coredump */ sigabort(p); @@ -558,7 +558,7 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif) while (pr != NULL) { ppr = pr->ps_pptr; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { #ifdef MULTIPROCESSOR if (__mp_lock_held(&kernel_lock, p->p_cpu)) has_kernel_lock = 1; diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 543f96ed7e2..3133d2b7edc 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_resource.c,v 1.70 2020/12/07 16:55:28 mpi Exp $ */ +/* $OpenBSD: kern_resource.c,v 1.71 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */ /*- @@ -212,7 +212,7 @@ donice(struct proc *curp, struct process *chgpr, int n) return (EACCES); chgpr->ps_nice = n; SCHED_LOCK(s); - SMR_TAILQ_FOREACH_LOCKED(p, &chgpr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &chgpr->ps_threads, p_thr_link) { setpriority(p, p->p_estcpu, n); } SCHED_UNLOCK(s); @@ -488,7 +488,7 @@ dogetrusage(struct proc *p, int who, struct rusage *rup) memset(rup, 0, sizeof(*rup)); /* add on all living threads */ - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { ruadd(rup, &q->p_ru); tuagg(pr, q); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ed3df27da58..6435794c833 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.271 2021/02/08 08:18:45 mpi Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.272 2021/02/08 10:51:01 mpi Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -925,7 +925,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type) * delayed. Otherwise, mark it pending on the * main thread. */ - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { /* ignore exiting threads */ if (q->p_flag & P_WEXIT) continue; @@ -1009,7 +1009,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type) * XXX delay processing of SA_STOP signals unless action == SIG_DFL? */ if (prop & (SA_CONT | SA_STOP) && type != SPROPAGATED) - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) if (q != p) ptsignal(q, signum, SPROPAGATED); @@ -2038,7 +2038,7 @@ single_thread_set(struct proc *p, enum single_thread_mode mode, int deep) pr->ps_singlecount = 0; membar_producer(); pr->ps_single = p; - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { if (q == p) continue; if (q->p_flag & P_WEXIT) { @@ -2130,7 +2130,7 @@ single_thread_clear(struct proc *p, int flag) SCHED_LOCK(s); pr->ps_single = NULL; atomic_clearbits_int(&pr->ps_flags, PS_SINGLEUNWIND | PS_SINGLEEXIT); - SMR_TAILQ_FOREACH_LOCKED(q, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { if (q == p || (q->p_flag & P_SUSPSINGLE) == 0) continue; atomic_clearbits_int(&q->p_flag, P_SUSPSINGLE); diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index c7f30eb92ba..45f97b2e604 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.175 2021/02/08 08:18:45 mpi Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.176 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -50,7 +50,6 @@ #include #include #include -#include #include #include @@ -599,7 +598,7 @@ sys_sched_yield(struct proc *p, void *v, register_t *retval) * can make some progress. */ newprio = p->p_usrpri; - SMR_TAILQ_FOREACH_LOCKED(q, &p->p_p->ps_threads, p_thr_link) + TAILQ_FOREACH(q, &p->p_p->ps_threads, p_thr_link) newprio = max(newprio, q->p_runpri); setrunqueue(p->p_cpu, p, newprio); p->p_ru.ru_nvcsw++; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 986f1a0b377..7125cbb2c04 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.388 2021/01/17 15:28:22 mvs Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.389 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1590,7 +1590,7 @@ again: if (!dothreads) continue; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { if (buflen >= elem_size && elem_count > 0) { fill_kproc(pr, kproc, p, show_pointers); error = copyout(kproc, dp, elem_size); @@ -1690,7 +1690,7 @@ fill_kproc(struct process *pr, struct kinfo_proc *ki, struct proc *p, } else { ki->p_pctcpu = 0; ki->p_stat = (pr->ps_flags & PS_ZOMBIE) ? SDEAD : SIDL; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { ki->p_pctcpu += p->p_pctcpu; /* find best state: ONPROC > RUN > STOP > SLEEP > .. */ if (p->p_stat == SONPROC || ki->p_stat == SONPROC) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 9a4d3c28a84..f160bfff057 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_witness.c,v 1.44 2021/01/28 15:13:27 visa Exp $ */ +/* $OpenBSD: subr_witness.c,v 1.45 2021/02/08 10:51:02 mpi Exp $ */ /*- * Copyright (c) 2008 Isilon Systems, Inc. @@ -1885,7 +1885,7 @@ witness_process_has_locks(struct process *pr) { struct proc *p; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { if (witness_thread_has_locks(p)) return (1); } @@ -2105,7 +2105,7 @@ db_witness_list_all(db_expr_t addr, int have_addr, db_expr_t count, char *modif) LIST_FOREACH(pr, &allprocess, ps_list) { if (!witness_process_has_locks(pr)) continue; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { if (!witness_thread_has_locks(p)) continue; db_printf("Process %d (%s) thread %p (%d)\n", diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 3af92ae8084..89ea3539caa 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.85 2020/12/07 16:55:29 mpi Exp $ */ +/* $OpenBSD: sys_process.c,v 1.86 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -301,7 +301,7 @@ ptrace_ctrl(struct proc *p, int req, pid_t pid, caddr_t addr, int data) error = ESRCH; goto fail; } - t = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads); + t = TAILQ_FIRST(&tr->ps_threads); break; /* calls that accept a PID or a thread ID */ @@ -561,9 +561,9 @@ ptrace_kstate(struct proc *p, int req, pid_t pid, void *addr) return ESRCH; if (t->p_p != tr) return EINVAL; - t = SMR_TAILQ_NEXT_LOCKED(t, p_thr_link); + t = TAILQ_NEXT(t, p_thr_link); } else { - t = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads); + t = TAILQ_FIRST(&tr->ps_threads); } if (t == NULL) @@ -754,7 +754,7 @@ process_tprfind(pid_t tpid, struct proc **tp) if (tr == NULL) return NULL; - *tp = SMR_TAILQ_FIRST_LOCKED(&tr->ps_threads); + *tp = TAILQ_FIRST(&tr->ps_threads); return tr; } } diff --git a/sys/kern/tty.c b/sys/kern/tty.c index bbeff325b9e..e8144b76ce0 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.166 2020/12/25 12:59:52 visa Exp $ */ +/* $OpenBSD: tty.c,v 1.167 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -2118,7 +2118,7 @@ process_sum(struct process *pr, fixpt_t *estcpup) ret = 0; estcpu = 0; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { if (p->p_stat == SRUN || p->p_stat == SONPROC) ret = 1; estcpu += p->p_pctcpu; @@ -2220,12 +2220,12 @@ update_pickpr: * - prefer living * Otherwise take the newest thread */ - pick = p = SMR_TAILQ_FIRST_LOCKED(&pickpr->ps_threads); + pick = p = TAILQ_FIRST(&pickpr->ps_threads); if (p == NULL) goto empty; run = p->p_stat == SRUN || p->p_stat == SONPROC; pctcpu = p->p_pctcpu; - while ((p = SMR_TAILQ_NEXT_LOCKED(p, p_thr_link)) != NULL) { + while ((p = TAILQ_NEXT(p, p_thr_link)) != NULL) { run2 = p->p_stat == SRUN || p->p_stat == SONPROC; pctcpu2 = p->p_pctcpu; if (run) { diff --git a/sys/sys/proc.h b/sys/sys/proc.h index c49015b2c8e..43178052472 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.307 2021/02/08 08:18:45 mpi Exp $ */ +/* $OpenBSD: proc.h,v 1.308 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -50,7 +50,6 @@ #include /* For struct rusage */ #include /* For struct rwlock */ #include /* For struct sigio */ -#include #ifdef _KERNEL #include @@ -157,9 +156,6 @@ struct unveil; * R rlimit_lock * S scheduler lock * T itimer_mtx - * - * For SMR related structures that allow lock-free reads, the write lock - * is indicated below. */ struct process { /* @@ -171,7 +167,7 @@ struct process { struct ucred *ps_ucred; /* Process owner's identity. */ LIST_ENTRY(process) ps_list; /* List of all processes. */ - SMR_TAILQ_HEAD(,proc) ps_threads; /* [K] Threads in this process. */ + TAILQ_HEAD(,proc) ps_threads; /* Threads in this process. */ LIST_ENTRY(process) ps_pglist; /* List of processes in pgrp. */ struct process *ps_pptr; /* Pointer to parent process. */ @@ -336,20 +332,16 @@ struct p_inentry { /* * Locks used to protect struct members in this file: * I immutable after creation - * K kernel lock + * S scheduler lock * l read only reference, see lim_read_enter() * o owned (read/modified only) by this thread - * S scheduler lock - * - * For SMR related structures that allow lock-free reads, the write lock - * is indicated below. */ struct proc { TAILQ_ENTRY(proc) p_runq; /* [S] current run/sleep queue */ LIST_ENTRY(proc) p_list; /* List of all threads. */ struct process *p_p; /* [I] The process of this thread. */ - SMR_TAILQ_ENTRY(proc) p_thr_link; /* [K] Threads in a process linkage */ + TAILQ_ENTRY(proc) p_thr_link; /* Threads in a process linkage. */ TAILQ_ENTRY(proc) p_fut_link; /* Threads in a futex linkage. */ struct futex *p_futex; /* Current sleeping futex. */ @@ -437,9 +429,8 @@ struct proc { #define SONPROC 7 /* Thread is currently on a CPU. */ #define P_ZOMBIE(p) ((p)->p_stat == SDEAD) -#define P_HASSIBLING(p) \ - (SMR_TAILQ_FIRST_LOCKED(&(p)->p_p->ps_threads) != (p) || \ - SMR_TAILQ_NEXT_LOCKED((p), p_thr_link) != NULL) +#define P_HASSIBLING(p) (TAILQ_FIRST(&(p)->p_p->ps_threads) != (p) || \ + TAILQ_NEXT((p), p_thr_link) != NULL) /* * These flags are per-thread and kept in p_flag diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c index 166152849df..e880997abc5 100644 --- a/sys/uvm/uvm_glue.c +++ b/sys/uvm/uvm_glue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_glue.c,v 1.77 2020/12/07 16:55:29 mpi Exp $ */ +/* $OpenBSD: uvm_glue.c,v 1.78 2021/02/08 10:51:02 mpi Exp $ */ /* $NetBSD: uvm_glue.c,v 1.44 2001/02/06 19:54:44 eeh Exp $ */ /* @@ -369,7 +369,7 @@ uvm_swapout_threads(void) * the smallest p_slptime */ slpp = NULL; - SMR_TAILQ_FOREACH_LOCKED(p, &pr->ps_threads, p_thr_link) { + TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { switch (p->p_stat) { case SRUN: case SONPROC: -- 2.20.1