Real-time preemption not being applied to the kernel

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-time preemption not being applied to the kernel

Jump to solution
121 Views
Contributor III

Building the latest 5.4.24 kernel with Yocto Zeus for the Embedian iMX8MM SMARC SoM. I've added a .bbappend file with correct SRC_URI and checksum, then build with bitbake.

I then go into `bitbake -c menuconfig linux-smarcimx8mm` and select `Embedded System` which then allows me to select a fully preemptive real-time kernel. I select the fully preemptive option and build again. When I go back to `...menuconfig...` I see that full preemption is not selected and instead low latency desktop is selected. The LOCALVERSION variable in config doesn't get updated either.

I've tried several approaches but I cannot get the fully preemptive kernel to be built.

Also, after selecting full preemption Yocto complains the kernel has been tainted when doing a build.

0 Kudos
1 Solution
75 Views
Contributor III

tl;dr - I had to run menuconfig and build several times before real time preemption was compiled into the kernel.

 

I set the settings through menuconfig (embedded system and fully preemptive) and did a `bitbake -c diffconfig virtual/kernel` and viewed the fragments.cfg file output. Turns out CONFIG_PREEMPT_RT_FULL is no longer used, instead multiple other configurations are set.

I'm still having a problem of `bitbake -c menuconfig virtual/kernel` not always saving my settings. I even added a do_configure() function to my bbappend kernel recipe file to load in my fragment file (*.cfg). I still don't get an RT kernel. The only thing that seems to work is run menuconfig and build several times before the settings take. I know you suggested to change the main imx..._defconfig file but this should not be the correct solution. Fragment files should work and saving settings from menuconfig should also work the first time.

I verify real time preemption is set by going to the folder:

~/smarc-imx8mm-zeus-release/core-image-minimal/tmp/work/smarcimx8mm2g-poky-linux/linux-smarcimx8mm/5.4-r0/build/include/generated

I then open file compile.h and look at the UTS_VERSION string to see if "PREEMPT" and "RT" are present since this is where `uname -v` gets its information.

View solution in original post

0 Kudos
4 Replies
108 Views
NXP Employee
NXP Employee

Hi,

After you selected the full preemption in menuconfig, you can find what has been added about full preemption,like CONFIG_XXXXX. Then you can copy the config to imx8_xxx.defconfig.Then you can make the kernel.It's a effective way changing the kernel config that  i have found.

Best Regards,

Zhiming

0 Kudos
99 Views
Contributor III

I believe I found the config file that menuconfig saves to, problem is menuconfig doesn't always save my configuration. Example: I turned off full preemption and saved. When I went back to menuconfig it still had full preemption selected.

I've noticed from the patch file that CONFIG_PREEMPT_RT_FULL is no longer used, is this correct? Is this replaced with CONFIG_PREEMPT_RT along with other configuration options?

I was able to get `bitbake -c diffconfig virtual/kernel` to output the differences which I will use as a fragment file (*.cfg) which will be applied from my bbappend file. Sometimes I cannot get a difference because menuconfig won't always save my changes, don't know what's going on there.

Lastly, is there a place within the output kernel code (or build artifacts) where I can see what `uname -v` will output? I'd like to check if `PREEMPT RT` is being applied to the version string without having to build an SD card and fire up the hardware with the new image.

0 Kudos
86 Views
NXP Employee
NXP Employee

Hi,

When you exit menuconfig, the config file is saved in .config in kernel main folder,then you can find /imx-yocto-bsp/build-xwayland_8qmm/tmp/work-shared/imx8mmevk/kernel-source/arch/arm64/configs/imx_v8_defconfig. Open the defconfig,the add the CONFIG__XXX from .config to defconfig.You can try CONFIG_PREEMPT_RT.

0 Kudos
76 Views
Contributor III

tl;dr - I had to run menuconfig and build several times before real time preemption was compiled into the kernel.

 

I set the settings through menuconfig (embedded system and fully preemptive) and did a `bitbake -c diffconfig virtual/kernel` and viewed the fragments.cfg file output. Turns out CONFIG_PREEMPT_RT_FULL is no longer used, instead multiple other configurations are set.

I'm still having a problem of `bitbake -c menuconfig virtual/kernel` not always saving my settings. I even added a do_configure() function to my bbappend kernel recipe file to load in my fragment file (*.cfg). I still don't get an RT kernel. The only thing that seems to work is run menuconfig and build several times before the settings take. I know you suggested to change the main imx..._defconfig file but this should not be the correct solution. Fragment files should work and saving settings from menuconfig should also work the first time.

I verify real time preemption is set by going to the folder:

~/smarc-imx8mm-zeus-release/core-image-minimal/tmp/work/smarcimx8mm2g-poky-linux/linux-smarcimx8mm/5.4-r0/build/include/generated

I then open file compile.h and look at the UTS_VERSION string to see if "PREEMPT" and "RT" are present since this is where `uname -v` gets its information.

View solution in original post

0 Kudos