There are a small handful of reasons besides pending signals that the kernel might want to break out of interruptible sleeps. The flag TIF_NOTIFY_SIGNAL and the helpers that set and clear TIF_NOTIFY_SIGNAL provide that the infrastructure for breaking out of interruptible sleeps and entering the return to user space slow path for those cases. Expand tracehook_notify_signal inline in it's callers and remove it, which makes clear that TIF_NOTIFY_SIGNAL and task_work are separate concepts. Update the comment on set_notify_signal to more accurately describe it's purpose.
Showing the changes to include (1 of 4 files). Show all
Unified · Split
| @@ -113,19 +113,8 @@ static inline void clear_notify_signal(void) · 112 unmodified lines | ||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | − * called by exit_to_user_mode_loop() if ti_work & _TIF_NOTIFY_SIGNAL. This | |
| 117 | − * is currently used by TWA_SIGNAL based task_work, which requires breaking | |
| 118 | − * wait loops to ensure that task_work is noticed and run. | |
| 119 | − */ | |
| 120 | −static inline void tracehook_notify_signal(void) | |
| 121 | −{ | |
| 122 | − clear_notify_signal(); | |
| 123 | − if (task_work_pending(current)) | |
| 124 | − task_work_run(); | |
| 125 | −} | |
| 126 | − | |
| 127 | −/* | |
| 128 | − * Called when we have work to process from exit_to_user_mode_loop() | |
| 116 | + * Called to break out of interruptible wait loops, and enter the | |
| 117 | + * exit_to_user_mode_loop(). | |
| 129 | 118 | */ |
| 130 | 119 | static inline void set_notify_signal(struct task_struct *task) |
| 131 | 120 | { |