From patchwork Fri Apr 7 12:28:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9669407 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 D108960365 for ; Fri, 7 Apr 2017 12:30:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0D4A2026B for ; Fri, 7 Apr 2017 12:30:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5C06285E9; Fri, 7 Apr 2017 12:30:42 +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 488C6285B7 for ; Fri, 7 Apr 2017 12:30:42 +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 1cwT0H-0006Or-1M; Fri, 07 Apr 2017 12:28:37 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwT0F-0006O1-LL for xen-devel@lists.xenproject.org; Fri, 07 Apr 2017 12:28:35 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 5C/F0-03430-2F587E85; Fri, 07 Apr 2017 12:28:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBIsWRWlGSWpSXmKPExsVyMbThoO6n1uc RBhPucFp83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmfF5xnLdipUjH5eQd7A+N/mS5GLg4hgZmM En/2TGLtYuTkYBFYwyqxYJM6SEJC4BKrxKv2RrCEhECMxMt51xkh7AqJs8+bmEBsIQEViZvbV zFBTPrFKDF/wX4WkISwgJ7EkaM/2CFsN4nJXVPYQGw2AQOJNzv2gg0VEVCSuLdqMlgzs8BRRo npi28yQ5yhKtHR/hKsgVfAW+Lpls1Agzg4OAV8Jdb+loJY7CPx//MfsPmiAnISKy+3sEKUC0q cnPmEBaScWUBTYv0ufZAws4C8xPa3c5gnMIrMQlI1C6FqFpKqBYzMqxg1ilOLylKLdA0t9ZKK MtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAsOfAQh2MP5YFnCIUZKDSUmUV8HnSYQQX 1J+SmVGYnFGfFFpTmrxIUYZDg4lCd5pLc8jhASLUtNTK9Iyc4CRCJOW4OBREuFVAknzFhck5h ZnpkOkTjEac7y4/P49E8eTlT/eMwmx5OXnpUqJ85qClAqAlGaU5sENgiWIS4yyUsK8jECnCfE UpBblZpagyr9iFOdgVBLmXQ4yhSczrwRu3yugU5iATvG59RTklJJEhJRUA6M0i3PYtUdTmbjq MmzF9x6/LV25cm3GwllKWjNWqoXYFXdfFPhx4GWoymL2qwdlVB5Mym//EF7KMH+WYtHv62bNn EI2JyZ88BGTYVdxm3XazqtPUsfUalHnd5tb9leXrGj7ZPNZevLq1f2RSi/2fjRjXWDAfv29/J +zNm6f4juyT9zJXXjmsJMSS3FGoqEWc1FxIgAT66cNCwMAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1491568114!83818582!1 X-Originating-IP: [209.85.128.193] 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 64269 invoked from network); 7 Apr 2017 12:28:34 -0000 Received: from mail-wr0-f193.google.com (HELO mail-wr0-f193.google.com) (209.85.128.193) by server-14.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Apr 2017 12:28:34 -0000 Received: by mail-wr0-f193.google.com with SMTP id t20so19659676wra.2 for ; Fri, 07 Apr 2017 05:28:34 -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=8zfM86Jvx4jYh33seOuuQPC8gA328JbnYUvLPkOgzkE=; b=c1hOS0lvrZdKH4ad9M04yo9t2WW5TBuEeqbeQpFONpBFh0NMyZ3nj3ObVGwP87aJ0u fyzdYPsdq4+Ykjs/Ju4K/kQhuEbXNGyzYILSCxOXtnRjHECIdANuaRoNgTh0dVb7JcN5 bTKN9CrAqrVfJZQu9rNnnxLGJhyIjtzWi4b+uCE8Xgx7WMlZqjk8qAdRoxg2wRenhMgu 5gN2HB3KeqO/MFZNCfUq0RjVt3e2EpV34lcRFgdo5xB1C/DG9PqF/pO00HHBd/pa15fv Xqd8XsojiWvK4Fr3fMgNfZrX+KKf1lt4Ts3R8erD6wc1VL5TLgNglhLS3KevT+snQPae qYVg== 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=8zfM86Jvx4jYh33seOuuQPC8gA328JbnYUvLPkOgzkE=; b=UqkLFsiaqw52uNpyZ/ghJedMtqsLmu/bU44iqmeP2QCtsb2w1hg0MUaDHYyl6K5iXj uFP5dBwr6vUQCaU5NWxJuyPNPpP7p+0vsvhKgVzqvzQw/vA0sYkUlnUJnWLAgdya/uPr p8UD/54HnL/bN0/12EEFiLdKXihSpIOT2Z7bQF7J6X5UXwEZ178WP9GREezCZts5NlW4 5SXXkXykomIARYPmWhqWSDdb4xhZ+QmKczYOfsoKTRDJerXg1J9jMZjUvC0pwDD7ctsM M4iDUB8a5rQh/CmtVtnTU4yv1cFjPysjhCDyGOtp7bPWL0+nIo9vIqV4c/dCwACLPA7k bghQ== X-Gm-Message-State: AN3rC/7/Dj6EWRwR9ipTM2OVI/sJoqB60cIxgtpWSUN0Xt6uBSsem4Mp6U/SGVOWi03apA== X-Received: by 10.223.165.5 with SMTP id i5mr3126178wrb.122.1491568113791; Fri, 07 Apr 2017 05:28:33 -0700 (PDT) Received: from Solace.fritz.box ([80.66.223.217]) by smtp.gmail.com with ESMTPSA id 201sm30157600wmr.5.2017.04.07.05.28.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Apr 2017 05:28:33 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 07 Apr 2017 14:28:31 +0200 Message-ID: <149156811107.26316.1793005065487626355.stgit@Solace.fritz.box> In-Reply-To: <149156740206.26316.13423335183353072520.stgit@Solace.fritz.box> References: <149156740206.26316.13423335183353072520.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 v3 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 Reviewed-by: George Dunlap --- Cc: Ian Jackson Cc: George Dunlap Cc: Julien Grall Cc: Stefano Stabellini --- Changes from v2: - _get() function now returns success (i.e., _get() and _set() function now both returns the same). --- 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..faa604e 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 bac226c..2204425 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)