* When a delayed task timer expires remove it from the delay list and * add it to the priority list in order for immediate processing. */
| 215 | * add it to the priority list in order for immediate processing. |
| 216 | */ |
| 217 | static void |
| 218 | task_expire_impl(taskq_ent_t *t) |
| 219 | { |
| 220 | taskq_ent_t *w; |
| 221 | taskq_t *tq = t->tqent_taskq; |
| 222 | struct list_head *l = NULL; |
| 223 | unsigned long flags; |
| 224 | |
| 225 | spin_lock_irqsave_nested(&tq->tq_lock, flags, tq->tq_lock_class); |
| 226 | |
| 227 | if (t->tqent_flags & TQENT_FLAG_CANCEL) { |
| 228 | ASSERT(list_empty(&t->tqent_list)); |
| 229 | spin_unlock_irqrestore(&tq->tq_lock, flags); |
| 230 | return; |
| 231 | } |
| 232 | |
| 233 | t->tqent_birth = jiffies; |
| 234 | DTRACE_PROBE1(taskq_ent__birth, taskq_ent_t *, t); |
| 235 | |
| 236 | /* |
| 237 | * The priority list must be maintained in strict task id order |
| 238 | * from lowest to highest for lowest_id to be easily calculable. |
| 239 | */ |
| 240 | list_del(&t->tqent_list); |
| 241 | list_for_each_prev(l, &tq->tq_prio_list) { |
| 242 | w = list_entry(l, taskq_ent_t, tqent_list); |
| 243 | if (w->tqent_id < t->tqent_id) { |
| 244 | list_add(&t->tqent_list, l); |
| 245 | break; |
| 246 | } |
| 247 | } |
| 248 | if (l == &tq->tq_prio_list) |
| 249 | list_add(&t->tqent_list, &tq->tq_prio_list); |
| 250 | |
| 251 | spin_unlock_irqrestore(&tq->tq_lock, flags); |
| 252 | |
| 253 | wake_up(&tq->tq_work_waitq); |
| 254 | } |
| 255 | |
| 256 | static void |
| 257 | task_expire(spl_timer_list_t tl) |
no test coverage detected