xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2 v4.1] libxl: fix event races exposed by libvirt
@ 2013-01-23 18:21 Ian Jackson
  2013-01-23 18:21 ` [PATCH 1/2] libxl: fix stale fd event callback race Ian Jackson
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: Ian Jackson @ 2013-01-23 18:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Jim Fehlig, Ian Campbell

This is the really honestly final version of these patches which are
needed to make Jim Fehlig's libvirt libxl driver work.

 1/2 libxl: fix stale fd event callback race
 2/2 libxl: fix stale timeout event callback race

It appears that I didn't run git-format-patch before git-send-email
when I sent out v4, so they are missing an important bugfix from Jim
Fehlig.  Sorry about that.

Ian.

^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH 0/2 v4] libxl: fix event races exposed by libvirt
@ 2013-01-23 16:08 Ian Jackson
  2013-01-23 16:08 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
  0 siblings, 1 reply; 26+ messages in thread
From: Ian Jackson @ 2013-01-23 16:08 UTC (permalink / raw)
  To: xen-devel; +Cc: Jim Fehlig

This is the final version of these patches which are needed to make
Jim Fehlig's libvirt libxl driver work.

 1/2 libxl: fix stale fd event callback race
 2/2 libxl: fix stale timeout event callback race

They are identical to the previous posting apart from commit messages
and fixing the bug Jim mentioned in <50FD98DC.4020203@suse.com>.

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister
@ 2012-12-10 16:56 Ian Jackson
  2012-12-10 16:57 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
  0 siblings, 1 reply; 26+ messages in thread
From: Ian Jackson @ 2012-12-10 16:56 UTC (permalink / raw)
  To: Ian Campbell, Bamvor Jian Zhang, xen-devel@lists.xen.org,
	jfehlig@suse.com

Ian Jackson writes ("Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister"):
> I'm not surprised that the original patch makes Bamvor's symptoms go
> away.  Bamvor had one of the possible races (the fd-related one) but
> not the other.

Here (followups to this message, shortly) is v3 of my two-patch series
which after conversation with Ian C I think fully fixes the race, and
which I have tested now.

Bamvor, can you test this and let us know hwether it fixes your problem?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister
@ 2012-12-07 19:11 Ian Jackson
  2012-12-07 19:15 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
  2012-12-07 19:21 ` Ian Jackson
  0 siblings, 2 replies; 26+ messages in thread
From: Ian Jackson @ 2012-12-07 19:11 UTC (permalink / raw)
  To: Ian Campbell; +Cc: jfehlig@suse.com, xen-devel@lists.xen.org, Bamvor Jian Zhang

Ian Campbell writes ("Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister"):
> Can we provide, or (more likely) require the application to provide, a
> lock (perhaps per-event or, again more likely, per-event-loop) which
> must be held while processing callbacks and also while events are being
> registered/unregistered with the application's event handling subsystem?
> With such a lock in place the application would be able to guarantee
> that having returned from the deregister hook any further events would
> be seen as spurious events by its own event processing loop.

I think this might be difficult to get right without deadlocks.

...
> Last half brained idea would be to split the deregistration into two.
> libxl calls up to the app saying "please deregister" and the app calls
> back to libxl to say "I am no longer watching for this event and
> guarantee that I won't deliver it any more". (Presumably this would be
> implemented by the application via some combination of the above). This
> could be done in a somewhat compatible way by allowing the deregister
> hook to return "PENDING".

This is in fact straightforward and is a subset of the existing API.
If we have libxl always call timeout_modify with abs={0,0}, it will
get timeout_occurred when the application's event loop has dealt with
it.  We can simply never call timeout_deregister.

I have implemented this in the 2-patch RFD series I'm about to send.
NB this series has been complied but not (as yet) executed by me...

Ian.

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2013-01-24 13:01 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 18:21 [PATCH 0/2 v4.1] libxl: fix event races exposed by libvirt Ian Jackson
2013-01-23 18:21 ` [PATCH 1/2] libxl: fix stale fd event callback race Ian Jackson
2013-01-23 18:21 ` [PATCH 2/2] libxl: fix stale timeout " Ian Jackson
2013-01-23 19:08 ` [PATCH 0/2 v4.1] libxl: fix event races exposed by libvirt Jim Fehlig
2013-01-24 10:21 ` Ian Campbell
2013-01-24 13:01 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2013-01-23 16:08 [PATCH 0/2 v4] " Ian Jackson
2013-01-23 16:08 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
2013-01-23 17:48   ` Jim Fehlig
2012-12-10 16:56 [PATCH] fix race condition between libvirtd event handling and libxl fd deregister Ian Jackson
2012-12-10 16:57 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
2012-12-11 22:53   ` Jim Fehlig
2012-12-12 17:14     ` Ian Jackson
2012-12-12 17:16       ` Ian Jackson
2012-12-12 17:26       ` Jim Fehlig
2012-12-12 17:37         ` Ian Jackson
2012-12-12 18:01           ` Jim Fehlig
2012-12-13 10:29             ` Ian Campbell
2012-12-13 13:12               ` Ian Jackson
2012-12-13 15:53               ` Jim Fehlig
2012-12-13 15:58                 ` Ian Jackson
2012-12-13 16:53                   ` Jim Fehlig
2012-12-13 13:07             ` Ian Jackson
2012-12-13 15:41               ` Jim Fehlig
2012-12-13 15:51                 ` Ian Jackson
2012-12-13 15:57                   ` Jim Fehlig
2012-12-07 19:11 [PATCH] fix race condition between libvirtd event handling and libxl fd deregister Ian Jackson
2012-12-07 19:15 ` [PATCH 2/2] libxl: fix stale timeout event callback race Ian Jackson
2012-12-07 19:21 ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).