Page MenuHomeFreeBSD

D23492.diff
No OneTemporary

D23492.diff

Index: head/sys/kern/sched_ule.c
===================================================================
--- head/sys/kern/sched_ule.c
+++ head/sys/kern/sched_ule.c
@@ -2605,15 +2605,17 @@
sched_setpreempt(td);
#else
tdq = TDQ_SELF();
- TDQ_LOCK(tdq);
/*
* Now that the thread is moving to the run-queue, set the lock
* to the scheduler's lock.
*/
- if ((flags & SRQ_HOLD) != 0)
- td->td_lock = TDQ_LOCKPTR(tdq);
- else
- thread_lock_set(td, TDQ_LOCKPTR(tdq));
+ if (td->td_lock != TDQ_LOCKPTR(tdq)) {
+ TDQ_LOCK(tdq);
+ if ((flags & SRQ_HOLD) != 0)
+ td->td_lock = TDQ_LOCKPTR(tdq);
+ else
+ thread_lock_set(td, TDQ_LOCKPTR(tdq));
+ }
tdq_add(tdq, td, flags);
if (!(flags & SRQ_YIELDING))
sched_setpreempt(td);

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 2:10 PM (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14886531
Default Alt Text
D23492.diff (741 B)

Event Timeline