Amitayu Das
2006-May-03 05:48 UTC
[Xen-devel] Possible bugs and doubts about readjusting weights/slice-lengths from command prompt
Hi, I had few doubts/questions about readjusting slice/period length (or weights) for domains from command prompt. If someone can clarify, that''d be very nice. Here is the list (with respect to sedf scheduler): 1. Is is true that mentioning weights for a domain is setting a maximum limit for it so that it can''t go beyond that limit by setting extra flag on? If that''s the case, why in xen/common/scehd_sedf.c, a checking for extra flag is being made at first: if ( cmd->direction == SCHED_INFO_PUT ) { ... if (cmd->u.sedf.weight) { if ((cmd->u.sedf.extratime & EXTRA_AWARE) && (! cmd->u.sedf.period)) { /*weight driven domains with xtime ONLY!*/ ... Please let me know if I''m missing something. 2. Say, I''m readjusting the slice lengths of running domains. While doing that, I make a mistake by having sum of the slice-lengths higher than period-length. In such cases, what does Xen actually do? I did not find sanity-checking code for such cases in xen/common/sched_sedf.c. Please let me know in case it''s not there, why so or it''s there, only I did not find it. 3. I tried to modify/readjust the slice/period length (or weights) for domains from command prompt. However, I found out that changes are immaterial after first attempt. That is, no matter what changes I made at second or third or fourth time, they are not actually taking place. Only, the changes made during the first attempt actually took place. Please let me know if this is a bug in the existing code or I should have done the things in a different manner. Thanks in advance, Amitayu _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ryan Harper
2006-May-03 15:26 UTC
Re: [Xen-devel] Possible bugs and doubts about readjusting weights/slice-lengths from command prompt
* Amitayu Das <amitayudas@gmail.com> [2006-05-03 00:49]:> 2. Say, I''m readjusting the slice lengths of running domains. While doing > that, I make a mistake by having sum of the slice-lengths higher than > period-length. In such cases, what does Xen actually do? I did not find > sanity-checking code for such cases in xen/common/sched_sedf.c. Please let > me know in case it''s not there, why so or it''s there, only I did not find > it.For time-driven domains, versus weighted domains in sched_sedf.c:1407 /* * Sanity checking: note that disabling extra weight requires * that we set a non-zero slice. */ if ( (cmd->u.sedf.period > PERIOD_MAX) || (cmd->u.sedf.period < PERIOD_MIN) || (cmd->u.sedf.slice > cmd->u.sedf.period) || (cmd->u.sedf.slice < SLICE_MIN) ) return -EINVAL; period has bounds, slice cannot be greater than period, and slice cannot be smaller than SLICE_MIN. For any of these cases, the command will not succeed. You also might be interested in looking at tools/xm-test/tests/sedf which has some simple sedf scheduler tests.> > 3. I tried to modify/readjust the slice/period length (or weights) for > domains from command prompt. However, I found out that changes are > immaterial after first attempt. That is, no matter what changes I made at > second or third or fourth time, they are not actually taking place. Only, > the changes made during the first attempt actually took place. Please let me > know if this is a bug in the existing code or I should have done the things > in a different manner.Could you supply the xm sched-sedf commands and values you used? -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ryan Harper
2006-May-03 19:06 UTC
Re: [Xen-devel] Possible bugs and doubts about readjusting weights/slice-lengths from command prompt
* Amitayu Das <amitayudas@gmail.com> [2006-05-03 13:40]:> Hi, > > Thanks for the reply. Please find answers to your questions embedded below. > > On 5/3/06, Ryan Harper <ryanh@us.ibm.com> wrote: > > > >* Amitayu Das <amitayudas@gmail.com> [2006-05-03 00:49]: > > > >> 2. Say, I''m readjusting the slice lengths of running domains. While > >doing > >> that, I make a mistake by having sum of the slice-lengths higher than > >> period-length. In such cases, what does Xen actually do? I did not find > >> sanity-checking code for such cases in xen/common/sched_sedf.c. Please > >let > >> me know in case it''s not there, why so or it''s there, only I did not > >find > >> it. > > > >For time-driven domains, versus weighted domains in sched_sedf.c:1407 > > > > /* > > * Sanity checking: note that disabling extra weight requires > > * that we set a non-zero slice. > > */ > > if ( (cmd->u.sedf.period > PERIOD_MAX) || > > (cmd->u.sedf.period < PERIOD_MIN) || > > (cmd->u.sedf.slice > cmd->u.sedf.period) || > > (cmd->u.sedf.slice < SLICE_MIN) ) > > return -EINVAL; > > > >period has bounds, slice cannot be greater than period, and slice cannot > >be smaller than SLICE_MIN. For any of these cases, the command will not > >succeed. You also might be interested in looking at > >tools/xm-test/tests/sedf which has some simple sedf scheduler tests. > > > I talked about one situation with one example. Say, by default (Xen 3.0.1) > Dom0''s time-slice is 15 ms within period of 20 ms. Now I create two DomU''s > and then I specify their slice-lengths (assuming that I can do that, which > is not the case as I''m going to discuss w.r.t. point # 3 in my last mail. > I''ll come to that later) as 15 ms each (specifying a period length of 100ms > or 0.1s). Now, see my mistake. Dom0 will be getting 75 ms out of every 100 > ms and I''m left with 25 ms only; however, I''ve specified the slice-length as > 15 ms for each domain (or any value higher than 12.5 ms, so to say). Please > let me know if sanity checking for this kind of situation are there in Xen > and if there are, please let me know the location. Now please look into the > point # 3 below.I see. AFAIK, other than through setting weights, sedf scheduler does not check aggregate period/slice for all domains.> >> 3. I tried to modify/readjust the slice/period length (or weights) for > >> domains from command prompt. However, I found out that changes are > >> immaterial after first attempt. That is, no matter what changes I made > >at > >> second or third or fourth time, they are not actually taking place. > >Only, > >> the changes made during the first attempt actually took place. Please > >let me > >> know if this is a bug in the existing code or I should have done the > >things > >> in a different manner. > > > >Could you supply the xm sched-sedf commands and values you used? > > > I forgot to mention that I faced problems while changing the (slice, period) > pair muiltiple times for any domain. I did not have any problem in > changing/setting weight values for domains. However, examples of commands > used by me for changing (slice,period) pairs are as below: > (I''m trying to set (2, 20) for VM with id 2 and (3,20) for VM with id 3, > avoiding situations as mentioned in point # 2 above): > > xm sched-sedf 2 2000000 20000000 0 0 0 > xm sched-sedf 3 3000000 20000000 0 0 0Those commands don''t work because you need to specify what those values mean: [root@x460-3 ~]# xm help sched-sedf sched-sedf [DOM] [OPTIONS] Show|Set simple EDF parameters -p, --period Relative deadline(ms). -s, --slice Worst-case execution time(ms) (slice < period). -l, --latency scaled period(ms) in case the domain is doing heavy I/O. -e, --extra flag (0/1) which controls whether the domain can run in extra-time -w, --weight mutually exclusive with period/slice and specifies another way of setting a domain''s cpu period/slice. You probably want: xm sched-sedf 2 -p 20 -s 20.0 xm sched-sedf 3 -p 30 -s 30.0 I don''t have any problems setting slice/period multiple times: [root@x460-3 ~]# xm sched-sedf 2 Name ID Period(ms) Slice(ms) Lat(ms) Extra Weight dom2 2 50.0 50.0 0.0 1 0 [root@x460-3 ~]# xm sched-sedf 2 -p 20.0 -s 20.0 [root@x460-3 ~]# xm sched-sedf 2 Name ID Period(ms) Slice(ms) Lat(ms) Extra Weight dom2 2 20.0 20.0 0.0 1 0 [root@x460-3 ~]# xm sched-sedf 3 -p 30.0 -s 30.0 [root@x460-3 ~]# xm sched-sedf Name ID Period(ms) Slice(ms) Lat(ms) Extra Weight Domain-0 0 20.0 15.0 0.0 1 0 dom1 1 100.0 0.0 0.0 1 0 dom10 10 100.0 0.0 0.0 1 0 dom11 11 100.0 0.0 0.0 1 0 dom12 12 100.0 0.0 0.0 1 0 dom14 14 100.0 0.0 0.0 1 0 dom15 15 100.0 0.0 0.0 1 0 dom2 2 20.0 20.0 0.0 1 0 dom3 3 30.0 30.0 0.0 1 0 dom4 4 100.0 0.0 0.0 1 0 dom5 5 100.0 0.0 0.0 1 0 dom6 6 100.0 0.0 0.0 1 0 dom7 7 100.0 0.0 0.0 1 0 dom8 8 100.0 0.0 0.0 1 0 dom9 9 100.0 0.0 0.0 1 0 [root@x460-3 ~]# xm sched-sedf 2 -p 100.0 -s 50.0 [root@x460-3 ~]# xm sched-sedf 2 Name ID Period(ms) Slice(ms) Lat(ms) Extra Weight dom2 2 100.0 50.0 0.0 1 0> > These commands did not work even repeated multiple times or repeated with > different other values for the pair. The way we checked that is using a > program given by Diwaker > (please check > http://lists.xensource.com/archives/html/xen-users/2006-01/msg01228.html > ).The program looks fine, but xm sched-sedf <dom> displays same the information. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx (512) 838-9253 T/L: 678-9253 ryanh@us.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel