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 Mon, Apr 22, 2024 at 02:45:52PM +0200, Marc Hartmayer wrote:
> 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.

Yes, we need to preserve that ordering, otherwise the events become
largely unusable.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
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