[PATCH v2 10/15] sched: Fix build error in "sched/rt: Remove default bandwidth control"

Joel Fernandes (Google) posted 15 patches 1 year, 11 months ago
[PATCH v2 10/15] sched: Fix build error in "sched/rt: Remove default bandwidth control"
Posted by Joel Fernandes (Google) 1 year, 11 months ago
This fixes a build error introduced by  "sched/rt: Remove default
bandwidth control". The issue happens because a function is unused
when !CONFIG_SMP. It could be squashed into the original patch.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 kernel/sched/rt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 37bee56a70f7..d3065fe35c61 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -964,8 +964,10 @@ struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu)
 	return &cpu_rq(cpu)->rt;
 }
 
+#ifdef CONFIG_SMP
 static void __enable_runtime(struct rq *rq) { }
 static void __disable_runtime(struct rq *rq) { }
+#endif
 
 #endif /* CONFIG_RT_GROUP_SCHED */
 
-- 
2.34.1
Re: [PATCH v2 10/15] sched: Fix build error in "sched/rt: Remove default bandwidth control"
Posted by Chris Hyser 1 year, 11 months ago
On 3/12/24 21:24, Joel Fernandes (Google) wrote:
> This fixes a build error introduced by  "sched/rt: Remove default
> bandwidth control". The issue happens because a function is unused
> when !CONFIG_SMP. It could be squashed into the original patch.
>
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>


Reviewed-by: Chris Hyser <chris.hyser@oracle.com>


> ---
>   kernel/sched/rt.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 37bee56a70f7..d3065fe35c61 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -964,8 +964,10 @@ struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu)
>   	return &cpu_rq(cpu)->rt;
>   }
>   
> +#ifdef CONFIG_SMP
>   static void __enable_runtime(struct rq *rq) { }
>   static void __disable_runtime(struct rq *rq) { }
> +#endif
>   
>   #endif /* CONFIG_RT_GROUP_SCHED */
>