sleeping in atomic: add some new checks to warn about sleeping in atomic
commit5aba0cb885b7327f465bdbdb6c4c69ea90370388
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 1 Sep 2021 11:40:38 +0000 (1 14:40 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 1 Sep 2021 11:47:15 +0000 (1 14:47 +0300)
tree993073ac7da02d62de191c91c652c4ae5d7db799
parent12bbef5ad4df956824608eb1d05fe388861e3ddf
sleeping in atomic: add some new checks to warn about sleeping in atomic

This check has quite a few parts the track different information and then
the check to print the warnings is just one file.

1) check_preempt_info.c:  This tracks if a function increments or
        decrements the preempt count.  It only stores return states
        not caller info.  It only tracks "simple" functions.  If a function
        increments the preempt count and then decrements it again that is
        marked is &ignore.
2) check_preempt.c:  This uses check_preempt_info.c and inserts caller_info
        data when a function is called with preempt disabled.
3) check_sleep_info.c:  This tracks which functions *always* sleep.  If
        they only sleep on some occasions that doesn't generate useful
        warnings.
4) check_scheduling_in_atomic.c:  This prints the warning if we sleep
        in atomic context.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_list.h
check_preempt.c [new file with mode: 0644]
check_preempt_info.c [new file with mode: 0644]
check_scheduling_in_atomic.c [new file with mode: 0644]
check_sleep_info.c [new file with mode: 0644]
smatch.h