Re: [PATCH v3] usb: gadget: uvc: increase worker prio to WQ_HIGHPRI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 19, 2022 at 10:33:32AM +0200, Greg KH wrote:
On Wed, Jul 20, 2022 at 04:46:41PM +0200, Michael Grzeschik wrote:
Likewise to the uvcvideo hostside driver, this patch is changing the

"Likewise" implies a previous patch being mentioned, which I do not see
here :(

I am not referring another patch but the uvcvideo driver.

drivers/media/usb/uvc/uvc_driver.c:

206         /* Allocate a stream specific work queue for asynchronous tasks. */
207         stream->async_wq = alloc_workqueue("uvcvideo", WQ_UNBOUND | WQ_HIGHPRI,
208                                            0);

I will add a clear reference in the commit message.

simple workqueue to an async_wq with higher priority. This ensures that
the worker will not be scheduled away while the video stream is handled.

How will this ensure that?  What happens if yet-another higher priority
task comes in?  This feels like a race that will just never be won
without fixing this properly.

There is no race between two functions calls. There is a race between userspace
filling the gadget isoc driver with data while the hardware is moving it
towards the kernel. To ensure no underrun, we increase the priority of the
buffer filling thread.

Okay. I will probably have to rephrase it to be clear.

Thanks,
Michael

--
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux