Lines Matching defs:cct
675 struct ehca_cpu_comp_task *cct)
679 spin_lock_irqsave(&cct->task_lock, flags);
684 list_add_tail(&__cq->entry, &cct->cq_list);
685 cct->cq_jobs++;
686 wake_up(&cct->wait_queue);
691 spin_unlock_irqrestore(&cct->task_lock, flags);
697 struct ehca_cpu_comp_task *cct;
704 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
705 BUG_ON(!cct);
707 spin_lock_irqsave(&cct->task_lock, flags);
708 cq_jobs = cct->cq_jobs;
709 spin_unlock_irqrestore(&cct->task_lock, flags);
712 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu_id);
713 BUG_ON(!cct);
716 __queue_comp_task(__cq, cct);
719 static void run_comp_task(struct ehca_cpu_comp_task *cct)
724 spin_lock_irqsave(&cct->task_lock, flags);
726 while (!list_empty(&cct->cq_list)) {
727 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
728 spin_unlock_irqrestore(&cct->task_lock, flags);
734 spin_lock_irqsave(&cct->task_lock, flags);
738 list_del_init(cct->cq_list.next);
739 cct->cq_jobs--;
744 spin_unlock_irqrestore(&cct->task_lock, flags);
749 struct ehca_cpu_comp_task *cct = __cct;
755 add_wait_queue(&cct->wait_queue, &wait);
757 spin_lock_irq(&cct->task_lock);
758 cql_empty = list_empty(&cct->cq_list);
759 spin_unlock_irq(&cct->task_lock);
765 remove_wait_queue(&cct->wait_queue, &wait);
767 spin_lock_irq(&cct->task_lock);
768 cql_empty = list_empty(&cct->cq_list);
769 spin_unlock_irq(&cct->task_lock);
783 struct ehca_cpu_comp_task *cct;
785 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
786 spin_lock_init(&cct->task_lock);
787 INIT_LIST_HEAD(&cct->cq_list);
788 init_waitqueue_head(&cct->wait_queue);
789 cct->task = kthread_create(comp_task, cct, "ehca_comp/%d", cpu);
791 return cct->task;
797 struct ehca_cpu_comp_task *cct;
801 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
803 spin_lock_irqsave(&cct->task_lock, flags_cct);
805 task = cct->task;
806 cct->task = NULL;
807 cct->cq_jobs = 0;
809 spin_unlock_irqrestore(&cct->task_lock, flags_cct);
817 struct ehca_cpu_comp_task *cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
822 spin_lock_irqsave(&cct->task_lock, flags_cct);
824 list_splice_init(&cct->cq_list, &list);
827 cq = list_entry(cct->cq_list.next, struct ehca_cq, entry);
833 spin_unlock_irqrestore(&cct->task_lock, flags_cct);
842 struct ehca_cpu_comp_task *cct;
856 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
857 kthread_bind(cct->task, cpumask_any(cpu_online_mask));
863 cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
864 kthread_bind(cct->task, cpu);
865 wake_up_process(cct->task);