mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Remove TDF_DOING_SA
We cannot see a thread with the flag set in unsuspend, after we stopped doing SINGLE_ALLPROC from user processes. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36207
This commit is contained in:
parent
5e5675cb4b
commit
f829268bcc
@ -1243,12 +1243,8 @@ thread_single(struct proc *p, int mode)
|
|||||||
else
|
else
|
||||||
p->p_flag &= ~P_SINGLE_BOUNDARY;
|
p->p_flag &= ~P_SINGLE_BOUNDARY;
|
||||||
}
|
}
|
||||||
if (mode == SINGLE_ALLPROC) {
|
if (mode == SINGLE_ALLPROC)
|
||||||
p->p_flag |= P_TOTAL_STOP;
|
p->p_flag |= P_TOTAL_STOP;
|
||||||
thread_lock(td);
|
|
||||||
td->td_flags |= TDF_DOING_SA;
|
|
||||||
thread_unlock(td);
|
|
||||||
}
|
|
||||||
p->p_flag |= P_STOPPED_SINGLE;
|
p->p_flag |= P_STOPPED_SINGLE;
|
||||||
PROC_SLOCK(p);
|
PROC_SLOCK(p);
|
||||||
p->p_singlethread = td;
|
p->p_singlethread = td;
|
||||||
@ -1335,11 +1331,6 @@ thread_single(struct proc *p, int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PROC_SUNLOCK(p);
|
PROC_SUNLOCK(p);
|
||||||
if (mode == SINGLE_ALLPROC) {
|
|
||||||
thread_lock(td);
|
|
||||||
td->td_flags &= ~TDF_DOING_SA;
|
|
||||||
thread_unlock(td);
|
|
||||||
}
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1626,11 +1617,10 @@ thread_unsuspend(struct proc *p)
|
|||||||
if (!P_SHOULDSTOP(p)) {
|
if (!P_SHOULDSTOP(p)) {
|
||||||
FOREACH_THREAD_IN_PROC(p, td) {
|
FOREACH_THREAD_IN_PROC(p, td) {
|
||||||
thread_lock(td);
|
thread_lock(td);
|
||||||
if (TD_IS_SUSPENDED(td) && (td->td_flags &
|
if (TD_IS_SUSPENDED(td))
|
||||||
TDF_DOING_SA) == 0) {
|
|
||||||
wakeup_swapper |= thread_unsuspend_one(td, p,
|
wakeup_swapper |= thread_unsuspend_one(td, p,
|
||||||
true);
|
true);
|
||||||
} else
|
else
|
||||||
thread_unlock(td);
|
thread_unlock(td);
|
||||||
}
|
}
|
||||||
} else if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE &&
|
} else if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE &&
|
||||||
|
@ -470,15 +470,15 @@ do { \
|
|||||||
#define TDF_THRWAKEUP 0x00100000 /* Libthr thread must not suspend itself. */
|
#define TDF_THRWAKEUP 0x00100000 /* Libthr thread must not suspend itself. */
|
||||||
#define TDF_SEINTR 0x00200000 /* EINTR on stop attempts. */
|
#define TDF_SEINTR 0x00200000 /* EINTR on stop attempts. */
|
||||||
#define TDF_SWAPINREQ 0x00400000 /* Swapin request due to wakeup. */
|
#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_SCHED0 0x01000000 /* Reserved for scheduler private use */
|
||||||
#define TDF_SCHED1 0x02000000 /* Reserved for scheduler private use */
|
#define TDF_SCHED1 0x02000000 /* Reserved for scheduler private use */
|
||||||
#define TDF_SCHED2 0x04000000 /* Reserved for scheduler private use */
|
#define TDF_SCHED2 0x04000000 /* Reserved for scheduler private use */
|
||||||
#define TDF_SCHED3 0x08000000 /* Reserved for scheduler private use */
|
#define TDF_SCHED3 0x08000000 /* Reserved for scheduler private use */
|
||||||
#define TDF_UNUSED6 0x10000000 /* Available */
|
#define TDF_UNUSED7 0x10000000 /* Available */
|
||||||
#define TDF_UNUSED7 0x20000000 /* Available */
|
#define TDF_UNUSED8 0x20000000 /* Available */
|
||||||
#define TDF_UNUSED8 0x40000000 /* Available */
|
#define TDF_UNUSED9 0x40000000 /* Available */
|
||||||
#define TDF_UNUSED9 0x80000000 /* Available */
|
#define TDF_UNUSED10 0x80000000 /* Available */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TDA_AST = 0, /* Special: call all non-flagged AST handlers */
|
TDA_AST = 0, /* Special: call all non-flagged AST handlers */
|
||||||
|
Loading…
Reference in New Issue
Block a user