Re: [PATCH] wifi: wfx: add WQ_PERCPU to alloc_workqueue users

From: Sebastian Andrzej Siewior

Date: Thu Nov 13 2025 - 12:22:05 EST


On 2025-11-13 17:57:40 [+0100], Jérôme Pouiller wrote:
> > - wdev->bh_wq = alloc_workqueue("wfx_bh_wq", WQ_HIGHPRI, 0);
> > + wdev->bh_wq = alloc_workqueue("wfx_bh_wq", WQ_HIGHPRI | WQ_PERCPU, 0);

> BTW, this workqueue has changed multiple times. I though it was already
> unbound (and I believe it should).

It is not unbound. It can be enqueued on any CPU but the work item/
worker not migrate to another CPU should there be resources available)
compared to the CPU performing the enqueue.

> I also think the HIGHPRI is not required (the device perform better
> with HIGHPRI, but this is only because we steal the CPU of the other
> tasks).

HIGHPRI sets the nice level as per nice(2).
I did look a bit and one of the users is a threaded interrupt as of
wfx_spi_irq_handler(). This is already a thread with SCHED_FIFO 50.
You can sleep here or do anything else that you could in a workqueue.
This thread will be preferred to other threads in the system which run
usually at SCHED_OTHER including the worker.

Not sure if the requirement for the additional offload is to be able to
serve another interrupt before the worker completes.

Sebastian