54 #include <linux/export.h>
55 #include <linux/wait.h>
56 #include <linux/sched.h>
57 #include <linux/slab.h>
62 #define MAX_WORK 32768
91 if (!list_empty(&running->
domain)) {
97 if (entry->running == running)
109 ret = __lowest_in_progress(running);
110 spin_unlock_irqrestore(&async_lock, flags);
127 list_move_tail(&entry->
list, &running->
domain);
128 spin_unlock_irqrestore(&async_lock, flags);
140 delta = ktime_sub(rettime, calltime);
144 (
long long)ktime_to_ns(delta) >> 10);
151 list_del_init(&running->
node);
157 spin_unlock_irqrestore(&async_lock, flags);
179 newcookie = next_cookie++;
180 spin_unlock_irqrestore(&async_lock, flags);
183 ptr(data, newcookie);
192 newcookie = entry->
cookie = next_cookie++;
197 spin_unlock_irqrestore(&async_lock, flags);
215 return __async_schedule(ptr, data, &async_running);
234 return __async_schedule(ptr, data, running);
249 spin_lock_irq(&async_lock);
250 if (!list_empty(&async_domains))
252 spin_unlock_irq(&async_lock);
255 }
while (!list_empty(&async_domains));
272 spin_lock_irq(&async_lock);
274 !list_empty(&domain->
domain));
276 spin_unlock_irq(&async_lock);
315 wait_event(async_done, lowest_in_progress(running) >= cookie);
319 delta = ktime_sub(endtime, starttime);
323 (
long long)ktime_to_ns(delta) >> 10);