PikoRT / pikoRT

A tiny Linux-like real-time kernel optimized for ARM Cortex-M chips
Other
304 stars 61 forks source link

Fix tasklet_schedule should run with thread_softirqd #24

Closed mlouielu closed 7 years ago

mlouielu commented 7 years ago

This close #12. For discussion, please look comment in #12 .

iankuan commented 7 years ago

@mlouielu , it might not fix this issue. tasklet_schedule would be only called by someone who wants to enqueue softirq task and trigger softirq handler which is trigger via rasie_softirq. It might be quite similar with Linux.

In our softirq design, it only handles softirqs in thread_softirqd. After this change, it might be failed timer task because it can't trigger softirq_handler. In short, thread_softirqd is a softirq handler, and it doesn't need to call tasklet_schedule.

mlouielu commented 7 years ago

The problem here isn't thread_softirqd, is thread_main, which will call tasklet_scheudle (but this is illegal). I think the root cause came from bitmap scheduler (due to the lake of rr scheudler, I can't test on it), but this patch can get an easy fixed so that we won't get other error when playing around minishell.

jserv commented 7 years ago

@mlouielu, I just wonder if the proposed fix got verified for both RR and bitmap scheduler policy yet. I defer to the analysis of @yenWu since he is hacking sched internals.

mlouielu commented 7 years ago

29 propose a correct fixed.