From nobody Tue Feb 10 02:50:01 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1576655402; cv=none; d=zohomail.com; s=zohoarc; b=VoqP9RSq37xbjldBrGXuV0MPSvSyscKYxdhnRq/6ATn6dGJ/aIPegC3TfYkwc8K8/Hx1jRV5tIkxLrh9dD8HjOrSmDjONGP08uxo2zVaIYrSpg/1oGw/uanimW1pBddvKr3N3QTejLtnBFyjVZqbBzC7g0J+JzVZMGgAVIp+Gl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576655402; 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; bh=vB12L7az6oTRgYe1lQYe3aohoVMgXgilppP2RRZ6eIY=; b=SnYALS8yzPQVBwoYju6SLBtWp0kQT9KIi32eekRCoF3Sb8bVQOPhwgPeHhvwDGOP1gLy97J5p/Eip2JXUwivmIBGriK5wPhJNS2dsu0ni8y7REgD+T4I5/llJ04gVJ9i8G2/LrxA7l3Z9+Ewbfp0sFu7EgHjOJiEGmJhUB1KtRk= ARC-Authentication-Results: i=1; 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 1576655402641938.4650022839174; Tue, 17 Dec 2019 23:50:02 -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 1ihU5K-0003mO-4i; Wed, 18 Dec 2019 07:49:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihU5J-0003lu-5i for xen-devel@lists.xenproject.org; Wed, 18 Dec 2019 07:49:29 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id deef0b90-216a-11ea-a1e1-bc764e2007e4; Wed, 18 Dec 2019 07:49:08 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AC402AE52; Wed, 18 Dec 2019 07:49:04 +0000 (UTC) X-Inumbo-ID: deef0b90-216a-11ea-a1e1-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 18 Dec 2019 08:48:58 +0100 Message-Id: <20191218074859.21665-9-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191218074859.21665-1-jgross@suse.com> References: <20191218074859.21665-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 8/9] xen/sched: eliminate sched_tick_suspend() and sched_tick_resume() 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 , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Dario Faggioli , Jan Beulich , Volodymyr Babchuk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= 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_tick_suspend() and sched_tick_resume() only call rcu related functions, so eliminate them and do the rcu_idle_timer*() calling in rcu_idle_[enter|exit](). Signed-off-by: Juergen Gross Acked-by: Julien Grall Reviewed-by: Dario Faggioli --- xen/arch/arm/domain.c | 6 +++--- xen/arch/x86/acpi/cpu_idle.c | 15 ++++++++------- xen/arch/x86/cpu/mwait-idle.c | 8 ++++---- xen/common/rcupdate.c | 7 +++++-- xen/common/sched/schedule.c | 12 ------------ xen/include/xen/rcupdate.h | 3 --- xen/include/xen/sched.h | 2 -- 7 files changed, 20 insertions(+), 33 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index c0a13aa0ab..aa3df3b3ba 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -46,8 +46,8 @@ static void do_idle(void) { unsigned int cpu =3D smp_processor_id(); =20 - sched_tick_suspend(); - /* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */ + rcu_idle_enter(cpu); + /* rcu_idle_enter() can raise TIMER_SOFTIRQ. Process it now. */ process_pending_softirqs(); =20 local_irq_disable(); @@ -58,7 +58,7 @@ static void do_idle(void) } local_irq_enable(); =20 - sched_tick_resume(); + rcu_idle_exit(cpu); } =20 void idle_loop(void) diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index 5edd1844f4..2676f0d7da 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -599,7 +599,8 @@ void update_idle_stats(struct acpi_processor_power *pow= er, =20 static void acpi_processor_idle(void) { - struct acpi_processor_power *power =3D processor_powers[smp_processor_= id()]; + unsigned int cpu =3D smp_processor_id(); + struct acpi_processor_power *power =3D processor_powers[cpu]; struct acpi_processor_cx *cx =3D NULL; int next_state; uint64_t t1, t2 =3D 0; @@ -648,8 +649,8 @@ static void acpi_processor_idle(void) =20 cpufreq_dbs_timer_suspend(); =20 - sched_tick_suspend(); - /* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */ + rcu_idle_enter(cpu); + /* rcu_idle_enter() can raise TIMER_SOFTIRQ. Process it now. */ process_pending_softirqs(); =20 /* @@ -658,10 +659,10 @@ static void acpi_processor_idle(void) */ local_irq_disable(); =20 - if ( !cpu_is_haltable(smp_processor_id()) ) + if ( !cpu_is_haltable(cpu) ) { local_irq_enable(); - sched_tick_resume(); + rcu_idle_exit(cpu); cpufreq_dbs_timer_resume(); return; } @@ -786,7 +787,7 @@ static void acpi_processor_idle(void) /* Now in C0 */ power->last_state =3D &power->states[0]; local_irq_enable(); - sched_tick_resume(); + rcu_idle_exit(cpu); cpufreq_dbs_timer_resume(); return; } @@ -794,7 +795,7 @@ static void acpi_processor_idle(void) /* Now in C0 */ power->last_state =3D &power->states[0]; =20 - sched_tick_resume(); + rcu_idle_exit(cpu); cpufreq_dbs_timer_resume(); =20 if ( cpuidle_current_governor->reflect ) diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c index 52413e6da1..f49b04c45b 100644 --- a/xen/arch/x86/cpu/mwait-idle.c +++ b/xen/arch/x86/cpu/mwait-idle.c @@ -755,8 +755,8 @@ static void mwait_idle(void) =20 cpufreq_dbs_timer_suspend(); =20 - sched_tick_suspend(); - /* sched_tick_suspend() can raise TIMER_SOFTIRQ. Process it now. */ + rcu_idle_enter(cpu); + /* rcu_idle_enter() can raise TIMER_SOFTIRQ. Process it now. */ process_pending_softirqs(); =20 /* Interrupts must be disabled for C2 and higher transitions. */ @@ -764,7 +764,7 @@ static void mwait_idle(void) =20 if (!cpu_is_haltable(cpu)) { local_irq_enable(); - sched_tick_resume(); + rcu_idle_exit(cpu); cpufreq_dbs_timer_resume(); return; } @@ -806,7 +806,7 @@ static void mwait_idle(void) if (!(lapic_timer_reliable_states & (1 << cstate))) lapic_timer_on(); =20 - sched_tick_resume(); + rcu_idle_exit(cpu); cpufreq_dbs_timer_resume(); =20 if ( cpuidle_current_governor->reflect ) diff --git a/xen/common/rcupdate.c b/xen/common/rcupdate.c index a56103c6f7..cb712c8690 100644 --- a/xen/common/rcupdate.c +++ b/xen/common/rcupdate.c @@ -459,7 +459,7 @@ int rcu_needs_cpu(int cpu) * periodically poke rcu_pedning(), so that it will invoke the callback * not too late after the end of the grace period. */ -void rcu_idle_timer_start() +static void rcu_idle_timer_start(void) { struct rcu_data *rdp =3D &this_cpu(rcu_data); =20 @@ -475,7 +475,7 @@ void rcu_idle_timer_start() rdp->idle_timer_active =3D true; } =20 -void rcu_idle_timer_stop() +static void rcu_idle_timer_stop(void) { struct rcu_data *rdp =3D &this_cpu(rcu_data); =20 @@ -633,10 +633,13 @@ void rcu_idle_enter(unsigned int cpu) * Se the comment before cpumask_andnot() in rcu_start_batch(). */ smp_mb(); + + rcu_idle_timer_start(); } =20 void rcu_idle_exit(unsigned int cpu) { + rcu_idle_timer_stop(); ASSERT(cpumask_test_cpu(cpu, &rcu_ctrlblk.idle_cpumask)); cpumask_clear_cpu(cpu, &rcu_ctrlblk.idle_cpumask); } diff --git a/xen/common/sched/schedule.c b/xen/common/sched/schedule.c index 3307e88b6c..ddbface969 100644 --- a/xen/common/sched/schedule.c +++ b/xen/common/sched/schedule.c @@ -3265,18 +3265,6 @@ void schedule_dump(struct cpupool *c) rcu_read_unlock(&sched_res_rculock); } =20 -void sched_tick_suspend(void) -{ - rcu_idle_enter(smp_processor_id()); - rcu_idle_timer_start(); -} - -void sched_tick_resume(void) -{ - rcu_idle_timer_stop(); - rcu_idle_exit(smp_processor_id()); -} - void wait(void) { schedule(); diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h index 13850865ed..174d058113 100644 --- a/xen/include/xen/rcupdate.h +++ b/xen/include/xen/rcupdate.h @@ -148,7 +148,4 @@ int rcu_barrier(void); void rcu_idle_enter(unsigned int cpu); void rcu_idle_exit(unsigned int cpu); =20 -void rcu_idle_timer_start(void); -void rcu_idle_timer_stop(void); - #endif /* __XEN_RCUPDATE_H */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index b2f48a3512..e4263de2d5 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -688,8 +688,6 @@ void sched_destroy_domain(struct domain *d); long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *); long sched_adjust_global(struct xen_sysctl_scheduler_op *); int sched_id(void); -void sched_tick_suspend(void); -void sched_tick_resume(void); void vcpu_wake(struct vcpu *v); long vcpu_yield(void); void vcpu_sleep_nosync(struct vcpu *v); --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel