|
|
Log in / Subscribe / Register

Re: [RFC PATCH 0/2] kpatch: dynamic kernel patching

From:  Josh Poimboeuf <jpoimboe-AT-redhat.com>
To:  Ingo Molnar <mingo-AT-kernel.org>
Subject:  Re: [RFC PATCH 0/2] kpatch: dynamic kernel patching
Date:  Mon, 5 May 2014 08:26:38 -0500
Message-ID:  <20140505132638.GA14432@treble.redhat.com>
Cc:  Seth Jennings <sjenning-AT-redhat.com>, Masami Hiramatsu <masami.hiramatsu.pt-AT-hitachi.com>, Steven Rostedt <rostedt-AT-goodmis.org>, Frederic Weisbecker <fweisbec-AT-gmail.com>, Ingo Molnar <mingo-AT-redhat.com>, Jiri Slaby <jslaby-AT-suse.cz>, linux-kernel-AT-vger.kernel.org, Peter Zijlstra <a.p.zijlstra-AT-chello.nl>, Andrew Morton <akpm-AT-linux-foundation.org>, Linus Torvalds <torvalds-AT-linux-foundation.org>, Thomas Gleixner <tglx-AT-linutronix.de>
Archive‑link:  Article

On Mon, May 05, 2014 at 10:55:37AM +0200, Ingo Molnar wrote:
> 
> * Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> 
> > [...]
> > 
> > kpatch checks the backtraces of all tasks in stop_machine() to 
> > ensure that no instances of the old function are running when the 
> > new function is applied.  I think the biggest downside of this 
> > approach is that stop_machine() has to idle all other CPUs during 
> > the patching process, so it inserts a small amount of latency (a few 
> > ms on an idle system).
> 
> When live patching the kernel, how about achieving an even 'cleaner' 
> state for all tasks in the system: to freeze all tasks, as the suspend 
> and hibernation code (and kexec) does, via freeze_processes()?
> 
> That means no tasks in the system have any real kernel execution 
> state, and there's also no problem with long-sleeping tasks, as 
> freeze_processes() is supposed to be fast as well.
> 
> I.e. go for the most conservative live patching state first, and relax 
> it only once the initial model is upstream and is working robustly.

I had considered doing this before, but the problem I found is that many
kernel threads are unfreezable.  So we wouldn't be able to check whether
its safe to replace any functions in use by those kernel threads.

-- 
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



to post comments


Copyright © 2014, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds