Pull in task_work changes from the 5.8 series, as we'll need to apply the same kind of changes to other parts in the 5.9 branch. * io_uring-5.8: io_uring: fix regression with always ignoring signals in io_cqring_wait() io_uring: use signal based task_work running task_work: teach task_work_add() to do signal_wake_up()
Showing the changes to include/linux (2 of 5 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ struct task_struct; · 18 unmodified lines | ||
| 19 | 19 | #define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */ |
| 20 | 20 | #define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */ |
| 21 | 21 | #define JOBCTL_TRAP_FREEZE_BIT 23 /* trap for cgroup freezer */ |
| 22 | +#define JOBCTL_TASK_WORK_BIT 24 /* set by TWA_SIGNAL */ | |
| 22 | 23 | |
| 23 | 24 | #define JOBCTL_STOP_DEQUEUED (1UL << JOBCTL_STOP_DEQUEUED_BIT) |
| 24 | 25 | #define JOBCTL_STOP_PENDING (1UL << JOBCTL_STOP_PENDING_BIT) |
| @@ -28,9 +29,10 @@ struct task_struct; · 3 unmodified lines | ||
| 28 | 29 | #define JOBCTL_TRAPPING (1UL << JOBCTL_TRAPPING_BIT) |
| 29 | 30 | #define JOBCTL_LISTENING (1UL << JOBCTL_LISTENING_BIT) |
| 30 | 31 | #define JOBCTL_TRAP_FREEZE (1UL << JOBCTL_TRAP_FREEZE_BIT) |
| 32 | +#define JOBCTL_TASK_WORK (1UL << JOBCTL_TASK_WORK_BIT) | |
| 31 | 33 | |
| 32 | 34 | #define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY) |
| 33 | −#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK) | |
| 35 | +#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK | JOBCTL_TASK_WORK) | |
| 34 | 36 | |
| 35 | 37 | extern bool task_set_jobctl_pending(struct task_struct *task, unsigned long mask); |
| 36 | 38 | extern void task_clear_jobctl_trapping(struct task_struct *task); |
| @@ -13,7 +13,10 @@ init_task_work(struct callback_head *twork, task_work_func_t func) · 12 unmodified lines | ||
| 13 | 13 | twork->func = func; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | −int task_work_add(struct task_struct *task, struct callback_head *twork, bool); | |
| 16 | +#define TWA_RESUME 1 | |
| 17 | +#define TWA_SIGNAL 2 | |
| 18 | +int task_work_add(struct task_struct *task, struct callback_head *twork, int); | |
| 19 | + | |
| 17 | 20 | struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t); |
| 18 | 21 | void task_work_run(void); |
| 19 | 22 | |