Skip to content

Commit 8df1947

Browse files
mirabJiri Kosina
authored andcommitted
livepatch: Replace the fake signal sending with TIF_NOTIFY_SIGNAL infrastructure
Livepatch sends a fake signal to all remaining blocking tasks of a running transition after a set period of time. It uses TIF_SIGPENDING flag for the purpose. Commit 12db8b6 ("entry: Add support for TIF_NOTIFY_SIGNAL") added a generic infrastructure to achieve the same. Replace our bespoke solution with the generic one. Reviewed-by: Jens Axboe <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Acked-by: Joe Lawrence <[email protected]> Signed-off-by: Miroslav Benes <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 54ab35d commit 8df1947

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

kernel/livepatch/transition.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/cpu.h>
1111
#include <linux/stacktrace.h>
12+
#include <linux/tracehook.h>
1213
#include "core.h"
1314
#include "patch.h"
1415
#include "transition.h"
@@ -369,9 +370,7 @@ static void klp_send_signals(void)
369370
* Send fake signal to all non-kthread tasks which are
370371
* still not migrated.
371372
*/
372-
spin_lock_irq(&task->sighand->siglock);
373-
signal_wake_up(task, 0);
374-
spin_unlock_irq(&task->sighand->siglock);
373+
set_notify_signal(task);
375374
}
376375
}
377376
read_unlock(&tasklist_lock);

kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include <linux/cn_proc.h>
4444
#include <linux/compiler.h>
4545
#include <linux/posix-timers.h>
46-
#include <linux/livepatch.h>
4746
#include <linux/cgroup.h>
4847
#include <linux/audit.h>
4948

@@ -181,8 +180,7 @@ void recalc_sigpending_and_wake(struct task_struct *t)
181180

182181
void recalc_sigpending(void)
183182
{
184-
if (!recalc_sigpending_tsk(current) && !freezing(current) &&
185-
!klp_patch_pending(current))
183+
if (!recalc_sigpending_tsk(current) && !freezing(current))
186184
clear_thread_flag(TIF_SIGPENDING);
187185

188186
}

0 commit comments

Comments
 (0)