Re: [PATCH v1 16/20] node_device_udev: Use a worker pool for processing events and emitting nodedev event

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

 



On Fri, Apr 19, 2024 at 04:49 PM +0200, Marc Hartmayer <mhartmay@xxxxxxxxxxxxx> wrote:
> Use a worker pool for processing the events (e.g. udev, mdevctl config changes)
> and the initialization instead of a separate initThread and a mdevctl-thread.
> This has the large advantage that we can leverage the job API and now this
> thread pool is responsible to do all the "costly-work" and emitting the libvirt
> nodedev events.
>
> Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
> ---

[…snip…]

>  
> +    /* must be initialized before trying to reconnect to all the running mdevs
> +     * since there might occur some mdevctl monitor events that will be
> +     * dispatched to the worker pool */
> +    priv->workerPool = virThreadPoolNewFull(1, 1, 0,
> nodeDeviceEventHandler,

The more I think about the number of workers in this pool, the more I'm
convinced that it's (currently) important to use only _one_ worker (1
udev thread <-> 1 worker), because otherwise we don't have any
guarantees that we comply to the following:

order(udev_events) == order(libvirt nodedev events)

And I guess we would like to fulfill this guarantee.

If you agree, then we should add a comment to the code and if needed we
can implement something for the case #count > 1.

[…snip]

-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux