History

task_work: Decouple TIF_NOTIFY_SIGNAL and task_work

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.

Eric W. Biederman committed 4 years ago

Commit 7c5d8fa1 parent 8ba62d34 files · +13 −17Browse files

Showing the changes to include (1 of 4 files). Show all

Unified · Split

include/linux/tracehook.h+2−13
@@ -113,19 +113,8 @@ static inline void clear_notify_signal(void) · 112 unmodified lines
113113 }
114114
115115 /*
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().
129118 */
130119 static inline void set_notify_signal(struct task_struct *task)
131120 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t