linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] livepatch: Introduce force sysfs attribute
@ 2017-05-18 12:00 Miroslav Benes
  2017-05-18 12:00 ` [PATCH 1/3] livepatch: Add " Miroslav Benes
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Miroslav Benes @ 2017-05-18 12:00 UTC (permalink / raw)
  To: jpoimboe, jeyu, jikos
  Cc: pmladek, live-patching, linux-kernel, Miroslav Benes, Oleg Nesterov

Currently, livepatch gradually migrate the system from an unpatched to a
patched state (or vice versa). Each task drops its TIF_PATCH_PENDING
itself when crossing the kernel/user space boundary or it is cleared
using the stack checking approach. If there is a task which sleeps on a
patched function, the whole transition can get stuck indefinitely.

Livepatch has means which can be used in these cases. The transition can
be cancelled and/or immediate flag may be used for the live patch. On
the other hand it might be useful to poke the system a little bit and
help the transition to finish by doing so.

That is what the fake signal can be used for. A task sleeping/waiting in
the kernel gets TIF_SIGPENDING set, it handles it and during that its
TIF_PATCH_PENDING is cleared. Kthreads are only woken up, they do not
handle signals suitably.

Still, there are cases which neither fake signal can solve. A task can
sleep uninterruptibly without reacting to signals at all. Even then, it
may be safe to clear the task's TIF_PATCH_PENDING. As a last resort,
admin may force such clearing for all tasks in the system with this
patch set.

We use the fake signal in SLES for a long time. Moreover, we don't have
a stack checking there, so we rely on the fake signal a lot. We send it
automatically and periodically.

The first patch is only preparatory. It introduces the sysfs attribute
through which both actions are performed. The second patch adds the fake
signal and the third one forced clearing of the flag.

Miroslav Benes (3):
  livepatch: Add force sysfs attribute
  livepatch: send a fake signal to all blocking tasks
  livepatch: force transition process to finish

 Documentation/ABI/testing/sysfs-kernel-livepatch |  9 ++++
 include/linux/livepatch.h                        |  4 ++
 kernel/livepatch/core.c                          | 51 +++++++++++++++++++++
 kernel/livepatch/transition.c                    | 56 ++++++++++++++++++++++++
 kernel/livepatch/transition.h                    |  2 +
 kernel/signal.c                                  |  4 +-
 6 files changed, 125 insertions(+), 1 deletion(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-05-30 12:41 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18 12:00 [PATCH 0/3] livepatch: Introduce force sysfs attribute Miroslav Benes
2017-05-18 12:00 ` [PATCH 1/3] livepatch: Add " Miroslav Benes
2017-05-18 13:05   ` Libor Pechacek
2017-05-18 13:20     ` Miroslav Benes
2017-05-18 12:00 ` [PATCH 2/3] livepatch: send a fake signal to all blocking tasks Miroslav Benes
2017-05-18 13:10   ` Libor Pechacek
2017-05-18 13:20     ` Miroslav Benes
2017-05-18 16:49   ` Oleg Nesterov
2017-05-18 18:14     ` Miroslav Benes
2017-05-18 19:52       ` Oleg Nesterov
2017-05-19  7:51         ` Miroslav Benes
2017-05-23 17:30   ` Josh Poimboeuf
2017-05-24  8:31     ` Miroslav Benes
2017-05-18 12:00 ` [PATCH 3/3] livepatch: force transition process to finish Miroslav Benes
2017-05-18 13:16   ` Libor Pechacek
2017-05-18 13:22     ` Miroslav Benes
2017-05-23 17:27   ` Josh Poimboeuf
2017-05-24  8:36     ` Miroslav Benes
2017-05-24 13:06   ` Petr Mladek
2017-05-24 14:15     ` Miroslav Benes
2017-05-24 15:09       ` Petr Mladek
2017-05-25 12:59         ` Miroslav Benes
2017-05-25 16:03           ` Petr Mladek
2017-05-26 17:37             ` Josh Poimboeuf
2017-05-29 12:28               ` Petr Mladek
2017-05-30 12:41                 ` Josh Poimboeuf
2017-05-26 17:38   ` Josh Poimboeuf
2017-05-29  9:26     ` Miroslav Benes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).