linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Petr Mladek <pmladek@suse.com>
Cc: Jiri Kosina <jikos@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jason Baron <jbaron@akamai.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Evgenii Shatokhin <eshatokhin@virtuozzo.com>,
	live-patching@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v15 08/11] livepatch: Remove Nop structures when unused
Date: Thu, 10 Jan 2019 14:42:17 +0100 (CET)	[thread overview]
Message-ID: <alpine.LSU.2.21.1901101441580.15065@pobox.suse.cz> (raw)
In-Reply-To: <20190109124329.21991-9-pmladek@suse.com>

On Wed, 9 Jan 2019, Petr Mladek wrote:

> Replaced patches are removed from the stack when the transition is
> finished. It means that Nop structures will never be needed again
> and can be removed. Why should we care?
> 
>   + Nop structures give the impression that the function is patched
>     even though the ftrace handler has no effect.
> 
>   + Ftrace handlers do not come for free. They cause slowdown that might
>     be visible in some workloads. The ftrace-related slowdown might
>     actually be the reason why the function is no longer patched in
>     the new cumulative patch. One would expect that cumulative patch
>     would help solve these problems as well.
> 
>   + Cumulative patches are supposed to replace any earlier version of
>     the patch. The amount of NOPs depends on which version was replaced.
>     This multiplies the amount of scenarios that might happen.
> 
>     One might say that NOPs are innocent. But there are even optimized
>     NOP instructions for different processors, for example, see
>     arch/x86/kernel/alternative.c. And klp_ftrace_handler() is much
>     more complicated.
> 
>   + It sounds natural to clean up a mess that is no longer needed.
>     It could only be worse if we do not do it.
> 
> This patch allows to unpatch and free the dynamic structures independently
> when the transition finishes.
> 
> The free part is a bit tricky because kobject free callbacks are called
> asynchronously. We could not wait for them easily. Fortunately, we do
> not have to. Any further access can be avoided by removing them from
> the dynamic lists.
> 
> Signed-off-by: Petr Mladek <pmladek@suse.com>

Acked-by: Miroslav Benes <mbenes@suse.cz>

Miroslav

  reply	other threads:[~2019-01-10 13:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 12:43 [PATCH v15 00/11] livepatch: Atomic replace feature Petr Mladek
2019-01-09 12:43 ` [PATCH v15 01/11] livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func Petr Mladek
2019-01-09 12:43 ` [PATCH v15 02/11] livepatch: Shuffle klp_enable_patch()/klp_disable_patch() code Petr Mladek
2019-01-09 12:43 ` [PATCH v15 03/11] livepatch: Consolidate klp_free functions Petr Mladek
2019-01-09 14:35   ` Miroslav Benes
2019-01-09 12:43 ` [PATCH v15 04/11] livepatch: Don't block the removal of patches loaded after a forced transition Petr Mladek
2019-01-09 14:50   ` Miroslav Benes
2019-01-09 12:43 ` [PATCH v15 05/11] livepatch: Simplify API by removing registration step Petr Mladek
2019-01-10 12:32   ` Miroslav Benes
2019-01-09 12:43 ` [PATCH v15 06/11] livepatch: Use lists to manage patches, objects and functions Petr Mladek
2019-01-09 12:43 ` [PATCH v15 07/11] livepatch: Add atomic replace Petr Mladek
2019-01-10 13:05   ` Miroslav Benes
2019-01-09 12:43 ` [PATCH v15 08/11] livepatch: Remove Nop structures when unused Petr Mladek
2019-01-10 13:42   ` Miroslav Benes [this message]
2019-01-09 12:43 ` [PATCH v15 09/11] livepatch: Atomic replace and cumulative patches documentation Petr Mladek
2019-01-09 12:43 ` [PATCH v15 10/11] livepatch: Remove ordering (stacking) of the livepatches Petr Mladek
2019-01-10 13:56   ` Miroslav Benes
2019-01-09 12:43 ` [PATCH v15 11/11] selftests/livepatch: introduce tests Petr Mladek
2019-01-11 17:44 ` [PATCH v15 00/11] livepatch: Atomic replace feature Josh Poimboeuf
2019-01-11 19:56 ` Jiri Kosina

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=alpine.LSU.2.21.1901101441580.15065@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=eshatokhin@virtuozzo.com \
    --cc=jbaron@akamai.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=pmladek@suse.com \
    /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).