From patchwork Fri Sep 1 15:58:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Xu X-Patchwork-Id: 9934729 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 0423160216 for ; Fri, 1 Sep 2017 16:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAA9B26E51 for ; Fri, 1 Sep 2017 16:01:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5EB027D4A; Fri, 1 Sep 2017 16:01: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=-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 290D42582C for ; Fri, 1 Sep 2017 16:01:28 +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 1dnoLn-00028q-71; Fri, 01 Sep 2017 15:59:19 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnoLl-00028X-TO for xen-devel@lists.xen.org; Fri, 01 Sep 2017 15:59:18 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 61/A8-01916-5D389A95; Fri, 01 Sep 2017 15:59:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRWlGSWpSXmKPExsUyr8m9UfdK88p Ig/mHlSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozHK0+yFnySrJg6fRlLA+M3kS5GTg4hgRlM Eh/7I0BsNgEVieMbHrGC2CIC0hLXPl9mBLGZBTYwStw+GwNiCwu4Sew6/pQNxGYRUJU4/u8UU A0HB6+As0TfJH2QsISAnMTJY5PBxnAKuEgca7/HCLHKWWLl0jtsEDWhEmsWn2eCqX/88AHjBE aeBYwMqxg1ilOLylKLdA0t9ZKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAn1ez8D AuIPx93G/Q4ySHExKorzV/isihfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwMgFDSEiwKDU9tSIt MwcYfDBpCQ4eJRFe9yagNG9xQWJucWY6ROoUo6KUOK8ISJ8ASCKjNA+uDRbwlxhlpYR5GRkYG IR4ClKLcjNLUOVfMYpzMCoJ8/KDTOHJzCuBm/4KaDET0OJ/n1eALC5JREhJNTBa7imKSNP+Pz H9+dO/0c80mmNCrzEWVlw2j+N0/yP3NDSTNS84Jahx1axk3uSECVrBLM8O9j3kF9U3nrv1LHN o26KtCzSj7y4JLDrL2Cp4rEqyVUWzmb9ZnvdCcK1e95qrgscdjr0uU6+wvr/S90vhpR3b1D56 XefUE1+/UXF1d0PntjVt3EosxRmJhlrMRcWJAK953oBzAgAA X-Env-Sender: mengxu@cis.upenn.edu X-Msg-Ref: server-3.tower-31.messagelabs.com!1504281556!112730847!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.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 61950 invoked from network); 1 Sep 2017 15:59:16 -0000 Received: from renard.seas.upenn.edu (HELO fox.seas.upenn.edu) (158.130.71.129) by server-3.tower-31.messagelabs.com with SMTP; 1 Sep 2017 15:59:16 -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 v81Fx0Zu003760 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT); Fri, 1 Sep 2017 11:59:08 -0400 From: Meng Xu To: xen-devel@lists.xen.org Date: Fri, 1 Sep 2017 11:58:49 -0400 Message-Id: <1504281532-3766-3-git-send-email-mengxu@cis.upenn.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504281532-3766-1-git-send-email-mengxu@cis.upenn.edu> References: <1504281532-3766-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 v2 2/5] 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 --- Changes from v1 1) Add LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA to indicate if extratime flag is supported 2) Change flag name in domctl.h from XEN_DOMCTL_SCHED_RTDS_extratime to XEN_DOMCTL_SCHEDRT_extra Changes from RFC v1 Change work_conserving flag to extratime flag --- tools/libxl/libxl_sched.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- tools/libxl/libxl.h | 6 ++++++ tools/libxl/libxl_sched.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 1704525..ead300f 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -257,6 +257,12 @@ #define LIBXL_HAVE_SCHED_RTDS_VCPU_PARAMS 1 /* + * LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA indicates RTDS scheduler + * now supports per-vcpu extratime settings. + */ +#define LIBXL_HAVE_SCHED_RTDS_VCPU_EXTRA 1 + +/* * libxl_domain_build_info has the arm.gic_version field. */ #define LIBXL_HAVE_BUILDINFO_ARM_GIC_VERSION 1 diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c index faa604e..b76a29a 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_SCHEDRT_extra) + 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_SCHEDRT_extra; + else + vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHEDRT_extra; } 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_SCHEDRT_extra; + else + vcpus[i].u.rtds.flags &= ~XEN_DOMCTL_SCHEDRT_extra; } r = xc_sched_rtds_vcpu_set(CTX->xch, domid, @@ -705,6 +717,12 @@ static int sched_rtds_domain_set(libxl__gc *gc, uint32_t domid, sdom.period = scinfo->period; if (scinfo->budget != LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT) sdom.budget = scinfo->budget; + if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT) { + if (scinfo->extratime) + sdom.flags |= XEN_DOMCTL_SCHEDRT_extra; + else + sdom.flags &= ~XEN_DOMCTL_SCHEDRT_extra; + } if (sched_rtds_validate_params(gc, sdom.period, sdom.budget)) return ERROR_INVAL;