From: Ian Campbell Subject: Re: [PATCH] xl: check for meaningful combination of sedf config file parameters Date: Wed, 6 Jun 2012 12:07:20 +0100 Message-ID: <1338980840.32319.56.camel@zakaz.uk.xensource.com> References: <3eadab19abd49fbc6f56.1338818483@Solace> <1338978936.32319.49.camel@zakaz.uk.xensource.com> <1338980722.6152.30.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1338980722.6152.30.camel@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: George Dunlap , Juergen Gross , Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-06-06 at 12:05 +0100, Dario Faggioli wrote: > On Wed, 2012-06-06 at 11:35 +0100, Ian Campbell wrote: > > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > > > --- a/tools/libxl/xl_cmdimpl.c > > > +++ b/tools/libxl/xl_cmdimpl.c > > > @@ -561,6 +561,7 @@ static void parse_config_data(const char > > > long l; > > > XLU_Config *config; > > > XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids; > > > + int opt_w = 0, opt_p = 0, opt_s = 0; > > > > These names don't make much sense in this context. > > > Yeah, I agree... It's just I needed something :-/ > > > Perhaps you can just check each interesting option against the > > corresponding LIBXL_DOAIN_SCHED_PARAM_DEFAULT? > > > Mmm... I was mistakenly thinking these default values not to be there > yet, but I now see it. Yes, I guess I can do that. > > > That might make some long > > lines. Perhaps pulling this out into a separate valid_sched_params() > > would help with that? > > > Maybe, but what to put here depends on your thought on the below... > > > > if (!xlu_cfg_get_long (config, "latency", &l, 0)) > > > b_info->sched_params.latency = l; > > > if (!xlu_cfg_get_long (config, "extratime", &l, 0)) > > > b_info->sched_params.extratime = l; > > > + /* The sedf scheduler needs some more consistency checking */ > > > + if (opt_w && (opt_p || opt_s)) { > > > + fprintf(stderr, "Either specify a weight OR a period and slice\n"); > > > > Does this constrain you from setting valid combinations of credit* > > parameters? I think not since period and slice are SEDF specific. > > > I'd say not at all, for the exact reason you're suggesting. Then, if you > ask what happens if you boot with sched=credit and then try to specify > both a cpu_weight and a period, then yes, it will kick you out. > > The whole point is, period and slice are only meaningful for sedf so, if > you are using them, I take it like you meant to be using sedf, and thus > asking for a cpu_weight at the same time is wrong. > > Of course, one can think at it the other way around (scheduler is > credit, so cpu_weight is fine and period and slice should be ignored). > If that is better, I can add a libxl_is_the_scheduler_credit? kind of > check to that if... Lets keep it simple for now and go with the "don't do that" answer -- i.e. reject as invalid setting weight and period regardless of the actual scheduler in use. Ian.