New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuttx/sched: use pid to check idle task #7459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@zyfeier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I noticed that spresense:smp
(with CONFIG_DEBUG_ASSERTIONS=y
) has a problem when booting.
AEG
[CPU0] up_assert: Assertion failed CPU0 at file:sched/sched_cpuselect.c line: 97 task: AppBringUp
[CPU0] arm_registerdump: R0: 00000000 R1: 2d02b314 R2: 041ac000 R3: 00000000
[CPU0] arm_registerdump: R4: 2d02b314 R5: 2d02e310 R6: 2d02aa58 FP: 2d02ed80
[CPU0] arm_registerdump: R8: 2d02ed80 SB: 00000001 SL: 00000000 R11: 00000000
[CPU0] arm_registerdump: IP: 00000009 SP: 2d02ed68 LR: 0d009371 PC: 0d0095cc
[CPU0] arm_registerdump: xPSR: 61000200 BASEPRI: 00000080 CONTROL: 00000004
[CPU0] arm_registerdump: EXC_RETURN: ffffffe9
[CPU0] arm_dump_stack: IRQ Stack:
[CPU0] arm_dump_stack: sp: 2d02ed80
[CPU0] arm_dump_stack: base: 2d0299a8
[CPU0] arm_dump_stack: size: 00000800
[CPU0] arm_dump_stack: ERROR: IRQ Stack pointer is not within the stack
[CPU0] arm_dump_stack: User Stack:
[CPU0] arm_dump_stack: sp: 2d02ed80
[CPU0] arm_dump_stack: base: 2d02e710
[CPU0] arm_dump_stack: size: 000007d0
[CPU0] arm_stackdump: 2d02ed80: 000000e0 2d0299a8 00000001 00000000 000000f0 2d02ac14 2d02ab58 0d007455
[CPU0] arm_stackdump: 2d02eda0: 00000000 0d005f7d 00000003 0302acb0 10000000 2d02f290 2d02f290 00000000
[CPU0] arm_stackdump: 2d02edc0: 00000400 0d00136d 00000000 0d00658b 2d02f290 2d02e310 00000000 00000400
[CPU0] arm_stackdump: 2d02ede0: 0d00136d 00000000 00000000 0d00962f 00000001 000000e0 2d02f290 0d005285
[CPU0] arm_stackdump: 2d02ee00: 2d02b2d8 2d02f290 00000003 0d004f1b 00000400 0d00136d 00000000 2d02e620
[CPU0] arm_stackdump: 2d02ee20: 00000000 000000c8 00000000 0d01d848 000000c8 0d004f4d 00000400 0d00136d
[CPU0] arm_stackdump: 2d02ee40: 00000000 2d02e620 00000000 00000101 00000000 00000000 00000000 0d004f61
[CPU0] arm_stackdump: 2d02ee60: 00000000 00000000 00000000 0d001697 00000000 00000000 00000000 0d00a1a5
[CPU0] arm_stackdump: 2d02ee80: 00000000 00000000 00000000 00000000 0d005290 01000000 00000000 00000000
[CPU0] arm_stackdump: 2d02eea0: 00000000 00000000 00000000 00000000 00000101 0d0039a3 00000001 2d02e6f8
[CPU0] arm_stackdump: 2d02eec0: 2d02e6f8 00000000 00000002 0d0052d3 00000000 00000000 00000000 00000000
[CPU0] arm_showtasks: PID PRI CPU STACK COMMAND
[CPU0] arm_showtasks: ---- ---- ---- 2048 irq
[CPU0] arm_dump_task: 0 0 0 1000 CPU0 IDLE
[CPU0] arm_dump_task: 1 0 1 1000 CPU1 IDLE
[CPU0] arm_dump_task: 2 240 0 2000 AppBringUp
[CPU0] arm_dump_task: 3 200 0 976 cxd56_pm_task
|
Pid is more appropriate than the flink pointer to determine idle task, when we want to use other data structure to optimize the task list.
@masayuki2009 fixed this problem, plz check. |
@zyfeier |
Summary
Use pid to determine idle task, this is more robust when we want to use other data structure to optimize the task list.
Impact
NA
Testing
IMX6Q