From nobody Wed Apr 24 00:04:40 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.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 (zohomail.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 1581349217261174.9934963006026; Mon, 10 Feb 2020 07:40:17 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j1B9i-0003oi-C2; Mon, 10 Feb 2020 15:39:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j1B9h-0003oc-8R for xen-devel@lists.xenproject.org; Mon, 10 Feb 2020 15:39:25 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 830b57e4-4c1b-11ea-b472-bc764e2007e4; Mon, 10 Feb 2020 15:39:23 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D6769AE95; Mon, 10 Feb 2020 15:39:22 +0000 (UTC) X-Inumbo-ID: 830b57e4-4c1b-11ea-b472-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 10 Feb 2020 16:39:20 +0100 Message-Id: <20200210153920.4297-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] xen/sched: remove sched_init_pdata() 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 , George Dunlap , Meng Xu , Dario Faggioli 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" sched_init_pdata() is used nowhere, it can be removed. Same applies to the .init_pdata hook of the per-scheduler interface. Signed-off-by: Juergen Gross --- xen/common/sched/credit.c | 12 ------------ xen/common/sched/credit2.c | 21 --------------------- xen/common/sched/null.c | 10 ---------- xen/common/sched/private.h | 8 -------- xen/common/sched/rt.c | 31 ------------------------------- 5 files changed, 82 deletions(-) diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index 05946eea6e..93d89da278 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -614,17 +614,6 @@ init_pdata(struct csched_private *prv, struct csched_p= cpu *spc, int cpu) spc->nr_runnable =3D 0; } =20 -static void -csched_init_pdata(const struct scheduler *ops, void *pdata, int cpu) -{ - unsigned long flags; - struct csched_private *prv =3D CSCHED_PRIV(ops); - - spin_lock_irqsave(&prv->lock, flags); - init_pdata(prv, pdata, cpu); - spin_unlock_irqrestore(&prv->lock, flags); -} - /* Change the scheduler of cpu to us (Credit). */ static spinlock_t * csched_switch_sched(struct scheduler *new_ops, unsigned int cpu, @@ -2273,7 +2262,6 @@ static const struct scheduler sched_credit_def =3D { .alloc_udata =3D csched_alloc_udata, .free_udata =3D csched_free_udata, .alloc_pdata =3D csched_alloc_pdata, - .init_pdata =3D csched_init_pdata, .deinit_pdata =3D csched_deinit_pdata, .free_pdata =3D csched_free_pdata, .switch_sched =3D csched_switch_sched, diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c index 231f87d960..b965cd1c7b 100644 --- a/xen/common/sched/credit2.c +++ b/xen/common/sched/credit2.c @@ -3818,26 +3818,6 @@ init_pdata(struct csched2_private *prv, struct csche= d2_pcpu *spc, return spc->runq_id; } =20 -static void -csched2_init_pdata(const struct scheduler *ops, void *pdata, int cpu) -{ - struct csched2_private *prv =3D csched2_priv(ops); - spinlock_t *old_lock; - unsigned long flags; - unsigned rqi; - - write_lock_irqsave(&prv->lock, flags); - old_lock =3D pcpu_schedule_lock(cpu); - - rqi =3D init_pdata(prv, pdata, cpu); - /* Move the scheduler lock to the new runq lock. */ - get_sched_res(cpu)->schedule_lock =3D &prv->rqd[rqi].lock; - - /* _Not_ pcpu_schedule_unlock(): schedule_lock may have changed! */ - spin_unlock(old_lock); - write_unlock_irqrestore(&prv->lock, flags); -} - /* Change the scheduler of cpu to us (Credit2). */ static spinlock_t * csched2_switch_sched(struct scheduler *new_ops, unsigned int cpu, @@ -4085,7 +4065,6 @@ static const struct scheduler sched_credit2_def =3D { .alloc_udata =3D csched2_alloc_udata, .free_udata =3D csched2_free_udata, .alloc_pdata =3D csched2_alloc_pdata, - .init_pdata =3D csched2_init_pdata, .deinit_pdata =3D csched2_deinit_pdata, .free_pdata =3D csched2_free_pdata, .switch_sched =3D csched2_switch_sched, diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c index 8c3101649d..82d5d1baab 100644 --- a/xen/common/sched/null.c +++ b/xen/common/sched/null.c @@ -166,15 +166,6 @@ static void init_pdata(struct null_private *prv, struc= t null_pcpu *npc, npc->unit =3D NULL; } =20 -static void null_init_pdata(const struct scheduler *ops, void *pdata, int = cpu) -{ - struct null_private *prv =3D null_priv(ops); - - ASSERT(pdata); - - init_pdata(prv, pdata, cpu); -} - static void null_deinit_pdata(const struct scheduler *ops, void *pcpu, int= cpu) { struct null_private *prv =3D null_priv(ops); @@ -1042,7 +1033,6 @@ static const struct scheduler sched_null_def =3D { .deinit =3D null_deinit, .alloc_pdata =3D null_alloc_pdata, .free_pdata =3D null_free_pdata, - .init_pdata =3D null_init_pdata, .switch_sched =3D null_switch_sched, .deinit_pdata =3D null_deinit_pdata, =20 diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index 2a94179baa..367811a12f 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -306,7 +306,6 @@ struct scheduler { struct sched_unit *, void *); void (*free_pdata) (const struct scheduler *, void *, int); void * (*alloc_pdata) (const struct scheduler *, int); - void (*init_pdata) (const struct scheduler *, void *, int); void (*deinit_pdata) (const struct scheduler *, void *, int); =20 /* Returns ERR_PTR(-err) for error, NULL for 'nothing needed'. */ @@ -408,13 +407,6 @@ static inline void sched_free_pdata(const struct sched= uler *s, void *data, s->free_pdata(s, data, cpu); } =20 -static inline void sched_init_pdata(const struct scheduler *s, void *data, - int cpu) -{ - if ( s->init_pdata ) - s->init_pdata(s, data, cpu); -} - static inline void sched_deinit_pdata(const struct scheduler *s, void *dat= a, int cpu) { diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c index 66585ed50a..c24cd2ac32 100644 --- a/xen/common/sched/rt.c +++ b/xen/common/sched/rt.c @@ -713,36 +713,6 @@ rt_deinit(struct scheduler *ops) xfree(prv); } =20 -/* - * Point per_cpu spinlock to the global system lock; - * All cpu have same global system lock - */ -static void -rt_init_pdata(const struct scheduler *ops, void *pdata, int cpu) -{ - struct rt_private *prv =3D rt_priv(ops); - spinlock_t *old_lock; - unsigned long flags; - - old_lock =3D pcpu_schedule_lock_irqsave(cpu, &flags); - - /* - * TIMER_STATUS_invalid means we are the first cpu that sees the timer - * allocated but not initialized, and so it's up to us to initialize i= t. - */ - if ( prv->repl_timer.status =3D=3D TIMER_STATUS_invalid ) - { - init_timer(&prv->repl_timer, repl_timer_handler, (void *)ops, cpu); - dprintk(XENLOG_DEBUG, "RTDS: timer initialized on cpu %u\n", cpu); - } - - /* Move the scheduler lock to our global runqueue lock. */ - get_sched_res(cpu)->schedule_lock =3D &prv->lock; - - /* _Not_ pcpu_schedule_unlock(): per_cpu().schedule_lock changed! */ - spin_unlock_irqrestore(old_lock, flags); -} - /* Change the scheduler of cpu to us (RTDS). */ static spinlock_t * rt_switch_sched(struct scheduler *new_ops, unsigned int cpu, @@ -1568,7 +1538,6 @@ static const struct scheduler sched_rtds_def =3D { .dump_settings =3D rt_dump, .init =3D rt_init, .deinit =3D rt_deinit, - .init_pdata =3D rt_init_pdata, .switch_sched =3D rt_switch_sched, .deinit_pdata =3D rt_deinit_pdata, .alloc_domdata =3D rt_alloc_domdata, --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel