Samsung / TizenRT

TizenRT is a lightweight RTOS-based platform to support low-end IoT devices
Apache License 2.0
561 stars 560 forks source link

os/fs/procfs, os/kernel/init: Fix issue in running the ps command with smp configs enabled #6258

Closed neel-samsung closed 1 week ago

neel-samsung commented 2 weeks ago

ps command was not working properly with smp configs enabled. Idle task stack are not stored in heap region, instead they are stored in .bss region. For retrieving idle task stack, we should not search in heap region And this case was not handled properly for all cpu's idle task. So, we handle the case for every cpu's idle task.

edwakuwaku commented 2 weeks ago

Hi @neel-samsung. For reference, could you please share the information printed for SMP when input "ps" to tash,

neel-samsung commented 2 weeks ago

Hi @neel-samsung. For reference, could you please share the information printed for SMP when input "ps" to tash,

I have added the ps command output to commit description. Please check.

edwakuwaku commented 1 week ago

Hi @neel-samsung. For reference, could you please share the information printed for SMP when input "ps" to tash,

I have added the ps command output to commit description. Please check.

Sorry I have one question. As I checked your commit, the CPU0 Idle shows running, but CPU1 Idle shows inactive. I assume when you capture "ps" command, both cores should be in their own idle thread. Also, I think in SMP case, there should always be 2 tasks showing RUNNING state, because we have 2 cores running concurrently. Could you please enlighten me on the above question?

neel-samsung commented 1 week ago

Hi @neel-samsung. For reference, could you please share the information printed for SMP when input "ps" to tash,

I have added the ps command output to commit description. Please check.

Sorry I have one question. As I checked your commit, the CPU0 Idle shows running, but CPU1 Idle shows inactive. I assume when you capture "ps" command, both cores should be in their own idle thread. Also, I think in SMP case, there should always be 2 tasks showing RUNNING state, because we have 2 cores running concurrently. Could you please enlighten me on the above question?

Thank you for addressing this. So, there was task state which was missed due to which some of task state were not printed correctly. We also need to take care of Assign (Ready) state in case of SMP.

I have updated the code and ps command output. Now, in this case, tash and CPU1 idle are RUNNING.