From patchwork Sun Aug 6 16:22:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Xu X-Patchwork-Id: 9883863 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 36EAC6031B for ; Sun, 6 Aug 2017 16:25:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F0F285AE for ; Sun, 6 Aug 2017 16:25:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17726285B5; Sun, 6 Aug 2017 16:25:56 +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 39445285AE for ; Sun, 6 Aug 2017 16:25:53 +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 1deOKd-0007Ha-Es; Sun, 06 Aug 2017 16:23:11 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deOKc-0007HO-1m for xen-devel@lists.xen.org; Sun, 06 Aug 2017 16:23:10 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 05/12-01862-D6247895; Sun, 06 Aug 2017 16:23:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRWlGSWpSXmKPExsUyr8m9UTfHqT3 SYPF2FYslHxezODB6HN39mymAMYo1My8pvyKBNaPh2THmgj38FW3P3jM2MC7h6WLk4hASmMEk 8WLpcfYuRk4ONgEVieMbHrGC2CIC0hLXPl9mBLGZBTYwStw+GwNiCwu4STy69IQJxGYRUJXY0 HUNrJdXwFli3/5FbCC2hICcxMljk8HmcAq4SPz7c4YFxBYCqnm8bQMrRE2oxJrF55lg6h8/fM A4gZFnASPDKkaN4tSistQiXUMjvaSizPSMktzEzBxdQwNjvdzU4uLE9NScxKRiveT83E2MQL8 zAMEOxlfdzocYJTmYlER541e0RQrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4L3o0B4pJFiUmp5a kZaZAwxAmLQEB4+SCO8BkDRvcUFibnFmOkTqFKMux6sJ/78xCbHk5eelSonz1jkCFQmAFGWU5 sGNgEXDJUZZKWFeRqCjhHgKUotyM0tQ5V8xinMwKgnzzgNZxZOZVwK36RXQEUxAR7xJbAU5oi QRISXVwBg64ZtqW0S86nVZ0/mC3KZnfSQt3WsWr+B3jz5XXcduNtt0x9zQnfcfb9uylevtbsH gCB6fJ3qHL6TOuqYRamVrmrk66k7qgWd17Ona8Uu4Zn+JmDzhp+K2xy663jpPZx3OCrJacKRt t9cre4PX5zNaVtcJMszearU93kVCbeWxLZGHMjMt3yqxFGckGmoxFxUnAgDTo9KmgQIAAA== X-Env-Sender: mengxu@cis.upenn.edu X-Msg-Ref: server-2.tower-31.messagelabs.com!1502036588!97117810!1 X-Originating-IP: [158.130.71.129] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 54392 invoked from network); 6 Aug 2017 16:23:08 -0000 Received: from renard.seas.upenn.edu (HELO fox.seas.upenn.edu) (158.130.71.129) by server-2.tower-31.messagelabs.com with SMTP; 6 Aug 2017 16:23:08 -0000 Received: from panda-catbroadwell.cis.upenn.edu (SEASnet-48-12.cis.upenn.edu [158.130.48.13]) (authenticated bits=0) by fox.seas.upenn.edu (8.15.2/8.14.5) with ESMTPSA id v76GMxOp022037 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT); Sun, 6 Aug 2017 12:23:00 -0400 From: Meng Xu To: xen-devel@lists.xen.org Date: Sun, 6 Aug 2017 12:22:42 -0400 Message-Id: <1502036563-4275-3-git-send-email-mengxu@cis.upenn.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502036563-4275-1-git-send-email-mengxu@cis.upenn.edu> References: <1502036563-4275-1-git-send-email-mengxu@cis.upenn.edu> X-Proofpoint-Virus-Version: vendor=nai engine=5600 definitions=5800 signatures=585085 X-Proofpoint-Spam-Reason: safe Cc: george.dunlap@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xumengpanda@gmail.com, Meng Xu , wei.liu@citrix.com Subject: [Xen-devel] [PATCH v1 2/3] libxl: enable per-VCPU extratime flag for RTDS 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 Modify libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set functions to support per-VCPU extratime flag Signed-off-by: Meng Xu Reviewed-by: Dario Faggioli --- Changes from RFC v1 Change work_conserving flag to extratime flag --- tools/libxl/libxl_sched.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c index faa604e..4ebed96 100644 --- a/tools/libxl/libxl_sched.c +++ b/tools/libxl/libxl_sched.c @@ -558,6 +558,10 @@ static int sched_rtds_vcpu_get_all(libxl__gc *gc, uint32_t domid, for (i = 0; i < num_vcpus; i++) { scinfo->vcpus[i].period = vcpus[i].u.rtds.period; scinfo->vcpus[i].budget = vcpus[i].u.rtds.budget; + if ( vcpus[i].u.rtds.flags & XEN_DOMCTL_SCHED_RTDS_extratime ) + scinfo->vcpus[i].extratime = 1; + else + scinfo->vcpus[i].extratime = 0; scinfo->vcpus[i].vcpuid = vcpus[i].vcpuid; } rc = 0; @@ -607,6 +611,10 @@ static int sched_rtds_vcpu_set(libxl__gc *gc, uint32_t domid, vcpus[i].vcpuid = scinfo->vcpus[i].vcpuid; vcpus[i].u.rtds.period = scinfo->vcpus[i].period; vcpus[i].u.rtds.budget = scinfo->vcpus[i].budget; + if ( scinfo->vcpus[i].extratime ) + vcpus[i].u.rtds.flags |= XEN_DOMCTL_SCHED_RTDS_extratime; + else + vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHED_RTDS_extratime; } r = xc_sched_rtds_vcpu_set(CTX->xch, domid, @@ -655,6 +663,10 @@ static int sched_rtds_vcpu_set_all(libxl__gc *gc, uint32_t domid, vcpus[i].vcpuid = i; vcpus[i].u.rtds.period = scinfo->vcpus[0].period; vcpus[i].u.rtds.budget = scinfo->vcpus[0].budget; + if ( scinfo->vcpus[0].extratime ) + vcpus[i].u.rtds.flags |= XEN_DOMCTL_SCHED_RTDS_extratime; + else + vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHED_RTDS_extratime; } r = xc_sched_rtds_vcpu_set(CTX->xch, domid,