Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-06 Thread Pavel Machek
Hi! > --- a/Documentation/ABI/testing/sysfs-kernel-livepatch > +++ b/Documentation/ABI/testing/sysfs-kernel-livepatch > @@ -33,6 +33,15 @@ Contact: live-patch...@vger.kernel.org > An attribute which indicates whether the patch is currently in > transition. > > +What

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-03 Thread Josh Poimboeuf
On Fri, Nov 03, 2017 at 09:02:50AM +0100, Miroslav Benes wrote: > On Thu, 2 Nov 2017, Josh Poimboeuf wrote: > > > On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote: > > > + > > > +/* > > > + * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING > > > set. > > > + * Kt

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-03 Thread Miroslav Benes
On Thu, 2 Nov 2017, Josh Poimboeuf wrote: > On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote: > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > index bf8c8fd72589..b7c60662baf3 100644 > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > @@ -440

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-03 Thread Miroslav Benes
On Thu, 2 Nov 2017, Josh Poimboeuf wrote: > On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote: > > + > > +/* > > + * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set. > > + * Kthreads with TIF_PATCH_PENDING set are woken up. Only admin can > > request this > >

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-02 Thread Oleg Nesterov
On 11/02, Miroslav Benes wrote: > > On Wed, 1 Nov 2017, Oleg Nesterov wrote: > > > Note also that wake_up_state(TASK_INTERRUPTIBLE) won't wakeup the TASK_IDLE > > kthreads, and most of the kthreads which use TASK_INTERRUPTIBLE should use > > TASK_IDLE today, because in most cases TASK_INTERRUPTIBLE

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-02 Thread Josh Poimboeuf
On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote: > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > index bf8c8fd72589..b7c60662baf3 100644 > --- a/kernel/livepatch/core.c > +++ b/kernel/livepatch/core.c > @@ -440,6 +440,7 @@ EXPORT_SYMBOL_GPL(klp_enable_patch); > *

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-02 Thread Josh Poimboeuf
On Tue, Oct 31, 2017 at 12:48:52PM +0100, Miroslav Benes wrote: > + > +/* > + * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set. > + * Kthreads with TIF_PATCH_PENDING set are woken up. Only admin can request > this > + * action currently. > + */ > +void klp_force_signals(vo

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-02 Thread Miroslav Benes
On Wed, 1 Nov 2017, Oleg Nesterov wrote: > On 11/01, Petr Mladek wrote: > > > > On Tue 2017-10-31 12:48:52, Miroslav Benes wrote: > > > + if (task->flags & PF_KTHREAD) { > > > + /* > > > + * Wake up a kthread which still has not been migrated. > > > +

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-01 Thread Oleg Nesterov
On 11/01, Petr Mladek wrote: > > On Tue 2017-10-31 12:48:52, Miroslav Benes wrote: > > + if (task->flags & PF_KTHREAD) { > > + /* > > +* Wake up a kthread which still has not been migrated. > > +*/ > > + wake_up_p

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-01 Thread Petr Mladek
On Tue 2017-10-31 12:48:52, Miroslav Benes wrote: > Live patching consistency model is of LEAVE_PATCHED_SET and > SWITCH_THREAD. This means that all tasks in the system have to be marked > one by one as safe to call a new patched function. Safe means when a > task is not (sleeping) in a set of patc

Re: [PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-11-01 Thread Miroslav Benes
> +/* > + * Sends a fake signal to all non-kthread tasks with TIF_PATCH_PENDING set. > + * Kthreads with TIF_PATCH_PENDING set are woken up. Only admin can request > this > + * action currently. > + */ > +void klp_force_signals(void) > +{ > + struct task_struct *g, *task; > + > + pr_notic

[PATCH v3 1/2] livepatch: send a fake signal to all blocking tasks

2017-10-31 Thread Miroslav Benes
Live patching consistency model is of LEAVE_PATCHED_SET and SWITCH_THREAD. This means that all tasks in the system have to be marked one by one as safe to call a new patched function. Safe means when a task is not (sleeping) in a set of patched functions. That is, no patched function is on the task