From patchwork Tue Feb 2 11:29:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 8189111 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D5A7BEEE5 for ; Tue, 2 Feb 2016 11:32:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 59E4E20263 for ; Tue, 2 Feb 2016 11:32:26 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 726CB20266 for ; Tue, 2 Feb 2016 11:32:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQZ9Z-0003xU-JE; Tue, 02 Feb 2016 11:29:49 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQZ9X-0003wt-U4 for xen-devel@lists.xen.org; Tue, 02 Feb 2016 11:29:48 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id 63/C9-02745-A2390B65; Tue, 02 Feb 2016 11:29:46 +0000 X-Env-Sender: jgross@suse.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1454412586!19763398!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 56341 invoked from network); 2 Feb 2016 11:29:46 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-5.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 2 Feb 2016 11:29:46 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 42B5AAC8E; Tue, 2 Feb 2016 11:29:46 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xen.org, jbeulich@suse.com, alan.robinson@ts.fujitsu.com, george.dunlap@eu.citrix.com, dario.faggioli@citrix.com Date: Tue, 2 Feb 2016 12:29:42 +0100 Message-Id: <1454412582-3263-3-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1454412582-3263-1-git-send-email-jgross@suse.com> References: <1454412582-3263-1-git-send-email-jgross@suse.com> Cc: Juergen Gross Subject: [Xen-devel] [PATCH v2 2/2] xen: recalculate per-cpupool credits when updating timeslice X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When modifying the timeslice of the credit scheduler in a cpupool the cpupool global credit value (n_cpus * credits_per_tslice) isn't recalculated. This will lead to wrong scheduling decisions later. Do the recalculation when updating the timeslice. Signed-off-by: Juergen Gross Tested-by: Alan.Robinson --- xen/common/sched_credit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 8fbbd54..671bbee 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1092,6 +1092,7 @@ __csched_set_tslice(struct csched_private *prv, unsigned timeslice) prv->ticks_per_tslice = 1; prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice; prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms; + prv->credit = prv->credits_per_tslice * prv->ncpus; } static int