xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 4.7] xen: sched: avoid races on time values read from NOW()
@ 2016-05-19  8:11 Dario Faggioli
  2016-05-19  8:11 ` [PATCH] " Dario Faggioli
  2016-05-19 15:28 ` [PATCH for 4.7] " Meng Xu
  0 siblings, 2 replies; 8+ messages in thread
From: Dario Faggioli @ 2016-05-19  8:11 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Meng Xu, Wei Liu

Hey Wei,

Again, I'm using an otherwise unnecessary cover letter for my analysis about
<<should we include this in 4.7 or not?>>. :-)

I'd say yes, because the patch fixes an actual bug, in the form of a rather
subtle race condition, which was all but trivial to spot.  I must say, though,
that I've only found the bug guilty of being particularly nasty if we use
Credit2.  Actually, I'm quite sure it has an effect on RTDS too (although I did
not trace that), but since both Credit2 and RTDS are still marked as
experimental in 4.7, one may think it's not worthwhile putting in something
like this to fix experimental only code.

Just FYI, this bug is what was causing the issue I briefly chatted about on IRC
with George, yesterday, i.e., it is what led Credit2 to emit (rather
aggresively, actually) the debug printks showed here:

 http://pastebin.com/gzYrNST5

Well, TBF, Credit1 will certainly benefit from the fix as well, but Credit1
relies less than the other two schedulers on time and timestamps (and there
isn't sampling-vs-locking inversion in its own code after all), so the impact
is much smaller.

The fix itself is certainly self contained, as it only touches scheduling, and
the whay in which it alters generic scheduler code, is indeed straightforward,
and hence low risk.

So, given all this, my opinion is that we should consider it for 4.7.

In any case (I mean, 4.7 or not), after it will hit staging, it should be
backported.

Thanks and Regards,
Dario

---
Dario Faggioli (1):
      xen: sched: avoid races on time values read from NOW()

 xen/common/sched_credit2.c |    4 ++--
 xen/common/sched_rt.c      |    7 +++++--
 xen/common/schedule.c      |    4 +++-
 3 files changed, 10 insertions(+), 5 deletions(-)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-05-24 12:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19  8:11 [PATCH for 4.7] xen: sched: avoid races on time values read from NOW() Dario Faggioli
2016-05-19  8:11 ` [PATCH] " Dario Faggioli
2016-05-19  9:26   ` George Dunlap
2016-05-19 11:01   ` Wei Liu
2016-05-19 15:22   ` Meng Xu
2016-05-24 10:08   ` Jan Beulich
2016-05-24 12:12     ` Dario Faggioli
2016-05-19 15:28 ` [PATCH for 4.7] " Meng Xu

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).