[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 00/12] libxl: fork: SIGCHLD flexibility
Ian Campbell wrote: > On Fri, 2014-01-24 at 12:41 +0000, Ian Jackson wrote: > > >> Thread A Thread B >> >> invoke some libxl operation >> X do some libxl stuff >> X register timeout (libxl) >> XV record timeout info >> X do some more libxl stuff >> ... >> X do some more libxl stuff >> X deregister timeout (libxl internal) >> X converted to request immediate timeout >> XV record new timeout info >> X release libvirt event loop lock >> entering libvirt event loop >> V observe timeout is immediate >> > > Is there nothing in this interval which deregisters, pauses, quiesces or > otherwise prevents the timer from going off again until after the > callback (when the lock would be reacquired and whatever was done is > undone)? > The libvirt libxl driver will disable the timeout in libvirt's event loop before calling libxl_osevent_occurred_timeout. But AFAICT, and as Ian J. describes, another thread running the event loop could invoke the timeout before it is disabled. I think this could be handled in the libxl driver as described in my response to his mail. > (V is the libvirt event loop lock I presume?) > > >> V need to do callback >> call libxl driver >> >> entering libvirt event loop >> V observe timeout is immediate >> > > Given the behaviour I suggest above this would be prevented I think? > > >> But if you think about it, if you have 10 threads all running the >> event loop and you set a timeout to zero, doesn't that mean that every >> thread's event loop should do the timeout callback as fast as it can ? >> That could be a lot of wasted effort. >> > > It doesn't seem all that likely triggering the same timeout multiple > times in different threads simultaneously would be a deliberate design > decision, so if the libvirt event core doesn't already prevent this > somehow then it seems to me that this is just a bug in the event loop > core. > If I understand the code correctly, it does seem possible to trigger the same timeout multiple times. > In that case should be addressed in libvirt, and in any case the libvirt > core folks should be involved in the discussion, so they have the > opportunity to tell us how best, if at all, we can use the provided > facilities and/or whether these issues are deliberate of things which > should be fixed etc. > Agreed. I'll mention the issue and this discussion on the libvirt IRC channel tomorrow. Regards, Jim _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |