Re: [PATCH RFC] sched: Micro optimization in pick_next_task() and in check_preempt_curr()

From: Steven Rostedt
Date: Thu Dec 19 2019 - 08:50:47 EST


On Thu, 19 Dec 2019 15:39:14 +0300
Kirill Tkhai <ktkhai@xxxxxxxxxxxxx> wrote:

> @@ -6569,6 +6558,11 @@ void __init sched_init(void)
> unsigned long ptr = 0;
> int i;
>
> + BUG_ON(&idle_sched_class > &fair_sched_class ||
> + &fair_sched_class > &rt_sched_class ||
> + &rt_sched_class > &dl_sched_class ||
> + &dl_sched_class > &stop_sched_class);
> +

Can this be a BUILD_BUG_ON? These address should all be constants.

-- Steve



> wait_bit_init();
>