From patchwork Fri Apr 7 10:05:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9669193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFD12602B3 for ; Fri, 7 Apr 2017 10:07:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF167285C5 for ; Fri, 7 Apr 2017 10:07:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B23B5285FF; Fri, 7 Apr 2017 10:07:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B429285C5 for ; Fri, 7 Apr 2017 10:07:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwQlr-0000iD-5a; Fri, 07 Apr 2017 10:05:35 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwQlq-0000i7-6h for xen-devel@lists.xenproject.org; Fri, 07 Apr 2017 10:05:34 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id D9/C2-19731-D6467E85; Fri, 07 Apr 2017 10:05:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRWlGSWpSXmKPExsXitHSDvW5OyvM Ig9UbjC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyVk1awFbRlVqycd4+tgbErvouRk0NCIETi /ooeRhCbV8BA4u/5NWxdjBwcwkDxudN9QcJsQOE3O/aygtgiAooSD17eBLK5OJgFTjBKPDx+A yzBIqAiMW1WDzOIzSlgKbFo5282kCIhgT9MEnMnLQBL8AtIStz68hHMZhaolmj9f5oR4ghtiS Pn+tkhjhCUODnzCQuILSSgJjFj7mXWCYx8s5C0zEJSBhF3kJh89hyUrSnRuv03O4StLbFs4Wt mCNtX4tv1n1A1oRK3rhyCshUlpnQ/hKq3lVi37j1U3EZi09UFjBC2vMT2t3OYFzByr2JUL04t Kkst0jXUSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCrWS87P3cQIjBYGINjBuPO50yFGSQ4mJ VFeBZ8nEUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeK8lPY8QEixKTU+tSMvMAcYtTFqCg0dJhP cUSJq3uCAxtzgzHSJ1ilFRSpz3RDJQQgAkkVGaB9cGSxWXGGWlhHkZgQ4R4ilILcrNLEGVf8U ozsGoJMw7CWQ8T2ZeCdz0V0CLmYAW+9x6CrK4JBEhJdXA2P7c/kx8/wtJpaWnZ9241Fu+ZoJb eolNcfUUPpMdky69+HlmXcAO62tpaWkXWzzCPbzN2bKjk+fOmxDxSX3GsbO+z3TcppRO9jGYM sGO5c51bRa5LDfmP6HP80NF6l+tDdDYt32j2ZZ44yVJeq+/Cn60mZnOmSUdpdn5UcpI3fnMQt 8tLG/klFiKMxINtZiLihMBrjMVwBADAAA= X-Env-Sender: prvs=2634eef2b=dario.faggioli@citrix.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1491559530!62588974!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32899 invoked from network); 7 Apr 2017 10:05:32 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 7 Apr 2017 10:05:32 -0000 X-IronPort-AV: E=Sophos;i="5.37,164,1488844800"; d="asc'?scan'208";a="426663763" Message-ID: <1491559501.3287.4.camel@citrix.com> From: Dario Faggioli To: Wei Liu Date: Fri, 7 Apr 2017 12:05:01 +0200 In-Reply-To: <20170407094212.obuxuv3dejrhb7vi@citrix.com> References: <148977585611.29510.906390949919041674.stgit@Palanthas.fritz.box> <148977619315.29510.17519562424807312146.stgit@Palanthas.fritz.box> <8c57725d-4bb7-7bd2-c74f-24486531ce94@citrix.com> <1491475775.18721.14.camel@citrix.com> <7f8ce88d-6f0b-196b-b237-f4213d12a6cc@citrix.com> <1491491913.18721.22.camel@citrix.com> <20170407094212.obuxuv3dejrhb7vi@citrix.com> Organization: Citrix Inc. X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) MIME-Version: 1.0 Cc: Stefano Stabellini , xen-devel@lists.xenproject.org, Julien Grall , Ian Jackson , George Dunlap Subject: Re: [Xen-devel] [PATCH 3/3] tools: sched: add support for 'null' scheduler X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 2017-04-07 at 10:42 +0100, Wei Liu wrote: > On Thu, Apr 06, 2017 at 05:18:33PM +0200, Dario Faggioli wrote: > > > > Wei acked this patch in v1 (20170321170902.ndk6h5ylyfkk4coo@citrix. > > com) > > but that was before you raised this, so I'm happy to resend with > > this > > changed, and doing whatever he prefers with his ack. > > > > Wei? > > I don't feel strongly about this. But if you want to return success > in > the get function, please make sure you initialise output to a known > state, instead of returning random garbage. > Sure. That should not be a problem, as libxl_domain_sched_params_get() calls, as the first thing it does, libxl_domain_sched_params_init(), which sets all scinfo fields to their default. Whatever I return, I won't touch scinfo at all, which means I'm just returning those defaults. So, can the below patch --which would make George much happier :-D --also have your Ack? Thanks and Regards, Dario --- tools: sched: add support for 'null' scheduler From: Dario Faggioli It being very very basic, also means this scheduler does not need much support at the tools level (for now). Basically, just the definition of the symbol of the scheduler itself and a couple of stubs. Signed-off-by: Dario Faggioli --- tools/libxl/libxl.h | 6 ++++++ tools/libxl/libxl_sched.c | 24 ++++++++++++++++++++++++ tools/libxl/libxl_types.idl | 1 + 3 files changed, 31 insertions(+) tools: sched: add support for 'null' scheduler From: Dario Faggioli It being very very basic, also means this scheduler does not need much support at the tools level (for now). Basically, just the definition of the symbol of the scheduler itself and a couple of stubs. Signed-off-by: Dario Faggioli Acked-by: Wei Liu Acked-by: Stefano Stabellini --- Cc: Ian Jackson Cc: George Dunlap Cc: Julien Grall --- tools/libxl/libxl.h | 6 ++++++ tools/libxl/libxl_sched.c | 24 ++++++++++++++++++++++++ tools/libxl/libxl_types.idl | 1 + 3 files changed, 31 insertions(+) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index a402236..cf8687a 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -210,6 +210,12 @@ #define LIBXL_HAVE_SCHED_RTDS 1 /* + * LIBXL_HAVE_SCHED_NULL indicates that the 'null' static scheduler + * is available. + */ +#define LIBXL_HAVE_SCHED_NULL 1 + +/* * libxl_domain_build_info has u.hvm.viridian_enable and _disable bitmaps * of the specified width. */ diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c index 84d3837..d763b9a 100644 --- a/tools/libxl/libxl_sched.c +++ b/tools/libxl/libxl_sched.c @@ -178,6 +178,20 @@ static int sched_arinc653_domain_set(libxl__gc *gc, uint32_t domid, return 0; } +static int sched_null_domain_set(libxl__gc *gc, uint32_t domid, + const libxl_domain_sched_params *scinfo) +{ + /* There aren't any domain-specific parameters to be set. */ + return 0; +} + +static int sched_null_domain_get(libxl__gc *gc, uint32_t domid, + libxl_domain_sched_params *scinfo) +{ + /* There aren't any domain-specific parameters to return. */ + return 0; +} + static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid, libxl_domain_sched_params *scinfo) { @@ -730,6 +744,9 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_RTDS: ret=sched_rtds_domain_set(gc, domid, scinfo); break; + case LIBXL_SCHEDULER_NULL: + ret=sched_null_domain_set(gc, domid, scinfo); + break; default: LOGD(ERROR, domid, "Unknown scheduler"); ret=ERROR_INVAL; @@ -758,6 +775,7 @@ int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_CREDIT: case LIBXL_SCHEDULER_CREDIT2: case LIBXL_SCHEDULER_ARINC653: + case LIBXL_SCHEDULER_NULL: LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler"); rc = ERROR_INVAL; break; @@ -792,6 +810,7 @@ int libxl_vcpu_sched_params_set_all(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_CREDIT: case LIBXL_SCHEDULER_CREDIT2: case LIBXL_SCHEDULER_ARINC653: + case LIBXL_SCHEDULER_NULL: LOGD(ERROR, domid, "per-VCPU parameter setting not supported for this scheduler"); rc = ERROR_INVAL; break; @@ -832,6 +851,9 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_RTDS: ret=sched_rtds_domain_get(gc, domid, scinfo); break; + case LIBXL_SCHEDULER_NULL: + ret=sched_null_domain_get(gc, domid, scinfo); + break; default: LOGD(ERROR, domid, "Unknown scheduler"); ret=ERROR_INVAL; @@ -858,6 +880,7 @@ int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_CREDIT: case LIBXL_SCHEDULER_CREDIT2: case LIBXL_SCHEDULER_ARINC653: + case LIBXL_SCHEDULER_NULL: LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler"); rc = ERROR_INVAL; break; @@ -890,6 +913,7 @@ int libxl_vcpu_sched_params_get_all(libxl_ctx *ctx, uint32_t domid, case LIBXL_SCHEDULER_CREDIT: case LIBXL_SCHEDULER_CREDIT2: case LIBXL_SCHEDULER_ARINC653: + case LIBXL_SCHEDULER_NULL: LOGD(ERROR, domid, "per-VCPU parameter getting not supported for this scheduler"); rc = ERROR_INVAL; break; diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index d970284..d42f6a1 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -191,6 +191,7 @@ libxl_scheduler = Enumeration("scheduler", [ (6, "credit2"), (7, "arinc653"), (8, "rtds"), + (9, "null"), ]) # Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN)