This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM623:AM623:在 AM62x 的 RT-Linux 系统中、高优先级进程将受不同内核的低优先级进程的影响。

Guru**** 2439560 points
Other Parts Discussed in Thread: AM623, AM62P

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1538677/am623-am623-in-the-rt-linux-system-of-am62x-high-priority-processes-will-be-affected-by-low-priority-processes-of-different-cores

器件型号:AM623
主题: AM62P 中讨论的其他器件

工具/软件:

您好TI团队、团队、您好

我有一个问题:在使用 AM62x 的 11.00.09.04 版本 SDK 构建的 RT-Linux 系统中、不同内核的低优先级进程将影响高优先级进程。
我有个问题在使用AM x的11.00.09.04版本SDK构建的RT μ Linux系统中、高优先级进程会受到不同内核的低优先级进程的影响。Ω Ω

#背景:#背景:

CPU:AM623CPU:AM623

SDK:PROCESSOR-SDK-LINUX-RT SDK-AM62X 11.00.09.04
SDK:Processor–SDK–Linux–RT–AM62 X 11.00.09.04

图像:tisdk-base-image图片:tisdk-base-image

内核:Linux 版本 6.12.17-g685e771524+(xxx@xxx-machine)(aarch64-oe-linux-gcc (GCC) 13.3.0、GNU ld (GNU binutils) 2.42.0.20240723)#1 SMP_PREEMPT_RT Tue Jul 8 09:59:11 CST 2025
内核:Linux版本6.12.17 -g685e771524+(xxx)(xxx-machine(Aarch64-oe-linux-gcc、GCC(13.3.0)GNU ld)GNU binutils)2.42.0.20240723:#1 SMP_RT 星期二 Jul 8 09:59@11 CST 2025

其他:isolcpus=1-3其他:等容=1-3

#例如:例如:

我编写了一个测试脚本“loop_cat_hardirqs.sh",“,内容、内容为:
我写了一个测试脚本“loop_cat_hardirqs.sh",“,内容是、内容是:

```μ s

#!/bin/bash #!/ bin/bash

做;do虽然真实;

       CAT /proc/interrupts >/dev/null 2>&1.
CAT /proc/interrupts/dev/null 2.

done做 μ s

```μ s

在后台执行“loop_cat_hardirqs.sh"并“并检查进程状态:
在后台执行“loop_cat_hardirqs.sh"并检查进程状态“并检查进程状态:

CPU 2 负载为 100%CPU 2负载100 %

OTHER策略::SCHED_T Ü V SCHED_OTHER

优先级:0优先级:0

编写了另一个测试脚本“loop_cat_hardirqs_50times.sh",“,内容、内容为:
编写了另一个测试脚本“loop_cat_hardirqs_50times.sh",“,内容为、内容为:

```μ s

#!/bin/bash #!/ bin/bash

对于 ((i=1;i<=50;i++)) 对于(i = 1、I <= 50)I ++、

do做 μ s

       CAT /proc/interrupts >/dev/null 2>&1.
CAT /proc/interrupts/dev/null 2.

done做 μ s

```μ s

根据最高优先级 99 执行五次“loop_cat_hardirqs_50times.sh"并“并分配给 CPU 3、然后检查执行时间。
根据分配给CPU 3的最高优先级99执行“loop_cat_hardirqs_50times.sh"五次“五次、然后检查执行时间。

1) 后台没有“loop_cat_hardirqs.sh"进程“进程、其执行时间如下:
1)后台没有“loop_cat_hardirqs.sh"进程“进程、其执行时间如下:

2) 后台有一个“loop_cat_hardirqs.sh"进程“进程、其执行时间如下:
2)后台有一个“loop_cat_hardirqs.sh"进程“进程、其执行时间如下:

从图中可以看出、执行时间从 0.26 秒增加到了 0.32 秒、增加了 0.06 秒。
可以看到、执行时间从0.26秒增加到0.32秒、增加了0.06秒。μ s

如何优化实时性能?
如何优化实时性能?μ s

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我不清楚您尝试通过测试循环实现什么、以及哪些是合理的结果。  您是否有在其他 A53 四核上运行相同的参考点? 在此测试中、您的文件系统在哪里、简单看一下我认为只写入一个文件就会成为时间关键延迟的一部分。 我建议使用 https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests 上的建议工具之一 、而不是编写自己的合成工具。

    我的建议是在更高端的设备上尝试同样的方法 ,如 https://www.ti.com/product/AM62P 。

    我们使用 cyclictest https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/latest/exports/docs/devices/AM62X/linux/RT_Linux_Performance_Guide system.html#system-basedures 作为基准测试。  https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/latest/exports/docs/linux/How_to_Guides/Target/How_to_linux.html 是我们的指导、一般的实时 Tune_Real_Time_Linux 调优超出了此论坛的免费支持范围。

     Pekka

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此 https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1538701/am623-rt-linux-isolated-core-task-interrupted-by-other-core-task/5918495#5918495 上有一个并行帖子 、其中附件 /cfs-file/__key/communityserver-discussions-components-files/791/4130.AM62x-RT-Linux-task-interrupt_2D00_July10_2D00_2025.docx 是主要附加信息。 最后、我们将使用这个 e2e 进行进一步讨论。

     Pekka

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Pekka、

    我在 AM62P-SK 上进行了测试、得到了更好的结果、但隔离式内核上的任务也相互影响、我想这是否是预期的结果、因为它们在同一个 DDR、高速缓存上运行。 我同意应该在竞争对手的器件上运行以进行比较。 但我没有

    T.

    root@am62pxx-evm:/home# uname -a
    Linux am62pxx-evm 6.6.32-rt32-ti-rt-g04a9ad081f0f-dirty #1 SMP PREEMPT_RT Fri Jul 26 14:42:37 UTC 2024 aarch64 GNU/Linux
    
    root@am62pxx-evm:/home# ls
    loop_cat_hardirqs.sh  loop_cat_hardirqs_50times.sh  weston
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.18s
    user    0m 0.03s
    sys     0m 0.15s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.18s
    user    0m 0.03s
    sys     0m 0.15s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.18s
    user    0m 0.03s
    sys     0m 0.15s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.18s
    user    0m 0.03s
    sys     0m 0.15s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.18s
    user    0m 0.03s
    sys     0m 0.15s
    root@am62pxx-evm:/home# taskset -c 2 ./loop_cat_hardirqs.sh &
    [2] 1498
    root@am62pxx-evm:/home# taskset -p 1498
    pid 1498's current affinity mask: 4
    root@am62pxx-evm:/home# chrt -p 1498
    pid 1498's current scheduling policy: SCHED_OTHER
    pid 1498's current scheduling priority: 0
    root@am62pxx-evm:/home# mpstat -P ALL 1
    Linux 6.6.32-rt32-ti-rt-g04a9ad081f0f-dirty (am62pxx-evm)       07/16/25        _aarch64_     (4 CPU)
    
    10:31:26     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
    10:31:27     all    4.80    0.00   21.21    0.00    0.00    0.00    0.00    0.00   73.99
    10:31:27       0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    10:31:27       1    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    10:31:27       2   19.23    0.00   80.77    0.00    0.00    0.00    0.00    0.00    0.00
    10:31:27       3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    
    10:31:27     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
    10:31:28     all    4.79    0.00   21.16    0.00    0.00    0.00    0.00    0.00   74.06
    10:31:28       0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    10:31:28       1    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    10:31:28       2   18.45    0.00   81.55    0.00    0.00    0.00    0.00    0.00    0.00
    10:31:28       3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    
    10:31:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
    10:31:29     all    5.28    0.00   21.36    0.00    0.00    0.00    0.00    0.00   73.37
    10:31:29       0    0.00    0.00    1.06    0.00    0.00    0.00    0.00    0.00   98.94
    10:31:29       1    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    10:31:29       2   19.23    0.00   80.77    0.00    0.00    0.00    0.00    0.00    0.00
    10:31:29       3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
    
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.21s
    user    0m 0.03s
    sys     0m 0.17s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.21s
    user    0m 0.03s
    sys     0m 0.17s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.21s
    user    0m 0.03s
    sys     0m 0.17s
    root@am62pxx-evm:/home# time taskset -c 3 chrt -f 99 ./loop_cat_hardirqs_50times.sh
    real    0m 0.21s
    user    0m 0.03s
    sys     0m 0.17s
    root@am62pxx-evm:/home#

    如果 BU 有其他板连接到 TES、请附加测试脚本

    e2e.ti.com/.../loop_5F00_cat_5F00_hardirqs.sh

    e2e.ti.com/.../loop_5F00_cat_5F00_hardirqs_5F00_50times.sh

    提前在 uENV.txt 中设置引导参数:

    optargs='cgroup_no_v1=cpuset isolcpus=1-3 nohz_full=1-3 rcu_nocbs=1-3'

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    由于这是自定义测试、预期的良好结果是什么? 我看到测试定义、该定义在 AM62x 和 AM62P 上运行、这两者都具有详细数据转储。 但是什么是好结果、客户期望什么?

     Pekka

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Tony:

    在测试中、两个脚本执行相同的操作-“cat /proc/interrupts “、它读取相同的内核资源。 当其中一个脚本正在读取时、另一个进程被阻止。 很可能这就是第一个脚本在运行第二个脚本时所需时间较长的原因。

    我将第二个脚本从“cat /proc/更改为“cat /proc/ 互操作性中断 “改为“cat /proc/ meminfo “然后我看到第一个脚本的运行时间不再受第二个脚本的影响。