Messages in this thread | | | From | Hillf Danton <> | Subject | Re: [PATCH v3 3/8] workqueue: Implement BH workqueues to eventually replace tasklets | Date | Mon, 5 Feb 2024 12:48:17 +0800 |
| |
On Sun, 4 Feb 2024 11:28:06 -1000 Tejun Heo <tj@kernel.org> > +static void bh_worker(struct worker *worker) > +{ > + struct worker_pool *pool = worker->pool; > + int nr_restarts = BH_WORKER_RESTARTS; > + unsigned long end = jiffies + BH_WORKER_JIFFIES; > + > + raw_spin_lock_irq(&pool->lock); > + worker_leave_idle(worker); > + > + /* > + * This function follows the structure of worker_thread(). See there for > + * explanations on each step. > + */ > + if (!need_more_worker(pool)) > + goto done; > + > + WARN_ON_ONCE(!list_empty(&worker->scheduled)); > + worker_clr_flags(worker, WORKER_PREP | WORKER_REBOUND); > + > + do { > + struct work_struct *work = > + list_first_entry(&pool->worklist, > + struct work_struct, entry); > + > + if (assign_work(work, worker, NULL)) > + process_scheduled_works(worker); > + } while (keep_working(pool) && > + --nr_restarts && time_before(jiffies, end)); > + > + worker_set_flags(worker, WORKER_PREP); > +done: > + worker_enter_idle(worker); > + kick_pool(pool); > + raw_spin_unlock_irq(&pool->lock); > +}
I see no need to exec bh works for 2ms with irq disabled.
| |