From patchwork Fri Apr 7 00:34:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9668673 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 1EF7560146 for ; Fri, 7 Apr 2017 00:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20A502847C for ; Fri, 7 Apr 2017 00:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14AC4285EC; Fri, 7 Apr 2017 00:36:35 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID 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 9C76B2847C for ; Fri, 7 Apr 2017 00:36:34 +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 1cwHr9-0005rl-HH; Fri, 07 Apr 2017 00:34:27 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwHr8-0005rH-GZ for xen-devel@lists.xenproject.org; Fri, 07 Apr 2017 00:34:26 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 70/5C-27545-19ED6E85; Fri, 07 Apr 2017 00:34:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRWlGSWpSXmKPExsVyMbThsO7Ee88 iDI6nWHzfMpnJgdHj8IcrLAGMUayZeUn5FQmsGX+vuBfcU65on/CHqYFxt0wXIxeHkMBMRont R24zdzFycrAIrGGVmPtLGCQhIXCJVeLr2uMsIAkJgTiJBbOXMkPYNRL3G8+B2UICKhI3t69ig pj0m1Giccd7JpCEsICexJGjP9ghbDeJ5de+gjWwCRhIvNmxlxXEFhFQkri3ajJYM7PAUUaJ6Y tvQp2hKnG/4wXYIF4Bb4k1L7+ygdicAj4Sbydth9rsLXFm/yewuKiAnMTKyy2sEPWCEidnPgG 6mgNoqKbE+l36IGFmAXmJ7W/nME9gFJmFpGoWQtUsJFULGJlXMWoUpxaVpRbpGhnrJRVlpmeU 5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEBj8DEOxg/DM/8BCjJAeTkiivgs+TCCG+pPyUy ozE4oz4otKc1OJDjDIcHEoSvNV3n0UICRalpqdWpGXmAOMQJi3BwaMkwisOkuYtLkjMLc5Mh0 idYjTmeHH5/Xsmjicrf7xnEmLJy89LlRLnDQEpFQApzSjNgxsESw+XGGWlhHkZgU4T4ilILcr NLEGVf8UozsGoJMw7F2QKT2ZeCdy+V0CnMAGd4nPrKcgpJYkIKakGRtngj0eYE76+3N3Czbvl SIGG43dF35PlbP+uCP3SOXBc/ExcqPIv3oXvrvjwfVf5WepUEH7rzoWYWW2NJ5v25c5e61t3U U5pnYgVe94XpUO3Q+e6PHJ8YZhl/LUqYdYe0TuWB5MNeac8OJN3osTO6YTTVE39HzNe/k1f1C V5YYOO35NAvoo9eUosxRmJhlrMRcWJABn6XzoKAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1491525264!65588262!1 X-Originating-IP: [209.85.128.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46346 invoked from network); 7 Apr 2017 00:34:24 -0000 Received: from mail-wr0-f195.google.com (HELO mail-wr0-f195.google.com) (209.85.128.195) by server-11.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Apr 2017 00:34:24 -0000 Received: by mail-wr0-f195.google.com with SMTP id o21so10540450wrb.3 for ; Thu, 06 Apr 2017 17:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=iapCNQpoPk4IjSxyJ/FXkousli5Zl+5ds7k1dBukJt0=; b=aPEotBsa1DGXtHLEw4TY3z3FJoQbXNZVt5dy/akQZll/Jifea5MygkmpxrBghP33Dc P/9MItIrpeTYB/MSElxe7PDuN4TCsJoPg0NTiK2tQ4nuS5t4naWJl/fmnPBGnEZDC7gr uPZbyvXqsHX7pQtm+d/irMTMPBYUHg8eQSS46J0LE/S1EcCs/ccgBLMk1ilMzzgvTYuW 99PzDNnaqfS+I0ZVKeAMUsU8WBK9YbzoldwYeKtevqHD3V6bZibGHBT7Pp7yeFemw5O5 AZqz9Z0jl365BuQYmkSzitJZjnchjS1a7Iqn84/Opvv1q/vT5/W0Bs176XAZNR51ds40 WlkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=iapCNQpoPk4IjSxyJ/FXkousli5Zl+5ds7k1dBukJt0=; b=T21QnWmGyhDiEBHkfbbKPeuEhTnQ1cynH/yquo4RkJ5RkrTYsF9HPOxT5DJ/Kbq7lZ CHNM/GSLMXmYzzprqlZ/b5lGnAVxm1hAxCGLyfJTt/lDtozo4byvs8vkA3js451ngtAL XjUFIgxMnZ1bY8CKf7cL6VWvJLSZwKlDrrPhgaTmsnDTHD2+PyswqXMQ8FRgtnnjwoZi RfECBeb9iJ7OUBwM4lCcoQ2BiaEe+CVP7CxI3Y1exrvT2xoxvzqzujL8J8rVRoGoiRF9 HNNbiJZnaTkaAU2WiN7MmCa39vXcOyinzN3fYjl7bUZWX45uesd1QY+bNSRDDYz+rOuL zdRQ== X-Gm-Message-State: AFeK/H2EWh18XxhDZ9wJ3Kg0gS4BlxPeLL90q1fwAmdLf9OvdLekuO1Q x6bucodLAMuNjw== X-Received: by 10.28.100.196 with SMTP id y187mr25796046wmb.129.1491525264697; Thu, 06 Apr 2017 17:34:24 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.217]) by smtp.gmail.com with ESMTPSA id i203sm1680459wmf.12.2017.04.06.17.34.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 17:34:23 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 07 Apr 2017 02:34:22 +0200 Message-ID: <149152526240.31941.7706475665354596483.stgit@Solace.fritz.box> In-Reply-To: <149152426922.31941.6054159629649244529.stgit@Solace.fritz.box> References: <149152426922.31941.6054159629649244529.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Stefano Stabellini , Ian Jackson , Julien Grall , Wei Liu , George Dunlap Subject: [Xen-devel] [PATCH v2 5/5] 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 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..d44fbe1 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) +{ + /* The null scheduler doesn't take any domain-specific parameters. */ + return 0; +} + +static int sched_null_domain_get(libxl__gc *gc, uint32_t domid, + libxl_domain_sched_params *scinfo) +{ + /* The null scheduler doesn't have any domain-specific parameters. */ + return ERROR_INVAL; +} + 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)