linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled
@ 2019-04-04 18:44 Miroslav Benes
  2019-04-04 20:18 ` Josh Poimboeuf
  0 siblings, 1 reply; 4+ messages in thread
From: Miroslav Benes @ 2019-04-04 18:44 UTC (permalink / raw)
  To: yamada.masahiro, michal.lkml, jpoimboe, pmladek, jikos
  Cc: joe.lawrence, ggherdovich, linux-kbuild, live-patching,
	linux-kernel, Miroslav Benes

GCC 9 introduces a new option, -flive-patching. It disables certain
optimizations which could make a compilation unsafe for later live
patching of the running kernel.

The option is used only if CONFIG_LIVEPATCH is enabled and $(CC)
supports it.

Performance impact of the option was measured on three different
Intel machines - two bigger NUMA boxes and one smaller UMA box. Kernel
intensive (IO, scheduling, networking) benchmarks were selected, plus a
set of HPC workloads from NAS Parallel Benchmark. The tests were done on
upstream kernel 5.0-rc8 with openSUSE Leap 15.0 userspace.

The majority of the tests is unaffected. The only significant exception
is the scheduler section which suffers 1-3% degradation.

Evaluated-by: Giovanni Gherdovich <ggherdovich@suse.cz>
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
The patch is based on master branch of the livepatching tree on
git.kernel.org.

Many thanks to Giovanni who ran the whole testing campaign and analyzed
the results. I archived the dashboard and detailed data. If anyone is
interested, we could probably set up a public website somewhere.

 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index f070e0d65186..464a693a22e9 100644
--- a/Makefile
+++ b/Makefile
@@ -789,6 +789,10 @@ KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
 LDFLAGS_vmlinux += --gc-sections
 endif
 
+ifdef CONFIG_LIVEPATCH
+KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone)
+endif
+
 # arch Makefile may override CC so keep this after arch Makefile is included
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 
-- 
2.21.0


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

* Re: [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled
  2019-04-04 18:44 [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled Miroslav Benes
@ 2019-04-04 20:18 ` Josh Poimboeuf
  2019-04-05  8:33   ` Miroslav Benes
  2019-04-09  7:36   ` Petr Mladek
  0 siblings, 2 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2019-04-04 20:18 UTC (permalink / raw)
  To: Miroslav Benes
  Cc: yamada.masahiro, michal.lkml, pmladek, jikos, joe.lawrence,
	ggherdovich, linux-kbuild, live-patching, linux-kernel

On Thu, Apr 04, 2019 at 08:44:11PM +0200, Miroslav Benes wrote:
> GCC 9 introduces a new option, -flive-patching. It disables certain
> optimizations which could make a compilation unsafe for later live
> patching of the running kernel.
> 
> The option is used only if CONFIG_LIVEPATCH is enabled and $(CC)
> supports it.
> 
> Performance impact of the option was measured on three different
> Intel machines - two bigger NUMA boxes and one smaller UMA box. Kernel
> intensive (IO, scheduling, networking) benchmarks were selected, plus a
> set of HPC workloads from NAS Parallel Benchmark. The tests were done on
> upstream kernel 5.0-rc8 with openSUSE Leap 15.0 userspace.
> 
> The majority of the tests is unaffected. The only significant exception
> is the scheduler section which suffers 1-3% degradation.
> 
> Evaluated-by: Giovanni Gherdovich <ggherdovich@suse.cz>
> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
> ---
> The patch is based on master branch of the livepatching tree on
> git.kernel.org.
> 
> Many thanks to Giovanni who ran the whole testing campaign and analyzed
> the results. I archived the dashboard and detailed data. If anyone is
> interested, we could probably set up a public website somewhere.

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

While we're on the subject, I'm glad to see ongoing activity on
klp-convert (though I haven't had a chance to follow the discussions).
What's the status of the rest of the needed bits?

- kgraft-analysis-tool - will this also be submitted for inclusion in
  the kernel tree?

- Documentation about how to create a patch

- The other bits I think Nicolai has been working on to eliminate all
  the manual steps

-- 
Josh

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

* Re: [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled
  2019-04-04 20:18 ` Josh Poimboeuf
@ 2019-04-05  8:33   ` Miroslav Benes
  2019-04-09  7:36   ` Petr Mladek
  1 sibling, 0 replies; 4+ messages in thread
From: Miroslav Benes @ 2019-04-05  8:33 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: yamada.masahiro, michal.lkml, pmladek, jikos, joe.lawrence,
	ggherdovich, linux-kbuild, live-patching, linux-kernel


> While we're on the subject, I'm glad to see ongoing activity on
> klp-convert (though I haven't had a chance to follow the discussions).
> What's the status of the rest of the needed bits?
> 
> - kgraft-analysis-tool - will this also be submitted for inclusion in
>   the kernel tree?

Yes, it is the next step.
 
> - Documentation about how to create a patch

I know we talked about it, but I don't remember what we came up with. We 
should probably tie to Nicolai's work. It will change the process a lot.

> - The other bits I think Nicolai has been working on to eliminate all
>   the manual steps

Miroslav

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

* Re: [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled
  2019-04-04 20:18 ` Josh Poimboeuf
  2019-04-05  8:33   ` Miroslav Benes
@ 2019-04-09  7:36   ` Petr Mladek
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Mladek @ 2019-04-09  7:36 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Miroslav Benes, yamada.masahiro, michal.lkml, jikos,
	joe.lawrence, ggherdovich, linux-kbuild, live-patching,
	linux-kernel

On Thu 2019-04-04 15:18:55, Josh Poimboeuf wrote:
> On Thu, Apr 04, 2019 at 08:44:11PM +0200, Miroslav Benes wrote:
> > GCC 9 introduces a new option, -flive-patching. It disables certain
> > optimizations which could make a compilation unsafe for later live
> > patching of the running kernel.
> > 
> > The option is used only if CONFIG_LIVEPATCH is enabled and $(CC)
> > supports it.
> > 
> > Performance impact of the option was measured on three different
> > Intel machines - two bigger NUMA boxes and one smaller UMA box. Kernel
> > intensive (IO, scheduling, networking) benchmarks were selected, plus a
> > set of HPC workloads from NAS Parallel Benchmark. The tests were done on
> > upstream kernel 5.0-rc8 with openSUSE Leap 15.0 userspace.
> > 
> > The majority of the tests is unaffected. The only significant exception
> > is the scheduler section which suffers 1-3% degradation.
> > 
> > Evaluated-by: Giovanni Gherdovich <ggherdovich@suse.cz>
> > Signed-off-by: Miroslav Benes <mbenes@suse.cz>
> > ---
> > The patch is based on master branch of the livepatching tree on
> > git.kernel.org.
> > 
> > Many thanks to Giovanni who ran the whole testing campaign and analyzed
> > the results. I archived the dashboard and detailed data. If anyone is
> > interested, we could probably set up a public website somewhere.
> 
> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

I have committed the patch into the branch for-5.2/core.

Best Regards,
Petr

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

end of thread, other threads:[~2019-04-09  7:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 18:44 [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled Miroslav Benes
2019-04-04 20:18 ` Josh Poimboeuf
2019-04-05  8:33   ` Miroslav Benes
2019-04-09  7:36   ` Petr Mladek

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).