From patchwork Fri Mar 17 18:43:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9631203 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 58D2E60245 for ; Fri, 17 Mar 2017 18:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5079E2022B for ; Fri, 17 Mar 2017 18:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44EAA284E9; Fri, 17 Mar 2017 18:45:31 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 3690D2022B for ; Fri, 17 Mar 2017 18:45:30 +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 1cowqN-0005HD-5O; Fri, 17 Mar 2017 18:43:19 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cowqL-0005Gi-S0 for xen-devel@lists.xenproject.org; Fri, 17 Mar 2017 18:43:17 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 63/9F-02186-54E2CC85; Fri, 17 Mar 2017 18:43:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMIsWRWlGSWpSXmKPExsXiVRvkpOusdyb C4PMBVYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePeh8VsBZeUK6au38/SwLhepouRi0NIYAaj xJa9a1lAHBaBNawS6/78YAVxJAQusUoc7mlk6mLkBHJiJG5emMYMYZdL7Jw2ixXEFhJQkbi5f RUTxKg/jBJzFn5kBEkIC+hJHDn6gx3CdpaYtHYXWDObgIHEmx17wZpFBJQk7q2aDNbMLHCUUW L64ptARRxAd6hK/FgEVs8r4C/x9OF8sJmcAn4Spz6vZYZY7Ctx/MZ+FhBbVEBOYuXlFlaIekG JkzOfsICMYRbQlFi/Sx8kzCwgL7H97RzmCYwis5BUzUKomoWkagEj8ypGjeLUorLUIl1DE72k osz0jJLcxMwcXUMDU73c1OLixPTUnMSkYr3k/NxNjMAIYACCHYxnT3seYpTkYFIS5bWWORMhx JeUn1KZkVicEV9UmpNafIhRhoNDSYJ3lw5QTrAoNT21Ii0zBxiLMGkJDh4lEd69IGne4oLE3O LMdIjUKUZdjg/9h98wCbHk5eelSonzWoMUCYAUZZTmwY2ApYVLjLJSwryMQEcJ8RSkFuVmlqD Kv2IU52BUEuZ9BjKFJzOvBG7TK6AjmICOePvhBMgRJYkIKakGxs3Fzg/O7F9n4XTW/fw1v4UL Wn/46LYcsAlPar98aV3S4ZNBzGcqMuPybq574Z7n/HGioNLeN/t5N53JO3S+ZKZ9TSC/upqKl LjiROY62YwqJ9357fm+hUbvGhjfKcnNuFpcy961Vk5wxySL1w6WnIfq21dulTJfZbPm4OGdBk 5id+0bGWufKrEUZyQaajEXFScCALXehb0GAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1489776195!88431892!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 374 invoked from network); 17 Mar 2017 18:43:15 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-5.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Mar 2017 18:43:15 -0000 Received: by mail-wm0-f66.google.com with SMTP id x124so4645973wmf.3 for ; Fri, 17 Mar 2017 11:43:15 -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=bJasK+sihk/E6cImBUjrScUYZiqWFonM8+iFpmsa2nI=; b=hWV1sUn5q7zCkrAtuJG7stlgomz7uzg/gg0/ekPufQh9lLXfXeK1gIl303Rvo9/IKp yx9i4kLjO23AZUkhDMkMRR6q5uYppHkGunN5O5b+k8Pqhxq3sTfQxS8JBhU3JZ89KlEw Ki2xkl0luwsX9sRXfhdQpF24TdQvmLZJGcrxc3YnNcqqHR50KGjpnf5Z3woj9Ngmy/iZ NoPRvHRS0hiwdddR/ElE4a2jtFZPoWKIr3mM4kObYGvUEeSzRld1cqKYxhytyogxHZ7k I8HxZ/ugmUHtl3qmcdYxWJd+FxAWQxm0Ea481JnAatsYAeCv1xd0ycWUjg7NAAoF6z48 gUtw== 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=bJasK+sihk/E6cImBUjrScUYZiqWFonM8+iFpmsa2nI=; b=NhX3dpcF2WYHx4+37wFXiRmNyXRqDS6HzdcGWXaUqvYAgjadizLpF/WYjEn/8LKOp1 W0/MH1Zex+DiCxUN0TgOhUeSRmjWfORVGlrc9REZk2nXzdLcADXpQsdr0Tq++wu/8lBj zIe7jfVkXD/fmM7tJMwIGQli7iQrivjufj/gMNFBWbzTtkWqq6ADEhM6nES/59MuHJkr 1CwAnONbGmVDOEhe7cMnWD+c4t5RQURjDlz4aYdDUumjEtARg9aJ8YthaEvkgx3IdjYc sPASRcoDY8IirPA7Q9ZJvyWvfgf9mw49gv8qX7p4bu14RrnSp0qdwT5E5O7756ZgsndI tZDw== X-Gm-Message-State: AFeK/H3fElL4iCmZQljAYxp0SWnjAAN/sp4J6s/qzz7leTK79UylcSeEmIIv8wLvzn+y3w== X-Received: by 10.28.173.2 with SMTP id w2mr4082288wme.117.1489776195273; Fri, 17 Mar 2017 11:43:15 -0700 (PDT) Received: from Palanthas.fritz.box ([80.66.223.93]) by smtp.gmail.com with ESMTPSA id v21sm6347198wrd.58.2017.03.17.11.43.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 11:43:14 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 17 Mar 2017 19:43:13 +0100 Message-ID: <148977619315.29510.17519562424807312146.stgit@Palanthas.fritz.box> In-Reply-To: <148977585611.29510.906390949919041674.stgit@Palanthas.fritz.box> References: <148977585611.29510.906390949919041674.stgit@Palanthas.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 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 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: Stefano Stabellini Acked-by: Wei Liu --- Cc: Wei Liu Cc: Ian Jackson Cc: George Dunlap Cc: Stefano Stabellini 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 4c60e8f..5adac2d 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 6d28dea..ce733c4 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)