From patchwork Fri Aug 9 14:58:04 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: 11086619 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 3F9601398 for ; Fri, 9 Aug 2019 14:59:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C7771FF29 for ; Fri, 9 Aug 2019 14:59:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20BC31FF41; Fri, 9 Aug 2019 14:59:53 +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 C53311FF73 for ; Fri, 9 Aug 2019 14:59:52 +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 1hw6MF-00073w-D1; Fri, 09 Aug 2019 14:59:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hw6M2-0006cU-RU for xen-devel@lists.xenproject.org; Fri, 09 Aug 2019 14:58:54 +0000 X-Inumbo-ID: 2f3ddd4a-bab6-11e9-b5aa-0fc1553e8ba5 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2f3ddd4a-bab6-11e9-b5aa-0fc1553e8ba5; Fri, 09 Aug 2019 14:58:49 +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 6DDF5AFCE; Fri, 9 Aug 2019 14:58:44 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 9 Aug 2019 16:58:04 +0200 Message-Id: <20190809145833.1020-20-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190809145833.1020-1-jgross@suse.com> References: <20190809145833.1020-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v2 19/48] xen: add sched_unit_pause_nosync() and sched_unit_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_unit_pause_nosync() and sched_unit_unpause() to perform the same operations on scheduler units 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 60eb4d3244..4ce0f7668a 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1065,7 +1065,7 @@ csched_unit_remove(const struct scheduler *ops, struct sched_unit *unit) if ( test_and_clear_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags) ) { SCHED_STAT_CRANK(unit_unpark); - vcpu_unpause(svc->unit->vcpu_list); + sched_unit_unpause(svc->unit); } spin_lock_irq(&prv->lock); @@ -1515,7 +1515,7 @@ csched_acct(void* dummy) !test_and_set_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags) ) { SCHED_STAT_CRANK(unit_park); - vcpu_pause_nosync(svc->unit->vcpu_list); + sched_unit_pause_nosync(svc->unit); } /* Lower bound on credits */ @@ -1539,7 +1539,7 @@ csched_acct(void* dummy) * if it is woken up here. */ SCHED_STAT_CRANK(unit_unpark); - vcpu_unpause(svc->unit->vcpu_list); + sched_unit_unpause(svc->unit); clear_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flags); } diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 65fa853e90..a945fc748d 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -431,6 +431,16 @@ static inline int sched_adjust_cpupool(const struct scheduler *s, return s->adjust_global ? s->adjust_global(s, op) : 0; } +static inline void sched_unit_pause_nosync(struct sched_unit *unit) +{ + vcpu_pause_nosync(unit->vcpu_list); +} + +static inline void sched_unit_unpause(struct sched_unit *unit) +{ + vcpu_unpause(unit->vcpu_list); +} + #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ __used_section(".data.schedulers") = &x;