Jetson Xaver Generic and RT kernel difference

I have used the RT kernel patch inside the L4T linux source to build a RT kernel for Xavier board. The output of the uname is shown as follows:

nvidia@nvidia-xavier-rt:~$ uname -a
Linux nvidia-xavier-rt 4.9.140-rt93-tegra #1 SMP PREEMPT RT Sun Jun 7 23:08:52 EDT 2020 aarch64 aarch64 aarch64 GNU/Linux
nvidia@nvidia-xavier-rt:~$ uname -r
4.9.140-rt93-tegra

And the results of top with RT kernel:

  1 root      20   0  161656   8776   5820 S   0.0  0.0   0:20.63 systemd     
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.04 kthreadd    
    3 root      20   0       0      0      0 S   0.0  0.0   0:05.30 ksoftirqd/0 
    4 root      -2   0       0      0      0 S   0.0  0.0   0:02.02 ktimersoft+ 
    6 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    8 root      -2   0       0      0      0 S   0.0  0.0   0:03.92 rcu_preempt 
    9 root      -2   0       0      0      0 S   0.0  0.0   0:01.64 rcu_sched   
   10 root      -2   0       0      0      0 S   0.0  0.0   0:00.00 rcub/0      
   11 root      -2   0       0      0      0 S   0.0  0.0   0:01.85 rcuc/0      
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kswork      
   13 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 posixcputm+ 
   14 root      rt   0       0      0      0 S   0.0  0.0   0:00.08 migration/0 
   15 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 watchdog/0  
   16 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0  

And I have another board which is flashed using jetpack 4.4, which I think is generic kernel:

nvidia@nvidia-desktop:~$ uname -a
Linux nvidia-desktop 4.9.140-tegra #1 SMP PREEMPT Wed Apr 8 18:15:20 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux
nvidia@nvidia-desktop:~$ uname -r
4.9.140-tegra

The results using top:

   1 root      20   0  161500   8880   6000 S   0.0  0.0   0:02.10 systemd     
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.01 kthreadd    
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/0 
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0 
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.05 kworker/u1+ 
    7 root      20   0       0      0      0 S   0.0  0.0   0:00.02 rcu_preempt 
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.01 rcu_sched   
    9 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh      
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/0 
   11 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 lru-add-dr+ 
   12 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 watchdog/0  
   13 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/0     
   14 root      20   0       0      0      0 S   0.0  0.0   0:00.00 cpuhp/1 

From the results of top, both of them have processes with priority “rt”. And when I use chrt to check the schduling policy, both of them have policy like SCHED_FIFO and SCHED_DEADLINE.

What are the difference between these two kernels?

Not sure if below link help.

https://rt.wiki.kernel.org/index.php/Frequently_Asked_Questions

Thanks for your reply. The link is useful for understanding how RT kernel patch works and how to build RT apps. My question is more on the L4T (Linux4Tegra) kernel, does it support preemption by default?

Not sure what’s the default setting, however you can check it in kernel configuration menu

@liangkai, yes the Xavier L4T kernel does support preemption with CONFIG_PREEMPT set to =y.

root@xavier:~# zgrep "PREEMPT" /proc/config.gz 
CONFIG_PREEMPT_RCU=y
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_PREEMPTIRQ_EVENTS is not set
# CONFIG_PREEMPT_TRACER is not set

However, this is a basic preemption. If CONFIG_PREEMPT is enabled, then kernel code can be preempted everywhere, except when the code has disabled local interrupts.

Other preemption option can also be set through kernel menuconfig. You can find more information about them in the kernel source at: kernel/Kconfig.preempt file.

1 Like

Thank you.

From the results of top, both of them have processes with priority “rt”. And when I use chrt to check the schduling policy, both of them have policy like SCHED_FIFO and SCHED_DEADLINE.
What are the difference between these two kernels?

Both RT and Non-RT linux can have tasks with different scheduling class.
Tasks marked with RT scheduling class has higher priority than other classes except DL.
Difference between RT & non-RT mainly is that RT kernel has lesser non-preemptible code regions.

1 Like