From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH 3 of 3] full support of setting scheduler parameters on domain creation Date: Tue, 22 May 2012 14:39:38 +0200 Message-ID: <4FBB890A.4060507@ts.fujitsu.com> References: <953383741ff44d97587c.1337678214@nehalem1> <1337689856.10118.100.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1337689856.10118.100.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 05/22/2012 02:30 PM, Ian Campbell wrote: >> # HG changeset patch >> # User Juergen Gross >> # Date 1337677423 -7200 >> # Node ID 953383741ff44d97587c2e75da79b092523d6e83 >> # Parent 19aaa30d7fdce2f1b56cb13399d603d955a61fb8 >> full support of setting scheduler parameters on domain creation >> >> Obtains default scheduler parameters before modifying any settings >> specified >> via domain config. >> >> Corrected an error for setting sedf parameters (setting .period >> multiple >> times). >> >> Signed-off-by: Juergen Gross >> >> diff -r 19aaa30d7fdc -r 953383741ff4 tools/libxl/libxl.h >> --- a/tools/libxl/libxl.h Tue May 22 10:31:30 2012 +0200 >> +++ b/tools/libxl/libxl.h Tue May 22 11:03:43 2012 +0200 >> @@ -605,6 +605,8 @@ int libxl_primary_console_exec(libxl_ctx >> /* May be called with info_r == NULL to check for domain's existance >> */ >> int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r, >> uint32_t domid); >> +int libxl_sched_set_defaults(libxl_ctx*, uint32_t poolid, >> + libxl_sched_params *scparams); > This interface really makes libxl_sched_params differ from all the other > libxl structs (which have a public _init function and an internal > setdefaults function). I'm not really sure its justified either, I was > under the impression that you'd found that there were useful > discriminating values? Dario opted for this solution, so I proposed a patch implementing it. I prefer this solution, too, as it isn't exporting scheduler internals to the tools. > If this function was called libxl_sched_init (replacing the > autogenerated one) then it might be ok. Although I'm still not really > sure what the issue is with having a discriminating value meaning > default is, doing that keeps the _init function cheap too. Okay, I can rename it. > >> int libxl__sched_set_params(libxl__gc *gc, uint32_t domid, >> libxl_sched_params *scparams) >> { >> libxl_ctx *ctx = libxl__gc_owner(gc); >> - libxl_scheduler sched; >> libxl_sched_sedf_domain sedf_info; >> libxl_sched_credit_domain credit_info; >> libxl_sched_credit2_domain credit2_info; >> int ret; >> >> - sched = libxl_get_scheduler (ctx); >> - switch (sched) { >> + switch (scparams->sched) { > What happens if scparams->sched is not the scheduler used for this > domain? Should it either be checked or set somewhere? The check would be the same as the original setting of scparams->sched. Setting of the scheduler parameters will be rejected by the hypervisor if the scheduler does not match. Juergen -- Juergen Gross Principal Developer Operating Systems PDG ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html