Revert the convertion of per-process thread into a SMR_TAILQ.
authormpi <mpi@openbsd.org>
Mon, 8 Feb 2021 10:51:01 +0000 (10:51 +0000)
committermpi <mpi@openbsd.org>
Mon, 8 Feb 2021 10:51:01 +0000 (10:51 +0000)
We did not reach a consensus about using SMR to unlock single_thread_set()
so there's no point in keeping this change.

15 files changed:
lib/libkvm/kvm_proc2.c
sys/kern/exec_elf.c
sys/kern/init_main.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_proc.c
sys/kern/kern_resource.c
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/kern/kern_sysctl.c
sys/kern/subr_witness.c
sys/kern/sys_process.c
sys/kern/tty.c
sys/sys/proc.h
sys/uvm/uvm_glue.c

index 259fdfe..7cc2ada 100644 (file)
@@ -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",
index dff4c99..4fa5ec2 100644 (file)
@@ -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 <sys/signalvar.h>
 #include <sys/stat.h>
 #include <sys/pledge.h>
-#include <sys/smr.h>
 
 #include <sys/mman.h>
 
@@ -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, &notesize);
index dd78c08..7902f2e 100644 (file)
@@ -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);
                }
index 89326bd..94e3981 100644 (file)
@@ -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 <sys/sem.h>
 #endif
-#include <sys/smr.h>
 #include <sys/witness.h>
 
 #include <sys/mount.h>
@@ -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);
index a8d2759..f8b8cc6 100644 (file)
@@ -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 <sys/acct.h>
 #include <sys/ktrace.h>
 #include <sys/sched.h>
-#include <sys/smr.h>
 #include <sys/sysctl.h>
 #include <sys/pool.h>
 #include <sys/mman.h>
@@ -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,
index d84ef59..bbe709e 100644 (file)
@@ -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;
index 543f96e..3133d2b 100644 (file)
@@ -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);
                }
index ed3df27..6435794 100644 (file)
@@ -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);
index c7f30eb..45f97b2 100644 (file)
@@ -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 <sys/pool.h>
 #include <sys/refcnt.h>
 #include <sys/atomic.h>
-#include <sys/smr.h>
 #include <sys/witness.h>
 #include <sys/tracepoint.h>
 
@@ -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++;
index 986f1a0..7125cbb 100644 (file)
@@ -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)
index 9a4d3c2..f160bff 100644 (file)
@@ -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",
index 3af92ae..89ea353 100644 (file)
@@ -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;
        }
 }
index bbeff32..e8144b7 100644 (file)
@@ -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) {
index c49015b..4317805 100644 (file)
@@ -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 <sys/resource.h>              /* For struct rusage */
 #include <sys/rwlock.h>                        /* For struct rwlock */
 #include <sys/sigio.h>                 /* For struct sigio */
-#include <sys/smr.h>
 
 #ifdef _KERNEL
 #include <sys/atomic.h>
@@ -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
index 1661528..e880997 100644 (file)
@@ -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: