From patchwork Mon May 6 06:56:22 2019 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: 10930529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5699A912 for ; Mon, 6 May 2019 06:58:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4597428397 for ; Mon, 6 May 2019 06:58:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39BF72861E; Mon, 6 May 2019 06:58:44 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBB9028397 for ; Mon, 6 May 2019 06:58:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNXYg-00024q-B5; Mon, 06 May 2019 06:57:06 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNXYd-0001yH-95 for xen-devel@lists.xenproject.org; Mon, 06 May 2019 06:57:03 +0000 X-Inumbo-ID: 2508aaf4-6fcc-11e9-843c-bc764e045a96 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 2508aaf4-6fcc-11e9-843c-bc764e045a96; Mon, 06 May 2019 06:57:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DE197AF24; Mon, 6 May 2019 06:56:54 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 6 May 2019 08:56:22 +0200 Message-Id: <20190506065644.7415-24-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190506065644.7415-1-jgross@suse.com> References: <20190506065644.7415-1-jgross@suse.com> Subject: [Xen-devel] [PATCH RFC V2 23/45] xen: add sched_item_pause_nosync() and sched_item_unpause() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Tim Deegan , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Dario Faggioli , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The credit scheduler calls vcpu_pause_nosync() and vcpu_unpause() today. Add sched_item_pause_nosync() and sched_item_unpause() to perform the same operations on scheduler items instead. Signed-off-by: Juergen Gross --- xen/common/sched_credit.c | 6 +++--- xen/include/xen/sched-if.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index babccb69f7..9db5c3fc71 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1080,7 +1080,7 @@ csched_item_remove(const struct scheduler *ops, struct sched_item *item) if ( test_and_clear_bit(CSCHED_FLAG_ITEM_PARKED, &svc->flags) ) { SCHED_STAT_CRANK(item_unpark); - vcpu_unpause(svc->item->vcpu); + sched_item_unpause(svc->item); } spin_lock_irq(&prv->lock); @@ -1530,7 +1530,7 @@ csched_acct(void* dummy) !test_and_set_bit(CSCHED_FLAG_ITEM_PARKED, &svc->flags) ) { SCHED_STAT_CRANK(item_park); - vcpu_pause_nosync(svc->item->vcpu); + sched_item_pause_nosync(svc->item); } /* Lower bound on credits */ @@ -1554,7 +1554,7 @@ csched_acct(void* dummy) * if it is woken up here. */ SCHED_STAT_CRANK(item_unpark); - vcpu_unpause(svc->item->vcpu); + sched_item_unpause(svc->item); } /* Upper bound on credits means ITEM stops earning */ diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 295101f9ef..65e2c3bba8 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -451,6 +451,16 @@ static inline int sched_adjust_cpupool(const struct scheduler *s, return 0; } +static inline void sched_item_pause_nosync(struct sched_item *item) +{ + vcpu_pause_nosync(item->vcpu); +} + +static inline void sched_item_unpause(struct sched_item *item) +{ + vcpu_unpause(item->vcpu); +} + #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ __used_section(".data.schedulers") = &x;