From nobody Mon Feb 9 22:24:24 2026 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=1559039683; cv=none; d=zoho.com; s=zohoarc; b=nOypoyiiudiUCpQpmj9BEzp22vfxj/2bohieBTC9HCAphkQx6j1KB60FBBUJF9+o9O+yBwJUx1MIyzIBCtX1DTZfWbCY7ffN7fWZ/eB/VwBOCt/GOt3v5yCNMg/EqQtC2DCph7ys9NQM+3A2oVO6DdKRT6KBq5Rk8Pv9+5rPK/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559039683; 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=IV1tjLRcPAFePWfAyrD2IdrTt/L0EYM/MPV2BYvy7+k=; b=bfn+MvdYT2BcHfXW5sEtW84q+xFql2e9ozv7IqbnveuvNk9Vtk4CmtzLKPCjsnR8WtQX8ekNZV+n7tsjbafZSjMnrz/CHAtjiOGyvNQVFSRC2n/1jwttFPwUYJ7EWLznrbLnD8MyKY0LmIsEBaA1TP1a8lV+Eu/XCOFvqtClcQs= 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 1559039683838761.8755696339683; Tue, 28 May 2019 03:34:43 -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 1hVZQb-0005iZ-Pp; Tue, 28 May 2019 10:33:57 +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 1hVZQC-0004p0-GB for xen-devel@lists.xenproject.org; Tue, 28 May 2019 10:33:32 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0659eeb6-8134-11e9-995e-875d65010379; Tue, 28 May 2019 10:33:26 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7A29FB028; Tue, 28 May 2019 10:33:24 +0000 (UTC) X-Inumbo-ID: 0659eeb6-8134-11e9-995e-875d65010379 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 28 May 2019 12:32:44 +0200 Message-Id: <20190528103313.1343-32-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190528103313.1343-1-jgross@suse.com> References: <20190528103313.1343-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 31/60] xen/sched: add runstate counters to struct sched_unit 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" Add counters to struct sched_unit summing up runstates of associated vcpus. Signed-off-by: Juergen Gross --- RFC V2: add counters for each possible runstate --- xen/common/schedule.c | 5 +++++ xen/include/xen/sched.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 63c9c0a8fb..fd0ca1e137 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -174,6 +174,7 @@ static inline void vcpu_runstate_change( struct vcpu *v, int new_state, s_time_t new_entry_time) { s_time_t delta; + struct sched_unit *unit =3D v->sched_unit; =20 ASSERT(v->runstate.state !=3D new_state); ASSERT(spin_is_locked(get_sched_res(v->processor)->schedule_lock)); @@ -182,6 +183,9 @@ static inline void vcpu_runstate_change( =20 trace_runstate_change(v, new_state); =20 + unit->runstate_cnt[v->runstate.state]--; + unit->runstate_cnt[new_state]++; + delta =3D new_entry_time - v->runstate.state_entry_time; if ( delta > 0 ) { @@ -305,6 +309,7 @@ static struct sched_unit *sched_alloc_unit(struct vcpu = *v) unit->vcpu =3D v; unit->unit_id =3D v->vcpu_id; unit->domain =3D d; + unit->runstate_cnt[v->runstate.state]++; =20 for ( prev_unit =3D &d->sched_unit_list; *prev_unit; prev_unit =3D &(*prev_unit)->next_in_list ) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index b14dff6fc4..69d3b32c7b 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -272,6 +272,8 @@ struct sched_unit { uint64_t last_run_time; /* Last time unit got (de-)scheduled. */ uint64_t state_entry_time; + /* Vcpu state summary. */ + unsigned int runstate_cnt[4]; =20 /* Currently running on a CPU? */ bool is_running; --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel