From patchwork Thu Aug 18 10:00:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9287193 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 C2831607FF for ; Thu, 18 Aug 2016 10:03:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4571290C1 for ; Thu, 18 Aug 2016 10:03:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A919D290CF; Thu, 18 Aug 2016 10:03:20 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 5766F290C1 for ; Thu, 18 Aug 2016 10:03:18 +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 1baK8M-0006IB-J1; Thu, 18 Aug 2016 10:01:10 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1baK8L-0006Hs-Lw for xen-devel@lists.xenproject.org; Thu, 18 Aug 2016 10:01:09 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id 18/C1-12460-46785B75; Thu, 18 Aug 2016 10:01:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDIsWRWlGSWpSXmKPExsXiVRvkqJvSvjX cYEsHv8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrF04gzmgq/sFWv/3WZsYFzN1sXIySEkMINR Ytuvii5GLg4WgTWsEjMnLGEHcSQELrFK9Mx5wghSJSEQI9Gwch6UXSEx+cBJVohuFYmb21cxg TQICcxlktjw8gRYQlhAT+LI0R9AkziA7ASJDw9MQcJsAgYSb3bsBSsREVCSuLdqMhNICbOAvs TqrzwgYRYBVYldH2eDHccr4C3xffYHdhCbU8BHounjOSaItd4Sl3aeYAaxRQXkJFZebmGFqBe UODnzCQvESE2J9bv0QcLMAvIS29/OYZ7AKDILSdUshKpZSKoWMDKvYtQoTi0qSy3SNTTVSyrK TM8oyU3MzNE1NDDVy00tLk5MT81JTCrWS87P3cQIDH0GINjB2LDd8xCjJAeTkiivFd/WcCG+p PyUyozE4oz4otKc1OJDjBocHAITzs6dziTFkpefl6okwXunFahOsCg1PbUiLTMHGJ0wpRIcPE oivBZtQGne4oLE3OLMdIjUKUZdji1T761lEgKbISXOawBSJABSlFGaBzcCliguMcpKCfMyAh0 oxFOQWpSbWYIq/4pRnINRSZhXFmQKT2ZeCdymV0BHMAEdwcu/BeSIkkSElFQDY1em7jRvaTmf XZclXMLVYo918yUvt/zx7d3K6P0zV1y/rRn+r840Ynaa0asFwbdONGp+0lq86Oq8g/MyvH5fO u1sxbu5ueTGwUl3WhgLlorLLugvfcOd1/22a/EKjtrzv2RSBCvmNUR8kTzE+sO4ZuOVuZcV+6 erf1l1r0EzabGDiUHxhJ53H5VYijMSDbWYi4oTAVvG/w0PAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1471514468!18742988!1 X-Originating-IP: [74.125.82.65] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7988 invoked from network); 18 Aug 2016 10:01:08 -0000 Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by server-12.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Aug 2016 10:01:08 -0000 Received: by mail-wm0-f65.google.com with SMTP id q128so4597915wma.1 for ; Thu, 18 Aug 2016 03:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=XCwCAzDcEjgRvBcOTSToSXGDJX5Sdqmhr4DiRA1sUJI=; b=ajTQz0xu5z5Yxli2o+yXioWFU7Qbu2YmhxqM31/LUIU9A4h29R6BHwMvtf1N+W9QMm ryB0u0HDZfc++N1PIEDzGTYXrXU4jMhnb75z2Qtt4U14rgG6EY/EnLct4KaDJKhRlrai OndfcozdlhHl3nHSMCFtAyV7A8MtqLaSIqr54hdKj0CALqhCREZmb23m3xG6KHkaJl2M xYkCWLnCZ6bL0ymF2rTOFsvV1p5q/UxRuXmBccIe6iUFoOkX+lMwTpj6uWMVGBCetjOb wH5RWHFAzU3Z4x1/mwpogeET5lm13EbwfxeYNq4xLdbYi9S514FYxBR2O3QabRNmIuVL yVJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=XCwCAzDcEjgRvBcOTSToSXGDJX5Sdqmhr4DiRA1sUJI=; b=P9hK3CJkFhrFm9+2ZIBvG06C6yRr7g7skswTf7Pzwgni6JJ3OZjIBDQ/MQ9JWFvkGh cK8UZYBS46TfdlZusKR5iAq27tCY/VQ9LqQi+YeC0+PK4t6ETzoye35uo4cs87ENIqH5 hjIkw7MdFSQHXq3RPwFsM6GW/ytdeLxHQYRHXAjzAQbuG6r/KzCeUTFWcfZhmdLz5d5c EN1GmmsBSNZw2cghoT3J/02FfguVLaQIQy/q3YGeCC2BhsIyZRa9x5z7znVgMS9HmYsW aUh8HgQY7TknDu8oeZcobNGqQhrF3F65H7gOpRVGUflwwaXBA8fUo9435iiug+IsFxON e2UA== X-Gm-Message-State: AEkoouuXl/b8EJIaRbnBVTImGc2AaxMElzY0Q2e1TZf7VX6QJJpdxhaNm3/0l8DRYqXFFw== X-Received: by 10.28.9.194 with SMTP id 185mr28617436wmj.37.1471514461204; Thu, 18 Aug 2016 03:01:01 -0700 (PDT) Received: from Solace.fritz.box (net-2-32-14-104.cust.vodafonedsl.it. [2.32.14.104]) by smtp.gmail.com with ESMTPSA id va3sm1468491wjb.18.2016.08.18.03.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 03:01:00 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Thu, 18 Aug 2016 12:00:59 +0200 Message-ID: <147151445917.29674.7540829495336046741.stgit@Solace.fritz.box> In-Reply-To: <147151337343.29674.1081345215393715232.stgit@Solace.fritz.box> References: <147151337343.29674.1081345215393715232.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH v2 2/2] xen: credit1: no need to check for is_idle_vcpu() in csched_vcpu_acct() 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 In fact, csched_vcpu_acct() is called by csched_tick() _only_ on non idle vcpus already. There's even an ASSERT() already in place at the top of it which, by checking that svc->sdom is not NULL, guarantees that the function is not being called on the idle domain. Signed-off-by: Dario Faggioli Acked-by: George Dunlap --- Cc: George Dunlap --- xen/common/sched_credit.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index daace81..71a8b1d 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -966,11 +966,8 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu) svc->vcpu->vcpu_id); } - /* - * Update credits - */ - if ( !is_idle_vcpu(svc->vcpu) ) - burn_credits(svc, NOW()); + /* Update credits. */ + burn_credits(svc, NOW()); /* * Put this VCPU and domain back on the active list if it was