From nobody Mon Feb 9 09:28:38 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=1557125918; cv=none; d=zoho.com; s=zohoarc; b=gj0kNYVNbEthCGdUbeXZeufqPSSeu5WxWOGxJTuXPq1cPK3SgLjKU1GgGRtNhwx2LERXXs/XEPvr+pRJb7ef/e/LElc/P5mKNRM4mEv2QcxnvFjTgYRIwZNTJc1HrrUqy1fqBNM4MjmqLwxb6xfTTXQE8A3rIGANm3HEZOrRpME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557125918; 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=hpJNCuLAfqaHP1XDUYSuvlewCAxd4EVOgT8KFM25tUU=; b=g8/vqaKGanG5cTBTlCYs7TiGlkckCesmtB87j3mBJiW7CyCwM9Lu8Qj4hmGiIkhMEQTGzm+G3+st8DFUf4aWJDFI0QZuGfcC11UK4xJCBbCNIjV1UpjV4sYOgmeJlmiLf6aAC7OM9hXYmfCdLes7cRB0qU5M2LgZ6aUzS7LNwxA= 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 1557125918355196.46898065815458; Sun, 5 May 2019 23:58:38 -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 1hNXYh-00026h-4f; Mon, 06 May 2019 06:57: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 1hNXYe-00020S-7O for xen-devel@lists.xenproject.org; Mon, 06 May 2019 06:57:04 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 229d4a2e-6fcc-11e9-b435-93fc4e3b85a6; Mon, 06 May 2019 06:56:56 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 67A14AF1B; Mon, 6 May 2019 06:56:53 +0000 (UTC) X-Inumbo-ID: 229d4a2e-6fcc-11e9-b435-93fc4e3b85a6 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 6 May 2019 08:56:15 +0200 Message-Id: <20190506065644.7415-17-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 16/45] xen/sched: switch struct task_slice from vcpu to sched_item 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 , Robert VanVossen , Dario Faggioli , Julien Grall , Josh Whitehead , Meng Xu , 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" Let the schedulers put a sched_item pointer into struct task_slice instead of a vcpu pointer. Signed-off-by: Juergen Gross --- xen/common/sched_arinc653.c | 8 ++++---- xen/common/sched_credit.c | 4 ++-- xen/common/sched_credit2.c | 4 ++-- xen/common/sched_null.c | 12 ++++++------ xen/common/sched_rt.c | 2 +- xen/common/schedule.c | 2 +- xen/include/xen/sched-if.h | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index 9dc1ff6a73..5733a2a6b8 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -554,9 +554,9 @@ a653sched_do_schedule( =20 /* * If there are more domains to run in the current major frame, set - * new_task equal to the address of next domain's VCPU structure. - * Otherwise, set new_task equal to the address of the idle task's VCPU - * structure. + * new_task equal to the address of next domain's sched_item structure. + * Otherwise, set new_task equal to the address of the idle task's + * sched_item structure. */ new_task =3D (sched_index < sched_priv->num_schedule_entries) ? sched_priv->schedule[sched_index].vc @@ -592,7 +592,7 @@ a653sched_do_schedule( * of the selected task's VCPU structure. */ ret.time =3D next_switch_time - now; - ret.task =3D new_task; + ret.task =3D new_task->sched_item; ret.migrated =3D 0; =20 BUG_ON(ret.time <=3D 0); diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 3ea0d40afb..29076e362b 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -2005,9 +2005,9 @@ out: */ ret.time =3D (is_idle_vcpu(snext->vcpu) ? -1 : tslice); - ret.task =3D snext->vcpu; + ret.task =3D snext->vcpu->sched_item; =20 - CSCHED_VCPU_CHECK(ret.task); + CSCHED_VCPU_CHECK(ret.task->vcpu); return ret; } =20 diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 8bee7cb9a2..9bf045d20f 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -3636,9 +3636,9 @@ csched2_schedule( * Return task to run next... */ ret.time =3D csched2_runtime(ops, cpu, snext, now); - ret.task =3D snext->vcpu; + ret.task =3D snext->vcpu->sched_item; =20 - CSCHED2_VCPU_CHECK(ret.task); + CSCHED2_VCPU_CHECK(ret.task->vcpu); return ret; } =20 diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c index 5570cc1a8c..62c51e2c83 100644 --- a/xen/common/sched_null.c +++ b/xen/common/sched_null.c @@ -746,10 +746,10 @@ static struct task_slice null_schedule(const struct s= cheduler *ops, if ( tasklet_work_scheduled ) { trace_var(TRC_SNULL_TASKLET, 1, 0, NULL); - ret.task =3D idle_vcpu[cpu]; + ret.task =3D idle_vcpu[cpu]->sched_item; } else - ret.task =3D per_cpu(npc, cpu).vcpu; + ret.task =3D per_cpu(npc, cpu).vcpu->sched_item; ret.migrated =3D 0; ret.time =3D -1; =20 @@ -784,7 +784,7 @@ static struct task_slice null_schedule(const struct sch= eduler *ops, { vcpu_assign(prv, wvc->vcpu, cpu); list_del_init(&wvc->waitq_elem); - ret.task =3D wvc->vcpu; + ret.task =3D wvc->vcpu->sched_item; goto unlock; } } @@ -793,10 +793,10 @@ static struct task_slice null_schedule(const struct s= cheduler *ops, spin_unlock(&prv->waitq_lock); } =20 - if ( unlikely(ret.task =3D=3D NULL || !vcpu_runnable(ret.task)) ) - ret.task =3D idle_vcpu[cpu]; + if ( unlikely(ret.task =3D=3D NULL || !item_runnable(ret.task)) ) + ret.task =3D idle_vcpu[cpu]->sched_item; =20 - NULL_VCPU_CHECK(ret.task); + NULL_VCPU_CHECK(ret.task->vcpu); return ret; } =20 diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 0639cdce0a..374a9d2383 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -1138,7 +1138,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now= , bool_t tasklet_work_sched } ret.time =3D snext->cur_budget; /* invoke the scheduler next time = */ } - ret.task =3D snext->vcpu; + ret.task =3D snext->vcpu->sched_item; =20 return ret; } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index ffc0920e5f..2a2f36636a 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1534,7 +1534,7 @@ static void schedule(void) sched =3D this_cpu(scheduler); next_slice =3D sched->do_schedule(sched, now, tasklet_work_scheduled); =20 - next =3D next_slice.task; + next =3D next_slice.task->vcpu; =20 sd->curr =3D next->sched_item; =20 diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 51c3477580..295101f9ef 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -176,9 +176,9 @@ static inline spinlock_t *pcpu_schedule_trylock(unsigne= d int cpu) } =20 struct task_slice { - struct vcpu *task; - s_time_t time; - bool_t migrated; + struct sched_item *task; + s_time_t time; + bool_t migrated; }; =20 struct scheduler { --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel