small fix to the PI stuff, we lost the prio of the barrier waiter. --- Index: linux-2.6/kernel/workqueue.c =================================================================== --- linux-2.6.orig/kernel/workqueue.c +++ linux-2.6/kernel/workqueue.c @@ -264,6 +264,7 @@ struct wq_full_barrier { struct plist_head worklist; struct wq_full_barrier *prev_barrier; int prev_prio; + int waiter_prio; struct cpu_workqueue_struct *cwq; struct completion done; }; @@ -291,6 +292,7 @@ again: prio = work->entry.prio; if (unlikely(worklist != &cwq->worklist)) { prio = min(prio, cwq->barrier->prev_prio); + prio = min(prio, cwq->barrier->waiter_prio); prio = min(prio, plist_first(&cwq->worklist)->prio); } @@ -393,14 +395,15 @@ static void wq_full_barrier_func(struct struct wq_full_barrier *barrier = container_of(work, struct wq_full_barrier, work); struct cpu_workqueue_struct *cwq = barrier->cwq; + int prio = MAX_PRIO; spin_lock_irq(&cwq->lock); barrier->prev_barrier = cwq->barrier; if (cwq->barrier) { - barrier->prev_prio = min(cwq->barrier->prev_prio, - plist_first(&cwq->barrier->worklist)->prio); - } else - barrier->prev_prio = MAX_PRIO; + prio = min(prio, cwq->barrier->waiter_prio); + prio = min(prio, plist_first(&cwq->barrier->worklist)->prio); + } + barrier->prev_prio = prio; cwq->barrier = barrier; spin_unlock_irq(&cwq->lock); } @@ -415,6 +418,7 @@ static void insert_wq_full_barrier(struc plist_head_splice(&cwq->worklist, &barr->worklist); barr->cwq = cwq; init_completion(&barr->done); + barr->waiter_prio = current->normal_prio; insert_work(cwq, &barr->work, 0, current->normal_prio, 1); }
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- [RFC/PATCH 5/3] rt: PI-workqueue: fixup the barrier prio
- From: Peter Zijlstra <[email protected]>
- [RFC/PATCH 5/3] rt: PI-workqueue: fixup the barrier prio
- References:
- [RFC/PATCH 0/3] rt: workqueue PI support
- From: Peter Zijlstra <[email protected]>
- [RFC/PATCH 3/3] rt: PI-workqueue: fix barriers
- From: Peter Zijlstra <[email protected]>
- [RFC/PATCH 0/3] rt: workqueue PI support
- Prev by Date: Re: [PATCH] i386: fix TSC clock source calibration error [part 2]
- Next by Date: Re: tristate and bool not enogh for Kconfig anymore
- Previous by thread: [RFC/PATCH 3/3] rt: PI-workqueue: fix barriers
- Next by thread: [RFC/PATCH 5/3] rt: PI-workqueue: fixup the barrier prio
- Index(es):