From patchwork Wed Jan 18 00:30:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9522351 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 3C5746043D for ; Wed, 18 Jan 2017 00:33:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E5528481 for ; Wed, 18 Jan 2017 00:33:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12E17284E8; Wed, 18 Jan 2017 00:33:23 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 3E38528481 for ; Wed, 18 Jan 2017 00:33:20 +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 1cTe96-0005tR-J9; Wed, 18 Jan 2017 00:30:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTe95-0005tL-7t for xen-devel@lists.xenproject.org; Wed, 18 Jan 2017 00:30:35 +0000 Received: from [85.158.143.35] by server-5.bemta-6.messagelabs.com id 07/48-11476-A27BE785; Wed, 18 Jan 2017 00:30:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRWlGSWpSXmKPExsXiVRvkrKu5vS7 CYMkzYYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPj+tcsBZO5Kp7uNW9gnMbRxcjFISQwjVHi wJ+NjF2MnBwsAlNZJTYtjABJSAhsZJX4dHcrM0hCQiBGYubZLYwQdo3EsQvfweJCAioSN7evY oKYNJNJ4u7PDrAiYQE9iSNHf7BD2P4SGzYsYAWx2QQMJN7s2AtmiwgoSdxbNRmomYODWUBfYv VXHogjVCW+nzwM1sor4C3Rcuk+G4gtKiAnsfJyCytEXFDi5MwnLBCtmhLrd+mDhJkF5CW2v53 DPIFRaBaSqlkIVbOQVC1gZF7FqFGcWlSWWqRrZKGXVJSZnlGSm5iZo2toYKaXm1pcnJiempOY VKyXnJ+7iREYygxAsIPx/NrAQ4ySHExKorwdj2sjhPiS8lMqMxKLM+KLSnNSiw8xanBwCEw4O 3c6kxRLXn5eqpIEr/q2ugghwaLU9NSKtMwcYLTBlEpw8CiJ8O7YCpTmLS5IzC3OTIdInWLU5d i16/JLJiGwGVLivK9AigRAijJK8+BGwCL/EqOslDAvI9CBQjwFqUW5mSWo8q8YxTkYlYR5d4F M4cnMK4Hb9AroCCagI67rVIMcUZKIkJJqYMysXxk5W7KXz+qS5cnW6exuf3cIv93Isfed1rGn Kil6TxNU5smKTI5Zcyj1xN2JErsUo7S6pn+9FzhTZHnZzWBrn0k7p1+qcC65sjiB7/zq2cFWn LMNVOWWfdF6Kqhx9/zE5W/PWOepvqpITuzo36kvWaC0g/uDReoSB4ctOb85giVqU1cdD1ZiKc 5INNRiLipOBACJnDiO9wIAAA== X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1484699433!53098095!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18109 invoked from network); 18 Jan 2017 00:30:33 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-11.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Jan 2017 00:30:33 -0000 Received: by mail-wm0-f67.google.com with SMTP id r144so85298wme.0 for ; Tue, 17 Jan 2017 16:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=dHFJxmyojUyd8pIAnEKMPia682EJ++b+MUMFeKzZTuM=; b=rJ5hwSYFjRM9jZuHQSDw9w4/VZhJAmudP2U5aCazdqZ6RO507rLaYK00md6Z9sQ9ys TJQEfFGzi/qBMhxRWBIIP8+HksQW8shUBPlJ0BHZJfbTgBefy12CzT3f+55EnJIj7pDq kysVIg9vr1z5uc6U9qcj6/14oN/lWty+gaarkxmisvQDb2bxOqcQ/bbVEERKu5+kSb+I PQktV0W9CJxOan6KrlSKZeP05tsHakZtthUMhBm2iRyfkMt1bv2l+RH9KjajiWrirxQj V+sBKwFqrGlx5kJOiqjpxc3kBT7ctiEOe+SuzYrH4A7cYqMS12BXBixCxmI+c4k7cm3K NuNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=dHFJxmyojUyd8pIAnEKMPia682EJ++b+MUMFeKzZTuM=; b=bme9iulQ6zmwELBocASmSyZCuZ/aV7Fep+yQwVv5VJfarz+Rjsuat6Cs0Wecd8mVCW +8VLI/2BaGX1opsSRLS58l8t1K4WuweCUat9jJj9+ZlTxzKDpVO/ipUSJubg8kN/1IZR dB4Qfy/S3SDTd9tZ+LVYtAZE47+c0nP4jh6TlXuF5YWh1EKRXTg+RuImr0M/4i0lGuQS 5pku3FqGflNNRHPNpCUZj0b/pPsEcXOdzDzBx1TFqJCLJu2IG7TQFsbELhq/WbtcqlTx XiiNTYvmLH8L8LGuS9GdwjOvD6f5o3ztxocb2wDYnVTu/thvH/EblhxP9XqS3oVOTAbZ pLZg== X-Gm-Message-State: AIkVDXK3QA7J2+BTQSKUW7BIRl0fIl4PV3B8aT4sKnkeRdZwVZ80uQUOIeHNaOt2C16FAw== X-Received: by 10.28.152.137 with SMTP id a131mr19607543wme.139.1484699432928; Tue, 17 Jan 2017 16:30:32 -0800 (PST) Received: from Solace.fritz.box (58-209-66-80.hosts.abilene.it. [80.66.209.58]) by smtp.gmail.com with ESMTPSA id t194sm43774395wmd.1.2017.01.17.16.30.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 16:30:32 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Wed, 18 Jan 2017 01:30:31 +0100 Message-ID: <148469943088.19533.8330155575788944646.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH] xen: credit2: clear bit instead of skip step in runq_tickle() 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 Since we are doing cpumask manipulation already, clear a bit in the mask at once. Doing that will save us an if, later in the code. No functional change intended. Signed-off-by: Dario Faggioli --- Cc: George Dunlap --- xen/common/sched_credit2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index ef8e0d8..d086264 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -985,7 +985,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) cpumask_andnot(&mask, &rqd->active, &rqd->idle); cpumask_andnot(&mask, &mask, &rqd->tickled); cpumask_and(&mask, &mask, new->vcpu->cpu_hard_affinity); - if ( cpumask_test_cpu(cpu, &mask) ) + if ( __cpumask_test_and_clear_cpu(cpu, &mask) ) { cur = CSCHED2_VCPU(curr_on_cpu(cpu)); burn_credits(rqd, cur, now); @@ -1001,8 +1001,7 @@ runq_tickle(const struct scheduler *ops, struct csched2_vcpu *new, s_time_t now) for_each_cpu(i, &mask) { /* Already looked at this one above */ - if ( i == cpu ) - continue; + ASSERT(i != cpu); cur = CSCHED2_VCPU(curr_on_cpu(i));