From patchwork Tue Sep 12 00:45:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: anshul makkar X-Patchwork-Id: 9952141 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 25FD360360 for ; Wed, 13 Sep 2017 21:33:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1884428C53 for ; Wed, 13 Sep 2017 21:33:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CCB928C7E; Wed, 13 Sep 2017 21:33:43 +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=-2.2 required=2.0 tests=BAYES_00, DATE_IN_PAST_24_48, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,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 9CAEE28C53 for ; Wed, 13 Sep 2017 21:33: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 1dsFG6-0000V0-2q; Wed, 13 Sep 2017 21:31:46 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsFG5-0000Uq-2Q for xen-devel@lists.xen.org; Wed, 13 Sep 2017 21:31:45 +0000 Received: from [85.158.143.35] by server-9.bemta-6.messagelabs.com id C4/C3-03422-0C3A9B95; Wed, 13 Sep 2017 21:31:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRWlGSWpSXmKPExsVyMbThiO6+xTs jDX7eUrFY8nExiwOjx9Hdv5kCGKNYM/OS8isSWDMuNy5kL3guXtHb387awLhaqIuRi0NIYAKj xJY9fcxdjJwcLAIvWSRm/dQHSUgI9LNK3LkyjwkkISGQJPHh2mdmCDtN4vDmSWwQdpXEg+nTW UFsIQFVickLJ7BA2KuYJL79tgWx2QS0JVZ9mA1WIyIgLXHt82VGkAXMAlOYJY48ewbWICwQI/ Fh8k9GiCtUJaa8/wS2gFfATeLU5F6oI+Qkbp7rBDuCU8BdYvW8A0wQy9wkbm44zDyBUXABI8M qRvXi1KKy1CJdS72kosz0jJLcxMwcXUMDM73c1OLixPTUnMSkYr3k/NxNjMCAYwCCHYx3NwUc YpTkYFIS5d2ruzNSiC8pP6UyI7E4I76oNCe1+BCjBgeHwISzc6czSbHk5eelKknwqgADW0iwK DU9tSItMwcYEzClEhw8SiK8+iBp3uKCxNzizHSI1ClGS44Ldy79YeI4sOcWkOy4efcPkxDYPC lxXmaQBgGQhozSPLhxsLi9xCgrJczLCHSsEE9BalFuZgmq/CtGcQ5GJWHe+EVAU3gy80rgtr4 COogJ6KAzp3eAHFSSiJCSamAUMvY5Jb74+N9TJTYqJnXeUyN3npj8LuhJH4/Q65k5Wq479rX/ X8O1+elNw3X2s5xWzF538q/b/PSAnS/0JuttqFli511tXnI4PPFy1tHdcnyJgWWM3LV79xU+c pyuv1XnUJLMy4W7GJRtJoU9SVnQlJ/8/v3bvGufUpkmhh0TDjHec3BO0aLJSizFGYmGWsxFxY kA4zA4PdYCAAA= X-Env-Sender: anshulmakkar@gmail.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1505338302!82569324!1 X-Originating-IP: [209.85.128.196] X-SpamReason: No, hits=1.3 required=7.0 tests=BODY_RANDOM_LONG, DATE_IN_PAST_24_48 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16929 invoked from network); 13 Sep 2017 21:31:42 -0000 Received: from mail-wr0-f196.google.com (HELO mail-wr0-f196.google.com) (209.85.128.196) by server-15.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 13 Sep 2017 21:31:42 -0000 Received: by mail-wr0-f196.google.com with SMTP id k20so696835wre.1 for ; Wed, 13 Sep 2017 14:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JIzCQ+JRRh8KbY7OzFo2CDSKyEJqu0liWJmXhuP/wdU=; b=tNYf5t9m/2NBZXSSiGxWKONw8TdubB3HakyaCTwOm0/WSZNj4ayoChqGoM6XXceu3o 4sKqKnOchPHCzALKZv2tfElf0uDwD7hKXyVxj1ELnjJ8+hDOCDuKqWMlNvTTX2MnOYDQ SjHNo8oGQq86tgsXgjyDsIIWi4wUxtz7bQKiToxZuIIzohaUI38SykhvmS9L4+JIGOmv Tw3A513eFrfjoKajcZ0Z4elY0wOog6KuQLAyLWXzqgmAAbRAgYDptWPcUbv7emwevPEQ 14cQI8aLkeYgGiXUEKoXJN/mK4JvcAmnOyBSFqXjt7sXhvyVivja0FEC0GPWg67MdD3n k4XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JIzCQ+JRRh8KbY7OzFo2CDSKyEJqu0liWJmXhuP/wdU=; b=DQjA28BBeRqqF8+T73Mrq1eZEMP3Pxo0wWZShix9vDz7TH0S6Nwat8xRi3y+cS4/47 aByAJPYSkarMq0ElsCROsPvIHJ5vH/7x6LE64nFaN4iBr+yP4T3CBBrSBi3m2pF3eru0 mcSKI/QwHuKKnttzwrv5+P5crcjNJyMPAv0CVAF30BsMFcC52kzXxjKOC4V+1BGB4YVi aTq9C5CD5HrNxgvcmMcraDqfan0TbqGkc1IlDpP+8ceuNySLq1jJIza92WU6vF0Vy73u qrRJS602by4YcS32GPqU5OtrfeLwtfKtnT7MjBg47ml2hq6dmbfnm1zEHfop2bQOWzpc vOeQ== X-Gm-Message-State: AHPjjUjPAP57CcnHSOSl09SGsr8g4bhsOKYLo4A8JEFEbLarxpd3JetQ b/7bSshWI8dBEC/b9FE= X-Google-Smtp-Source: ADKCNb7WzKb7wOLdeDV1eYOaSi7M8BtoVAWl1FZjAWmWm+4yv0RiUQ649GCd/qLAee4xHcTHnZttEw== X-Received: by 10.223.134.157 with SMTP id 29mr15551682wrx.72.1505338301908; Wed, 13 Sep 2017 14:31:41 -0700 (PDT) Received: from anshul-VirtualBox.home (host109-151-54-23.range109-151.btcentralplus.com. [109.151.54.23]) by smtp.gmail.com with ESMTPSA id j4sm9224317wrg.96.2017.09.13.14.31.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Sep 2017 14:31:41 -0700 (PDT) From: anshulmakkar To: xen-devel@lists.xen.org Date: Tue, 12 Sep 2017 01:45:40 +0100 Message-Id: <1505177142-14864-2-git-send-email-anshulmakkar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505177142-14864-1-git-send-email-anshulmakkar@gmail.com> References: <1505177142-14864-1-git-send-email-anshulmakkar@gmail.com> Cc: jgross@suse.com, sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, marmarek@invisiblethingslab.com, robert.vanvossen@dornerworks.com, tim@xen.org, josh.whitehead@dornerworks.com, mengxu@cis.upenn.edu, jbeulich@suse.com, anshulmakkar Subject: [Xen-devel] [PATCH 1/3] credit2: libxc related changes to add support for runqueue per cpupool. 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP libxc receives scheduler specific configuration parametes from libxl. Signed-off-by: Anshul Makkar --- tools/libxc/include/xenctrl.h | 6 +++++- tools/libxc/xc_cpupool.c | 4 +++- tools/python/xen/lowlevel/xc/xc.c | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 43151cb..e2157e9 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1077,17 +1077,21 @@ typedef struct xc_cpupoolinfo { #define XC_CPUPOOL_POOLID_ANY 0xFFFFFFFF +typedef xen_sysctl_sched_param_t xc_schedparam_t; + /** * Create a new cpupool. * * @parm xc_handle a handle to an open hypervisor interface * @parm ppoolid pointer to the new cpupool id (in/out) * @parm sched_id id of scheduler to use for pool + * @parm sched_param parameter of the scheduler of the cpupool eg. runq for credit2 * return 0 on success, -1 on failure */ int xc_cpupool_create(xc_interface *xch, uint32_t *ppoolid, - uint32_t sched_id); + uint32_t sched_id, + xc_schedparam_t * sched_param); /** * Destroy a cpupool. Pool must be unused and have no cpu assigned. diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c index fbd8cc9..fb2d183 100644 --- a/tools/libxc/xc_cpupool.c +++ b/tools/libxc/xc_cpupool.c @@ -36,7 +36,8 @@ static int do_sysctl_save(xc_interface *xch, struct xen_sysctl *sysctl) int xc_cpupool_create(xc_interface *xch, uint32_t *ppoolid, - uint32_t sched_id) + uint32_t sched_id, + xc_schedparam_t * sched_params) { int err; DECLARE_SYSCTL; @@ -46,6 +47,7 @@ int xc_cpupool_create(xc_interface *xch, sysctl.u.cpupool_op.cpupool_id = (*ppoolid == XC_CPUPOOL_POOLID_ANY) ? XEN_SYSCTL_CPUPOOL_PAR_ANY : *ppoolid; sysctl.u.cpupool_op.sched_id = sched_id; + sysctl.u.cpupool_op.sched_param = *sched_params; if ( (err = do_sysctl_save(xch, &sysctl)) != 0 ) return err; diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index aa9f8e4..a83a23f 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1704,6 +1704,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self, PyObject *kwds) { uint32_t cpupool = XC_CPUPOOL_POOLID_ANY, sched = XEN_SCHEDULER_CREDIT; + xc_schedparam_t param; static char *kwd_list[] = { "pool", "sched", NULL }; @@ -1711,7 +1712,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self, &sched)) return NULL; - if ( xc_cpupool_create(self->xc_handle, &cpupool, sched) < 0 ) + if ( xc_cpupool_create(self->xc_handle, &cpupool, sched, ¶m) < 0 ) return pyxc_error_to_exception(self->xc_handle); return PyLongOrInt_FromLong(cpupool);