linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-kernel@vger.kernel.org, jirislaby@gmail.com,
	Vojtech Pavlik <vojtech@suse.cz>, Michael Matz <matz@suse.de>,
	Jiri Kosina <jkosina@suse.cz>, Udo Seidel <udoseidel@gmx.de>
Subject: kgr: dealing with optimalizations? (was Re: [RFC 06/16] kgr: add Documentat)ion
Date: Fri, 9 May 2014 11:31:54 +0200	[thread overview]
Message-ID: <20140509093154.GA4877@xo-6d-61-c0.localdomain> (raw)
In-Reply-To: <20140506110312.GA15033@xo-6d-61-c0.localdomain>

Hi!

Ok, one big question: you are replacing single functions, and assume that's ok, right?

But ... is it ok? gcc is allowed to do optimalization on whole source file (and whole source
tree with LTO).  How do you prevent situation where changing function foo() breaks optimalization
in function bar()?

Is turning off inter-procedural and inter-module optimalizations needed for kgraft to work?

Best regards,
											Pavel

On Tue 2014-05-06 13:03:12, Pavel Machek wrote:
> Hi!
> 
> > This is a text provided by Udo and polished.
> > 
> > Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> > Cc: Udo Seidel <udoseidel@gmx.de>
> > ---
> >  Documentation/kgr.txt | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> >  create mode 100644 Documentation/kgr.txt
> > 
> > diff --git a/Documentation/kgr.txt b/Documentation/kgr.txt
> > new file mode 100644
> > index 000000000000..5b62415641cf
> > --- /dev/null
> > +++ b/Documentation/kgr.txt
> > @@ -0,0 +1,26 @@
> > +Live Kernel Patching with kGraft
> > +--------------------------------
> > +
> > +Written by Udo Seidel <udoseidel at gmx dot de>
> > +Based on the Blog entry by Vojtech Pavlik
> > +
> > +April 2014
> > +
> > +kGraft's developement was started by the SUSE Labs. kGraft builds on
> > +technologies and ideas that are already present in the kernel: ftrace
> > +and its mcount-based reserved space in function headers, the
> > +INT3/IPI-NMI patching also used in jumplabels, and RCU-like update of
> > +code that does not require stopping the kernel. For more information
> > +about ftrace please checkout the Documentation shipped with the kernel
> > +or search for howtos and explanations on the Internet.
> 
> This should really provide filename in Documentation/ directory it is refering to.
> 
> > +A kGraft patch is a kernel module and fully relies on the in-kernel
> > +module loader to link the new code with the kernel.  Thanks to all
> > +that, the design can be nicely minimalistic.
> 
> I feel some more details would be nice here.
> 
> > +While kGraft is, by choice, limited to replacing whole functions and
> > +constants they reference, this does not limit the set of code patches
> > +that can be applied significantly.  kGraft offers tools to assist in
> > +creating the live patch modules, identifying which functions need to
> > +be replaced based on a patch, and creating the patch module source
> > +code. They are located in /tools/kgraft/.
> 
> For what functions it does not work? Anything used in interrupt context?
> What about assembly? What happens if that function uses &label to
> do some magic?
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> --
> 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/

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-05-09  9:32 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 14:30 [RFC 00/16] kGraft Jiri Slaby
2014-04-30 14:30 ` [RFC 01/16] ftrace: Add function to find fentry of function Jiri Slaby
2014-04-30 14:48   ` Steven Rostedt
2014-04-30 14:58     ` Jiri Slaby
2014-04-30 14:30 ` [RFC 02/16] ftrace: Make ftrace_is_dead available globally Jiri Slaby
2014-04-30 14:30 ` [RFC 03/16] kgr: initial code Jiri Slaby
2014-04-30 14:56   ` Steven Rostedt
2014-04-30 14:57     ` Jiri Slaby
2014-05-01 20:20   ` Andi Kleen
2014-05-01 20:37     ` Jiri Kosina
2014-05-14  9:28   ` Aravinda Prasad
2014-05-14 10:12     ` Jiri Slaby
2014-05-14 10:41       ` Aravinda Prasad
2014-05-14 10:44         ` Jiri Slaby
2014-05-14 11:19           ` Aravinda Prasad
2014-05-20 11:36     ` Jiri Slaby
2014-05-21 18:28       ` Aravinda Prasad
2014-05-26  8:50       ` Jiri Kosina
2014-04-30 14:30 ` [RFC 04/16] kgr: add testing kgraft patch Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-05-12 12:50     ` Jiri Slaby
2014-04-30 14:30 ` [RFC 05/16] kgr: update Kconfig documentation Jiri Slaby
2014-05-03 14:32   ` Randy Dunlap
2014-04-30 14:30 ` [RFC 06/16] kgr: add Documentation Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-05-09  9:31     ` Pavel Machek [this message]
2014-05-09 12:22       ` kgr: dealing with optimalizations? (was Re: [RFC 06/16] kgr: add Documentat)ion Michael Matz
2014-04-30 14:30 ` [RFC 07/16] kgr: trigger the first check earlier Jiri Slaby
2014-04-30 14:30 ` [RFC 08/16] kgr: sched.h, introduce kgr_task_safe helper Jiri Slaby
2014-04-30 14:30 ` [RFC 09/16] kgr: mark task_safe in some kthreads Jiri Slaby
2014-04-30 15:49   ` Greg Kroah-Hartman
2014-04-30 16:55   ` Paul E. McKenney
2014-04-30 18:33     ` Vojtech Pavlik
2014-04-30 19:07       ` Paul E. McKenney
2014-05-01 14:24   ` Tejun Heo
2014-05-01 20:17     ` Jiri Kosina
2014-05-01 21:02       ` Tejun Heo
2014-05-01 21:09         ` Tejun Heo
2014-05-14 14:59           ` Jiri Slaby
2014-05-14 15:15             ` Vojtech Pavlik
2014-05-14 15:30               ` Paul E. McKenney
2014-05-14 16:32               ` Tejun Heo
2014-05-15  3:53                 ` Mike Galbraith
2014-05-15  4:06                   ` Tejun Heo
2014-05-15  4:46                     ` Mike Galbraith
2014-05-15  4:50                       ` Tejun Heo
2014-05-15  5:04                         ` Mike Galbraith
2014-05-15  5:09                           ` Tejun Heo
2014-05-15  5:32                             ` Mike Galbraith
2014-05-15  6:05                               ` Tejun Heo
2014-05-15  6:32                                 ` Mike Galbraith
2014-04-30 14:30 ` [RFC 10/16] kgr: kthreads support Jiri Slaby
2014-04-30 14:30 ` [RFC 11/16] kgr: handle irqs Jiri Slaby
2014-04-30 14:30 ` [RFC 12/16] kgr: add tools Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-04-30 14:30 ` [RFC 13/16] kgr: add MAINTAINERS entry Jiri Slaby
2014-04-30 14:30 ` [RFC 14/16] kgr: x86: refuse to build without fentry support Jiri Slaby
2014-04-30 14:30 ` [RFC 15/16] kgr: add procfs interface for per-process 'kgr_in_progress' Jiri Slaby
2014-04-30 14:30 ` [RFC 16/16] kgr: make a per-process 'in progress' flag a single bit Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140509093154.GA4877@xo-6d-61-c0.localdomain \
    --to=pavel@ucw.cz \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matz@suse.de \
    --cc=udoseidel@gmx.de \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).