CachyOS / linux-cachyos

Archlinux Kernel based on different schedulers and some other performance improvements.
https://cachyos.org
GNU General Public License v3.0
779 stars 33 forks source link

error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’ #21

Closed RiverOnVenus closed 2 years ago

RiverOnVenus commented 2 years ago

Hey, I have just compiled the linux-cachyos-tt and encountered the following error:


kernel/sched/bs.h: In function ‘set_idle_cores’:
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:60:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   60 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:60:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   60 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:60:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   60 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:60:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   60 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:60:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   60 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:248,
                 from ./include/linux/export.h:33,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/kernel.h:17,
                 from ./include/linux/cpumask.h:10,
                 from ./include/linux/energy_model.h:4,
                 from kernel/sched/bs.c:7:
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
./include/asm-generic/rwonce.h:55:27: note: in definition of macro ‘__WRITE_ONCE’
   55 |         *(volatile typeof(x) *)&(x) = (val);                            \
      |                           ^
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h:166:31: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                               ^~
./include/asm-generic/rwonce.h:55:34: note: in definition of macro ‘__WRITE_ONCE’
   55 |         *(volatile typeof(x) *)&(x) = (val);                            \
      |                                  ^
kernel/sched/bs.h:166:17: note: in expansion of macro ‘WRITE_ONCE’
  166 |                 WRITE_ONCE(sds->has_idle_cores, val);
      |                 ^~~~~~~~~~
kernel/sched/bs.h: In function ‘test_idle_cores’:
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:49:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   49 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:49:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   49 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:49:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   49 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:28: note: in expansion of macro ‘__native_word’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |                            ^~~~~~~~~~~~~
./include/asm-generic/rwonce.h:49:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   49 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:332:23: note: in definition of macro ‘__compiletime_assert’
  332 |                 if (!(condition))                                       \
      |                       ^~~~~~~~~
././include/linux/compiler_types.h:352:9: note: in expansion of macro ‘_compiletime_assert’
  352 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:36:9: note: in expansion of macro ‘compiletime_assert’
   36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
      |         ^~~~~~~~~~~~~~~~~~
./include/asm-generic/rwonce.h:49:9: note: in expansion of macro ‘compiletime_assert_rwonce_type’
   49 |         compiletime_assert_rwonce_type(x);                              \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
././include/linux/compiler_types.h:308:27: note: in definition of macro ‘__unqual_scalar_typeof’
  308 |                 _Generic((x),                                           \
      |                           ^
./include/asm-generic/rwonce.h:50:9: note: in expansion of macro ‘__READ_ONCE’
   50 |         __READ_ONCE(x);                                                 \
      |         ^~~~~~~~~~~
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
kernel/sched/bs.h:175:37: error: ‘struct sched_domain_shared’ has no member named ‘has_idle_cores’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                                     ^~
./include/asm-generic/rwonce.h:44:73: note: in definition of macro ‘__READ_ONCE’
   44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
      |                                                                         ^
kernel/sched/bs.h:175:24: note: in expansion of macro ‘READ_ONCE’
  175 |                 return READ_ONCE(sds->has_idle_cores);
      |                        ^~~~~~~~~
  CC      arch/x86/xen/enlighten_pvh.o
make[2]: *** [scripts/Makefile.build:270: kernel/sched/bs.o] Error 1
make[1]: *** [scripts/Makefile.build:483: kernel/sched] Error 2
make[1]: *** Waiting for unfinished jobs....

This is the output of the entire compilation: https://paste.mozilla.org/Vxomrnzi

ptr1337 commented 2 years ago

Hey

thanks for your report! I do already see the issue and will fix them as soon I’m at home - it’s actually every kernel is affected from that. You could pull the cachy patch before I merged the cpu patches which should fix that temporary.

sirlucjan commented 2 years ago

I have confidence that I have found the culprit. @ptr1337 Please look at this:

https://github.com/ptr1337/kernel-patches/blob/master/5.18/dev/sched/0001-tt.patch#L2249

and this:

https://github.com/ptr1337/kernel-patches/blob/master/5.18/0001-cachy.patch#L3651

It looks like we will have to remove 0001-cachy.patch (or modify it under 0001-tt.patch) because it removes exactly what 0001-tt.patch needs.

sirlucjan commented 2 years ago

Also, I have a hunch bordering on certainty that the problem is exclusive to tt-scheduler, as there is no reference in any other to "has_idle_cores" which was removed in cachy-patches. So I would suggest creating cachy-patches-for-tt or trying to port tt-scheduler.

ptr1337 commented 2 years ago

Yes seems like that. Actually I will just create a revert of that sched patch which will be applied before tt-scheduler. Should work fine.

sirlucjan commented 2 years ago

I have temporarily disabled 0001-cachy.patch from use - until @ptr1337 makes the appropriate modifications.

ptr1337 commented 2 years ago

Actually it would be better to just revert the patch instead to remove them. Since it's mostly the complete base from the patches.

I'll try to give you rights for my repo.

sirlucjan commented 2 years ago

@ptr1337 As you wish: https://github.com/CachyOS/linux-cachyos/commit/5c508e5df60c99aeef74134990f30fbbab3a07ef

sirlucjan commented 2 years ago

@ptr1337 @RiverOnVenus Please try now: https://github.com/CachyOS/linux-cachyos/commit/613c4ce0e75eb125daf9b0dccece6d1aadd8cbdb

Let me know if it works.

ptr1337 commented 2 years ago

Should be now fine also with: https://github.com/CachyOS/linux-cachyos/commit/787ef459394eb75b1af9c03703a0b492a36982ca

RiverOnVenus commented 2 years ago

@sirlucjan @ptr1337 Now there is no problem, thank you very much and hope you have a good day! :)