1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| 834
849 struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu) 850 { 851 struct worker *worker = kthread_data(task), *to_wakeup = NULL; 852 struct worker_pool *pool; 853 854
859 if (worker->flags & WORKER_NOT_RUNNING) 860 return NULL; 861 862 pool = worker->pool; 863 864 865 if (WARN_ON_ONCE(cpu != raw_smp_processor_id())) 866 return NULL; 867 868
879 if (atomic_dec_and_test(&pool->nr_running) && 880 !list_empty(&pool->worklist)) 881 to_wakeup = first_worker(pool); 882 return to_wakeup ? to_wakeup->task : NULL; 883 }
|