[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <edf63e92-dd04-f795-7bba-d5d3c65acaff@virtuozzo.com>
Date: Thu, 19 Dec 2019 16:53:33 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
bsegall@...gle.com, mgorman@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] sched: Micro optimization in pick_next_task() and in
check_preempt_curr()
On 19.12.2019 16:50, Steven Rostedt wrote:
> On Thu, 19 Dec 2019 15:39:14 +0300
> Kirill Tkhai <ktkhai@...tuozzo.com> 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.
BUILD_BUG_ON() is compile-time check, while address is assigned
at link time, isn't it?!
Anyway, plain BUILD_BUG_ON() fails here with the following:
In file included from ./arch/x86/include/asm/current.h:5,
from ./include/linux/sched.h:12,
from kernel/sched/sched.h:5,
from kernel/sched/core.c:9:
kernel/sched/core.c: In function ‘sched_init’:
./include/linux/compiler.h:394:38: error: call to ‘__compiletime_assert_6561’ declared with attribute error: BUILD_BUG_ON failed: &idle_sched_class > &fair_sched_class || &fair_sched_class > &rt_sched_class || &rt_sched_class > &dl_sched_class || &dl_sched_class > &stop_sched_class
394 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
| ^
./include/linux/compiler.h:375:4: note: in definition of macro ‘__compiletime_assert’
375 | prefix ## suffix(); \
| ^~~~~~
./include/linux/compiler.h:394:2: note: in expansion of macro ‘_compiletime_assert’
394 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
kernel/sched/core.c:6561:2: note: in expansion of macro ‘BUILD_BUG_ON’
6561 | BUILD_BUG_ON(&idle_sched_class > &fair_sched_class ||
| ^~~~~~~~~~~~
> -- Steve
>
>
>
>> wait_bit_init();
>>
Powered by blists - more mailing lists