From: Ian Campbell Subject: Re: [PATCH] full support of setting scheduler parameters on domain creation Date: Mon, 21 May 2012 13:07:51 +0100 Message-ID: <1337602071.24660.99.camel@zakaz.uk.xensource.com> References: <10457bda81c6aea95bbf.1337600810@nehalem1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <10457bda81c6aea95bbf.1337600810@nehalem1> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-05-21 at 12:46 +0100, Juergen Gross wrote: > Obtains current scheduler parameters before modifying any settings specified > via domain config. Only specified settings must be modified, of course! > I presume this will fix the libxl: error: libxl.c:3208:libxl_sched_credit_domain_set: Cpu weight out of range, valid values are within range from 1 to 65535 warning we are currently seeing? Thanks! > @@ -233,6 +233,14 @@ libxl_sched_params = Struct("sched_param > ("slice", integer), > ("latency", integer), > ("extratime", integer), > + ("set_weight", bool), > + ("set_cap", bool), > + ("set_tslice_ms", bool), > + ("set_ratelimit_us", bool), > + ("set_period", bool), > + ("set_slice", bool), > + ("set_latency", bool), > + ("set_extratime", bool), Rather than doing this it would be preferable to identify some specific value which means "default" for each of these fields. Generally this would be either 0 (preferred if possible) or ~0 or -1. You can then describe this in the IDL using the "init_val" property on each field. e.g.: @@ -225,7 +225,7 @@ libxl_domain_create_info = Struct("domai MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT") libxl_sched_params = Struct("sched_params",[ - ("weight", integer), + ("weight", integer, {'init_val': -1}), ("cap", integer), ("tslice_ms", integer), ("ratelimit_us", integer), (just as an illustration of a non-zero default, I suspect 0 would actually be a fine default value for weight, and 0 is the default init_val) Then libxl_sched_params_init, which xl must call (perhaps indirectly, e.g. via libxl_domain_build_info_init) would set these defaults and xl would override them from the config and libxl would only set those which were non-default. Ian.