[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 for Xen 4.7 4/4] xl: enable per-VCPU parameter settings for RTDS scheduler
On Tue, Mar 08, 2016 at 03:24:35PM -0600, Chong Li wrote: [...] > >> + case 'v': > >> + if (!strcmp(optarg, "all")) { /* get or set all vcpus of a domain > >> */ > >> + opt_all = 1; > >> + break; > >> + } > >> + if (v_index >= v_size) { /* vcpus array is full */ > >> + v_size *= 2; > >> + vcpus = xrealloc(vcpus, v_size); > >> + } > >> + vcpus[v_index++] = strtol(optarg, NULL, 10); > >> + opt_v = 1; > >> + break; > > > > I'm still not quite sure why this is written like this. What's the > > expected syntax of this command? The hunk to patch xl manpage is very > > terse... > > We have three arrays here, vcpus[], periods[] and budgets[]. If the xl > command is like (more examples at cover letter): > > xl sched-rtds -d vm1 -v 3 -p 500 -b 200 -v 1 -p 600 -b 300 (set the > scheduling parameters of two vcpus of vm1) > > then, the three arrays would be like: > > vcpus: [3, 1] > periods: [500, 600] > budgets: [200, 300] > > What makes this code complicated is the size of these three arrays > grows along with the > reading of OPTS. At the beginning, all three arrays have the size for > only one int. When > one array becomes full, we double its size. OK. In that case, please: 1. Introduce a helper function to double the size of the array. 2. Improve manual a bit, maybe with one or two examples. Wei. > > Chong > > > > -- > Chong Li > Department of Computer Science and Engineering > Washington University in St.louis _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |