The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5ae39c02f22c08f65bb216b6449133fa45084349

commit 5ae39c02f22c08f65bb216b6449133fa45084349
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2022-08-12 20:25:00 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2022-09-03 01:17:36 +0000

    Remove TDF_DOING_SA
    
    (cherry picked from commit f829268bcc89bdede5e28044bfb6dc04fb0e9f8a)
---
 sys/kern/kern_thread.c | 16 +++-------------
 sys/sys/proc.h         |  2 +-
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 28de25d1ba18..846d3dafb5ac 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -1216,12 +1216,8 @@ thread_single(struct proc *p, int mode)
                else
                        p->p_flag &= ~P_SINGLE_BOUNDARY;
        }
-       if (mode == SINGLE_ALLPROC) {
+       if (mode == SINGLE_ALLPROC)
                p->p_flag |= P_TOTAL_STOP;
-               thread_lock(td);
-               td->td_flags |= TDF_DOING_SA;
-               thread_unlock(td);
-       }
        p->p_flag |= P_STOPPED_SINGLE;
        PROC_SLOCK(p);
        p->p_singlethread = td;
@@ -1308,11 +1304,6 @@ stopme:
                }
        }
        PROC_SUNLOCK(p);
-       if (mode == SINGLE_ALLPROC) {
-               thread_lock(td);
-               td->td_flags &= ~TDF_DOING_SA;
-               thread_unlock(td);
-       }
        return (0);
 }
 
@@ -1599,11 +1590,10 @@ thread_unsuspend(struct proc *p)
        if (!P_SHOULDSTOP(p)) {
                 FOREACH_THREAD_IN_PROC(p, td) {
                        thread_lock(td);
-                       if (TD_IS_SUSPENDED(td) && (td->td_flags &
-                           TDF_DOING_SA) == 0) {
+                       if (TD_IS_SUSPENDED(td))
                                wakeup_swapper |= thread_unsuspend_one(td, p,
                                    true);
-                       } else
+                       else
                                thread_unlock(td);
                }
        } else if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE &&
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 50e99d5a94c8..cd1b530095e9 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -460,7 +460,7 @@ do {                                                        
                \
 #define        TDF_THRWAKEUP   0x00100000 /* Libthr thread must not suspend 
itself. */
 #define        TDF_SEINTR      0x00200000 /* EINTR on stop attempts. */
 #define        TDF_SWAPINREQ   0x00400000 /* Swapin request due to wakeup. */
-#define        TDF_DOING_SA    0x00800000 /* Doing SINGLE_ALLPROC, do not 
unsuspend me */
+#define        TDF_UNUSED6     0x00800000 /* Available */
 #define        TDF_SCHED0      0x01000000 /* Reserved for scheduler private 
use */
 #define        TDF_SCHED1      0x02000000 /* Reserved for scheduler private 
use */
 #define        TDF_SCHED2      0x04000000 /* Reserved for scheduler private 
use */

Reply via email to