On 2021/8/9 11:01, Waiman Long wrote:
I think it is simpler to just put a "might_sleep()" in __down_common() which is the function where sleep can actually happen.
If the actual atomic context hibernation occurs, the corresponding alarm log is generated in __schedule_bug().
__schedule()
--> schedule_debug()
--> __schedule_bug()
However, "might_sleep()" indicates the possibility of sleep, so that code writers can identify and fix the problem as soon as possible, but does not trigger atomic context sleep.
Is it better to put "might_sleep()" in each down API entry than __down_common() to help identify potential code problems?