From nobody Tue Nov 11 08:45:38 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569567750; cv=none; d=zoho.com; s=zohoarc; b=eBqK3MZOUdY3IwYN7qhxvwC5T+xaVZ1iBVoOoUgAvvWOQ1uPk9rIcZj3gP4xMWyXa5VXjb5nLOzuHSwIdL9bCXpNPoo1IFQdFe6/d2RAOMo56WFjUZNhLf8EYtUO5wVR027+R1BIIrXU5n5e9k3MIdgt2uvF7nVZCWdbEyVnUsM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569567750; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=NrjUX1Cg1s1JaAPMDO4iQdeP4d+pA8oTnlkNuZOZxwk=; b=DiQnrkBmZa0eMIxwmlv1BAEOoUrYF5S6M1qMGMlgv39HGnS7XVBvDB570DZcCHa9buVerPjNKOwvCtEiGby3rOYP9W+rGux4xjINvfTqRwbbzIy93np8A+ac6kCOLSQw1Yk+L0BEbd3qjG/IrAkOm88rPd8g3sOZc9Xh97gJ4sk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569567750223836.6848382938898; Fri, 27 Sep 2019 00:02:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDkG8-0003iF-F4; Fri, 27 Sep 2019 07:01:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iDkG6-0003gP-Pp for xen-devel@lists.xenproject.org; Fri, 27 Sep 2019 07:01:42 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by localhost (Halon) with ESMTPS id 912360ac-e0f4-11e9-bf31-bc764e2007e4; Fri, 27 Sep 2019 07:01:02 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2AE3FB176; Fri, 27 Sep 2019 07:01:00 +0000 (UTC) X-Inumbo-ID: 912360ac-e0f4-11e9-bf31-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 27 Sep 2019 09:00:23 +0200 Message-Id: <20190927070050.12405-20-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190927070050.12405-1-jgross@suse.com> References: <20190927070050.12405-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v4 19/46] 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Reviewed-by: Dario Faggioli --- V4: - add vcpu loops to functions (Dario Faggioli) - make unit parameter const --- xen/common/sched_credit.c | 6 +++--- xen/include/xen/sched-if.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index e710b3c6fa..21c3a033b9 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -1065,7 +1065,7 @@ csched_unit_remove(const struct scheduler *ops, struc= t 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); } =20 spin_lock_irq(&prv->lock); @@ -1515,7 +1515,7 @@ csched_acct(void* dummy) !test_and_set_bit(CSCHED_FLAG_UNIT_PARKED, &svc->flag= s) ) { SCHED_STAT_CRANK(unit_park); - vcpu_pause_nosync(svc->unit->vcpu_list); + sched_unit_pause_nosync(svc->unit); } =20 /* 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); } =20 diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 2b9d50b9fe..45ac03f0f8 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -466,6 +466,22 @@ static inline int sched_adjust_cpupool(const struct sc= heduler *s, return s->adjust_global ? s->adjust_global(s, op) : 0; } =20 +static inline void sched_unit_pause_nosync(const struct sched_unit *unit) +{ + struct vcpu *v; + + for_each_sched_unit_vcpu ( unit, v ) + vcpu_pause_nosync(v); +} + +static inline void sched_unit_unpause(const struct sched_unit *unit) +{ + struct vcpu *v; + + for_each_sched_unit_vcpu ( unit, v ) + vcpu_unpause(v); +} + #define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ __used_section(".data.schedulers") =3D &x; =20 --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel