看ULK3rd讲进程抢占提到thread_info.flags(调度基础、主动调度和被动调度),所以追了一下。
32bit机器上是这样定义的(https://elixir.bootlin.com/linux/v2.6.39.4/source/arch/x86/include/asm/thread_info.h#L26):
struct thread_info {
struct task_struct *task; /* main task structure */
__u32 flags; /* low level flags */
__u32 status; /* thread synchronous flags */
__u32 cpu; /* current CPU */
mm_segment_t addr_limit;
unsigned int sig_on_uaccess_error:1;
unsigned int uaccess_err:1; /* uaccess failed */
};
/* 其中__u32就是一个unsigned int */
typedef unsigned int __u32;
64bit机器上是这样定义的(