Messages in this thread | | | Date | Wed, 28 Aug 2013 17:13:12 -0400 | From | Tejun Heo <> | Subject | Re: [PATCH] workqueue: defer to waiting stop_machine |
| |
On Wed, Aug 28, 2013 at 02:07:12PM -0700, Jamie Liu wrote: ... > @@ -734,7 +735,8 @@ static bool may_start_working(struct worker_pool *pool) > static bool keep_working(struct worker_pool *pool) > { > return !list_empty(&pool->worklist) && > - atomic_read(&pool->nr_running) <= 1; > + atomic_read(&pool->nr_running) <= 1 && > + likely(!stop_machine_pending());
Isn't the problem that the kworker wouldn't yield to the higher priority stopper task while a work item keeps requeueing itself if preemption is not enabled? If so, isn't the correct solution just adding cond_resched() in the work item processing loop? The analysis and solution seem to have gone a bit stray....
Thanks.
-- tejun
| |