[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240205044817.593-1-hdanton@sina.com>
Date: Mon, 5 Feb 2024 12:48:17 +0800
From: Hillf Danton <hdanton@...a.com>
To: Tejun Heo <tj@...nel.org>
Cc: torvalds@...ux-foundation.org,
mpatocka@...hat.com,
linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
allen.lkml@...il.com
Subject: Re: [PATCH v3 3/8] workqueue: Implement BH workqueues to eventually replace tasklets
On Sun, 4 Feb 2024 11:28:06 -1000 Tejun Heo <tj@...nel.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.
Powered by blists - more mailing lists