Real-time kerel not detected on patched 6.12
- rodw
-
- Away
- Platinum Member
-
Less
More
- Posts: 11201
- Thank you received: 3734
12 Jan 2025 03:05 #318733
by rodw
Replied by rodw on topic Real-time kerel not detected on patched 6.12
This does not work in all build environments. I think Cornholio is correctFor Raspberry I think following this guide should help: github.com/by/RT-Kernel
Only after git clone, download this patch:
forum.linuxcnc.org/media/kunena/attachme...ernel-realtime.patch
Then enter the Linux folder and enter: git apply ../sys-kernel-realtime.patch
After make menuconfig make sure that these are also selected:
forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=10#315643
Please Log in or Create an account to join the conversation.
- Cant do this anymore bye all
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 422
12 Jan 2025 04:53 #318738
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Real-time kerel not detected on patched 6.12
Whilst it does have that it's not the correct value.....from the required patch I've used with 6.1.69Like you assumed before I think those patches indeed didn't make it to the mainline kernel, but those are not needed to make a fully preemptible kernel.
The sysfs patch is only needed because LinuxCNC checks that indicator. Later I saw that the source of Raspberry also already has the arch_supports_rt in the kconfig.
config ARCH_SUPPORTS_RT
- bool
+ def_bool y
Please Log in or Create an account to join the conversation.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 366
- Thank you received: 126
12 Jan 2025 10:02 #318746
by royka
Replied by royka on topic Real-time kerel not detected on patched 6.12
Yes but we were talking about 6.12 and up, of course for 6.1.x you still need patches.
Please Log in or Create an account to join the conversation.
- Cant do this anymore bye all
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 422
12 Jan 2025 10:36 #318750
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Real-time kerel not detected on patched 6.12
And for 6.12 the patches from kernel.org are still required, other wise you can only select a low-latency desktop, not a fully_preemptible model, which would appear to be "a proper realtime kernel" suitable for a RTOS.
I've work through the image builder for 6.12.y, and I can say from configuring the kernel, that the patches from kernel.org are required. Depending on the commit you chose in the 6.12.y branch there may not be a matching patchset.
So it's not just a case of choosing the 6.12.y branch but also the commit that matches a patchset that is available.
Image below shows a kernel from the 6.12.y branch, commit 236f36133619216a5c8faea1a8c2c93c83efc2f4, which is kernel 6.12.8. This is has been patched with those from kernel.org and a patch, required for the build process to succeed, from Rods repo. As you can see there is an option to select the full preemptible kernel. Without the patch this does not appear. Yes while the sysfs patch does add the ability to report to Linuxcnc the kernel is "realtime" the kernel is only a low-latency-desktop.
As I type I'm running an image build on another machine.
I've work through the image builder for 6.12.y, and I can say from configuring the kernel, that the patches from kernel.org are required. Depending on the commit you chose in the 6.12.y branch there may not be a matching patchset.
So it's not just a case of choosing the 6.12.y branch but also the commit that matches a patchset that is available.
Image below shows a kernel from the 6.12.y branch, commit 236f36133619216a5c8faea1a8c2c93c83efc2f4, which is kernel 6.12.8. This is has been patched with those from kernel.org and a patch, required for the build process to succeed, from Rods repo. As you can see there is an option to select the full preemptible kernel. Without the patch this does not appear. Yes while the sysfs patch does add the ability to report to Linuxcnc the kernel is "realtime" the kernel is only a low-latency-desktop.
As I type I'm running an image build on another machine.
Attachments:
Please Log in or Create an account to join the conversation.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 366
- Thank you received: 126
12 Jan 2025 11:11 - 12 Jan 2025 11:20 #318755
by royka
Replied by royka on topic Real-time kerel not detected on patched 6.12
I don't know what you do wrong, but this is without any patch or modification:
It seems that this user also didn't need additional patches: forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=10#318472
It seems that this user also didn't need additional patches: forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=10#318472
Attachments:
Last edit: 12 Jan 2025 11:20 by royka.
Please Log in or Create an account to join the conversation.
- rodw
-
- Away
- Platinum Member
-
Less
More
- Posts: 11201
- Thank you received: 3734
12 Jan 2025 11:33 #318758
by rodw
Replied by rodw on topic Real-time kerel not detected on patched 6.12
Sorry, I have not had a chance to look at this over the weekend.
Please Log in or Create an account to join the conversation.
- Cant do this anymore bye all
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 422
12 Jan 2025 12:00 #318762
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Real-time kerel not detected on patched 6.12
Attachments:
Please Log in or Create an account to join the conversation.
- Cant do this anymore bye all
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 422
12 Jan 2025 12:08 #318763
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Real-time kerel not detected on patched 6.12
Another thing of interest there are still patches.
Directory listing of the patches that are for 6.12.8 none for 6.12.9 as you can see (6.12.8) has patches for sysfs entry and one to for enable arm rt.
So this looks like a very confusing kettle of fish.
-rw-rw-r-- 1 rmurphy rmurphy 1495 Jan 9 22:27 0001-arm-Disable-jump-label-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 2447 Jan 9 22:27 0001-ARM-vfp-Provide-vfp_state_hold-for-VFP-locking.patch
-rw-rw-r-- 1 rmurphy rmurphy 3888 Jan 9 22:27 0001-drm-i915-Use-preempt_disable-enable_rt-where-recomme.patch
-rw-rw-r-- 1 rmurphy rmurphy 1382 Jan 9 22:27 0001-hrtimer-Use-__raise_softirq_irqoff-to-raise-the-soft.patch
-rw-rw-r-- 1 rmurphy rmurphy 3902 Jan 9 22:27 0001-powerpc-Add-preempt-lazy-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 6700 Jan 9 22:27 0001-sched-Add-TIF_NEED_RESCHED_LAZY-infrastructure.patch
-rw-rw-r-- 1 rmurphy rmurphy 1384 Jan 9 22:27 0002-ARM-vfp-Use-vfp_state_hold-in-vfp_sync_hwstate.patch
-rw-rw-r-- 1 rmurphy rmurphy 3671 Jan 9 22:27 0002-drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch
-rw-rw-r-- 1 rmurphy rmurphy 1511 Jan 9 22:27 0002-locking-rt-Remove-one-__cond_lock-in-RT-s-spin_trylo.patch
-rw-rw-r-- 1 rmurphy rmurphy 1286 Jan 9 22:27 0002-powerpc-Large-user-copy-aware-of-full-rt-lazy-preemp.patch
-rw-rw-r-- 1 rmurphy rmurphy 11004 Jan 9 22:27 0002-sched-Add-Lazy-preemption-model.patch
-rw-rw-r-- 1 rmurphy rmurphy 970 Jan 9 22:27 0002-timers-Use-__raise_softirq_irqoff-to-raise-the-softi.patch
-rw-rw-r-- 1 rmurphy rmurphy 3282 Jan 9 22:27 0002-tracing-Record-task-flag-NEED_RESCHED_LAZY.patch
-rw-rw-r-- 1 rmurphy rmurphy 1404 Jan 9 22:27 0003-ARM-vfp-Use-vfp_state_hold-in-vfp_support_entry.patch
-rw-rw-r-- 1 rmurphy rmurphy 1741 Jan 9 22:27 0003-drm-i915-Don-t-check-for-atomic-context-on-PREEMPT_R.patch
-rw-rw-r-- 1 rmurphy rmurphy 2853 Jan 9 22:27 0003-locking-rt-Add-sparse-annotation-for-RCU.patch
-rw-rw-r-- 1 rmurphy rmurphy 2660 Jan 9 22:27 0003-riscv-add-PREEMPT_LAZY-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 3721 Jan 9 22:27 0003-sched-Enable-PREEMPT_DYNAMIC-for-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 7638 Jan 9 22:27 0003-softirq-Use-a-dedicated-thread-for-timer-wakeups-on-.patch
-rw-rw-r-- 1 rmurphy rmurphy 3696 Jan 9 22:27 0004-ARM-vfp-Move-sending-signals-outside-of-vfp_state_ho.patch
-rw-rw-r-- 1 rmurphy rmurphy 2170 Jan 9 22:27 0004-drm-i915-Disable-tracing-points-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1319 Jan 9 22:27 0004-locking-rt-Annotate-unlock-followed-by-lock-for-spar.patch
-rw-rw-r-- 1 rmurphy rmurphy 2089 Jan 9 22:27 0004-sched-x86-Enable-Lazy-preemption.patch
-rw-rw-r-- 1 rmurphy rmurphy 3199 Jan 9 22:27 0005-drm-i915-gt-Use-spin_lock_irq-instead-of-local_irq_d.patch
-rw-rw-r-- 1 rmurphy rmurphy 8921 Jan 9 22:27 0005-sched-Add-laziest-preempt-model.patch
-rw-rw-r-- 1 rmurphy rmurphy 1305 Jan 9 22:27 0006-drm-i915-Drop-the-irqs_disabled-check.patch
-rw-rw-r-- 1 rmurphy rmurphy 1151 Jan 9 22:27 0007-drm-i915-guc-Consider-also-RCU-depth-in-busy-loop.patch
-rw-rw-r-- 1 rmurphy rmurphy 762 Jan 9 22:27 0008-Revert-drm-i915-Depend-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 10272 Jan 9 22:27 0053-serial-8250-Switch-to-nbcon-console.patch
-rw-rw-r-- 1 rmurphy rmurphy 942 Jan 9 22:27 0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
-rw-rw-r-- 1 rmurphy rmurphy 379 Jan 9 22:27 Add_localversion_for_-RT_release.patch
-rw-rw-r-- 1 rmurphy rmurphy 1013 Jan 9 22:27 ARM__Allow_to_enable_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1370 Jan 9 22:27 arm-Disable-FAST_GUP-on-PREEMPT_RT-if-HIGHPTE-is-als.patch
-rw-rw-r-- 1 rmurphy rmurphy 3310 Jan 9 22:27 ARM__enable_irq_in_translation_section_permission_fault_handlers.patch
-rw-rw-r-- 1 rmurphy rmurphy 7625 Jan 9 22:27 netfilter-nft_counter-Use-u64_stats_t-for-statistic.patch
-rw-rw-r-- 1 rmurphy rmurphy 1061 Jan 9 22:27 POWERPC__Allow_to_enable_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1837 Jan 9 22:27 powerpc_kvm__Disable_in-kernel_MPIC_emulation_for_PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 3446 Jan 9 22:27 powerpc_pseries_iommu__Use_a_locallock_instead_local_irq_save.patch
-rw-rw-r-- 1 rmurphy rmurphy 903 Jan 9 22:27 powerpc-pseries-Select-the-generic-memory-allocator.patch
-rw-rw-r-- 1 rmurphy rmurphy 1120 Jan 9 22:27 powerpc_stackprotector__work_around_stack-guard_init_from_atomic.patch
-rw-rw-r-- 1 rmurphy rmurphy 1249 Jan 9 22:27 powerpc__traps__Use_PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1762 Jan 9 22:27 riscv-add-PREEMPT_AUTO-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 930 Jan 9 22:27 sched-Fixup-the-IS_ENABLED-check-for-PREEMPT_LAZY.patch
-rw-rw-r-- 1 rmurphy rmurphy 4049 Jan 9 22:27 series
-rw-rw-r-- 1 rmurphy rmurphy 1401 Jan 9 22:27 sysfs__Add__sys_kernel_realtime_entry.patch
-rw-rw-r-- 1 rmurphy rmurphy 2965 Jan 9 22:27 tracing-Remove-TRACE_FLAG_IRQS_NOSUPPORT.patch
Directory listing of the patches that are for 6.12.8 none for 6.12.9 as you can see (6.12.8) has patches for sysfs entry and one to for enable arm rt.
So this looks like a very confusing kettle of fish.
-rw-rw-r-- 1 rmurphy rmurphy 1495 Jan 9 22:27 0001-arm-Disable-jump-label-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 2447 Jan 9 22:27 0001-ARM-vfp-Provide-vfp_state_hold-for-VFP-locking.patch
-rw-rw-r-- 1 rmurphy rmurphy 3888 Jan 9 22:27 0001-drm-i915-Use-preempt_disable-enable_rt-where-recomme.patch
-rw-rw-r-- 1 rmurphy rmurphy 1382 Jan 9 22:27 0001-hrtimer-Use-__raise_softirq_irqoff-to-raise-the-soft.patch
-rw-rw-r-- 1 rmurphy rmurphy 3902 Jan 9 22:27 0001-powerpc-Add-preempt-lazy-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 6700 Jan 9 22:27 0001-sched-Add-TIF_NEED_RESCHED_LAZY-infrastructure.patch
-rw-rw-r-- 1 rmurphy rmurphy 1384 Jan 9 22:27 0002-ARM-vfp-Use-vfp_state_hold-in-vfp_sync_hwstate.patch
-rw-rw-r-- 1 rmurphy rmurphy 3671 Jan 9 22:27 0002-drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch
-rw-rw-r-- 1 rmurphy rmurphy 1511 Jan 9 22:27 0002-locking-rt-Remove-one-__cond_lock-in-RT-s-spin_trylo.patch
-rw-rw-r-- 1 rmurphy rmurphy 1286 Jan 9 22:27 0002-powerpc-Large-user-copy-aware-of-full-rt-lazy-preemp.patch
-rw-rw-r-- 1 rmurphy rmurphy 11004 Jan 9 22:27 0002-sched-Add-Lazy-preemption-model.patch
-rw-rw-r-- 1 rmurphy rmurphy 970 Jan 9 22:27 0002-timers-Use-__raise_softirq_irqoff-to-raise-the-softi.patch
-rw-rw-r-- 1 rmurphy rmurphy 3282 Jan 9 22:27 0002-tracing-Record-task-flag-NEED_RESCHED_LAZY.patch
-rw-rw-r-- 1 rmurphy rmurphy 1404 Jan 9 22:27 0003-ARM-vfp-Use-vfp_state_hold-in-vfp_support_entry.patch
-rw-rw-r-- 1 rmurphy rmurphy 1741 Jan 9 22:27 0003-drm-i915-Don-t-check-for-atomic-context-on-PREEMPT_R.patch
-rw-rw-r-- 1 rmurphy rmurphy 2853 Jan 9 22:27 0003-locking-rt-Add-sparse-annotation-for-RCU.patch
-rw-rw-r-- 1 rmurphy rmurphy 2660 Jan 9 22:27 0003-riscv-add-PREEMPT_LAZY-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 3721 Jan 9 22:27 0003-sched-Enable-PREEMPT_DYNAMIC-for-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 7638 Jan 9 22:27 0003-softirq-Use-a-dedicated-thread-for-timer-wakeups-on-.patch
-rw-rw-r-- 1 rmurphy rmurphy 3696 Jan 9 22:27 0004-ARM-vfp-Move-sending-signals-outside-of-vfp_state_ho.patch
-rw-rw-r-- 1 rmurphy rmurphy 2170 Jan 9 22:27 0004-drm-i915-Disable-tracing-points-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1319 Jan 9 22:27 0004-locking-rt-Annotate-unlock-followed-by-lock-for-spar.patch
-rw-rw-r-- 1 rmurphy rmurphy 2089 Jan 9 22:27 0004-sched-x86-Enable-Lazy-preemption.patch
-rw-rw-r-- 1 rmurphy rmurphy 3199 Jan 9 22:27 0005-drm-i915-gt-Use-spin_lock_irq-instead-of-local_irq_d.patch
-rw-rw-r-- 1 rmurphy rmurphy 8921 Jan 9 22:27 0005-sched-Add-laziest-preempt-model.patch
-rw-rw-r-- 1 rmurphy rmurphy 1305 Jan 9 22:27 0006-drm-i915-Drop-the-irqs_disabled-check.patch
-rw-rw-r-- 1 rmurphy rmurphy 1151 Jan 9 22:27 0007-drm-i915-guc-Consider-also-RCU-depth-in-busy-loop.patch
-rw-rw-r-- 1 rmurphy rmurphy 762 Jan 9 22:27 0008-Revert-drm-i915-Depend-on-PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 10272 Jan 9 22:27 0053-serial-8250-Switch-to-nbcon-console.patch
-rw-rw-r-- 1 rmurphy rmurphy 942 Jan 9 22:27 0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
-rw-rw-r-- 1 rmurphy rmurphy 379 Jan 9 22:27 Add_localversion_for_-RT_release.patch
-rw-rw-r-- 1 rmurphy rmurphy 1013 Jan 9 22:27 ARM__Allow_to_enable_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1370 Jan 9 22:27 arm-Disable-FAST_GUP-on-PREEMPT_RT-if-HIGHPTE-is-als.patch
-rw-rw-r-- 1 rmurphy rmurphy 3310 Jan 9 22:27 ARM__enable_irq_in_translation_section_permission_fault_handlers.patch
-rw-rw-r-- 1 rmurphy rmurphy 7625 Jan 9 22:27 netfilter-nft_counter-Use-u64_stats_t-for-statistic.patch
-rw-rw-r-- 1 rmurphy rmurphy 1061 Jan 9 22:27 POWERPC__Allow_to_enable_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1837 Jan 9 22:27 powerpc_kvm__Disable_in-kernel_MPIC_emulation_for_PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 3446 Jan 9 22:27 powerpc_pseries_iommu__Use_a_locallock_instead_local_irq_save.patch
-rw-rw-r-- 1 rmurphy rmurphy 903 Jan 9 22:27 powerpc-pseries-Select-the-generic-memory-allocator.patch
-rw-rw-r-- 1 rmurphy rmurphy 1120 Jan 9 22:27 powerpc_stackprotector__work_around_stack-guard_init_from_atomic.patch
-rw-rw-r-- 1 rmurphy rmurphy 1249 Jan 9 22:27 powerpc__traps__Use_PREEMPT_RT.patch
-rw-rw-r-- 1 rmurphy rmurphy 1762 Jan 9 22:27 riscv-add-PREEMPT_AUTO-support.patch
-rw-rw-r-- 1 rmurphy rmurphy 930 Jan 9 22:27 sched-Fixup-the-IS_ENABLED-check-for-PREEMPT_LAZY.patch
-rw-rw-r-- 1 rmurphy rmurphy 4049 Jan 9 22:27 series
-rw-rw-r-- 1 rmurphy rmurphy 1401 Jan 9 22:27 sysfs__Add__sys_kernel_realtime_entry.patch
-rw-rw-r-- 1 rmurphy rmurphy 2965 Jan 9 22:27 tracing-Remove-TRACE_FLAG_IRQS_NOSUPPORT.patch
Please Log in or Create an account to join the conversation.
- Cant do this anymore bye all
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 422
12 Jan 2025 12:14 #318764
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Real-time kerel not detected on patched 6.12
Yeah I figured that cos building an image with the 6.12.y branch fails when creating the final image. 6.1.y with the 6.1.69 kernel commit seems to build ok, image is created with Linuxcnc binaries and when patch has spi on at first boot. This was just seen by mounting the image and having a quick browse through the filesystem. Too effing late to test.Sorry, I have not had a chance to look at this over the weekend.
Please Log in or Create an account to join the conversation.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 366
- Thank you received: 126
12 Jan 2025 12:36 - 12 Jan 2025 13:32 #318767
by royka
Replied by royka on topic Real-time kerel not detected on patched 6.12
These are the exact commands I do:
git clone github.com/raspberrypi/linux.git -b rpi-6.12.y
cd linux
KERNEL=kernel_2712 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2712_defconfig
KERNEL=kernel_2712 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
After that you choose fully preemptible.
Now I wonder what you do different I guess you didn't use the defconfig, then you should set EXPERT=y like I mentioned before: General Setup => Configure standard kernel features (expert users) and press Y, and Fully Preemptible is visible. But I advise to apply the changes to the defconfig at github.com/by/RT-Kernel except the rtc and ntp options, and use the defconfig.
To enable the realtime indicator I used the patch that I posted on page 2.
wget forum.linuxcnc.org/media/kunena/attachme...ernel-realtime.patch
cd linux
git apply ../sys-kernel-realtime.patch
And to prevent compile errors (after the above patch) go at menuconfig to: General Setup => Kexec and crash features => press Y so CRASH_DUMP gets selected so VMCORE_INFO gets selected.
git clone github.com/raspberrypi/linux.git -b rpi-6.12.y
cd linux
KERNEL=kernel_2712 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2712_defconfig
KERNEL=kernel_2712 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
After that you choose fully preemptible.
Now I wonder what you do different I guess you didn't use the defconfig, then you should set EXPERT=y like I mentioned before: General Setup => Configure standard kernel features (expert users) and press Y, and Fully Preemptible is visible. But I advise to apply the changes to the defconfig at github.com/by/RT-Kernel except the rtc and ntp options, and use the defconfig.
To enable the realtime indicator I used the patch that I posted on page 2.
wget forum.linuxcnc.org/media/kunena/attachme...ernel-realtime.patch
cd linux
git apply ../sys-kernel-realtime.patch
And to prevent compile errors (after the above patch) go at menuconfig to: General Setup => Kexec and crash features => press Y so CRASH_DUMP gets selected so VMCORE_INFO gets selected.
Last edit: 12 Jan 2025 13:32 by royka.
The following user(s) said Thank You: Cant do this anymore bye all
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds