linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jessica Yu <jeyu@kernel.org>, Jiri Kosina <jikos@kernel.org>,
	Petr Mladek <pmladek@suse.com>, Jason Baron <jbaron@akamai.com>,
	Evgenii Shatokhin <eshatokhin@virtuozzo.com>
Subject: Re: [PATCH v0 2/3] livepatch: update documentation/samples for callbacks
Date: Tue, 27 Feb 2018 09:58:40 -0500	[thread overview]
Message-ID: <f87dbd4e-7262-5c90-0a5f-a54e4d0af20d@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.21.1802271324370.19255@pobox.suse.cz>

On 02/27/2018 07:36 AM, Miroslav Benes wrote:
> On Fri, 23 Feb 2018, Joe Lawrence wrote:
> 
>> [ ... snip ... ]
>>  
>> +If a livepatch is replaced by a cumulative patch, then only the
>> +callbacks belonging to the cumulative patch will be executed.  This
>> +simplifies the livepatching core for it is the responsibility of the
>> +cumulative patch to safely revert whatever needs to be reverted.  See
>> +Documentation/livepatch/cumulative.txt for more information on such
>> +patches.
> 
> s/cumulative/atomic replace/ almost everywhere?
> 
> 'Documentation/livepatch/cumulative.txt' should be 
> 'Documentation/livepatch/cumulative-patches.txt' and we may rename it 
> atomic-replace-patches.txt. I don't know. Cumulative patches forms a 
> subset of atomic replace patches in my understanding. The feature itself 
> is more general. Even if practically used for cumulative patches only. But 
> it is for you and Petr to decide.

Hi Miroslav,

Thanks for reviewing!

I guess I'm a little confused about the distinction here.

I understood a "cumulative-patch" to mean that it would contain the sum
of all changes.  So instead of this:

  patch 1 = A
+ patch 2 =     B
+ patch 3 =         C
-----------------------
  net     = A + B + C

We can group all of the changes together into a single cumulative-patch
for the same net effect:

  patch 1 = A               -replaced by-
  patch 2 = A + B             -replaced by-
  patch 3 = A + B + C

I assumed this would also mean to include any reverted changes as well.
So in the example above, if change C needed to be reverted, then:

  patch 4 = A + B

and that would still be considered a "cumulative-patch".

In my mind, atomic replace is the mechanism that forces patching to be
cumulative.  Perhaps this is too strict?  Are there other use-cases for
atomic-replace?

>>  Example Use-cases
>>  =================
>>
>> [ ... snip ... ]
>>
>> +Test 11
>> +-------
>> +
>> +A similar test as the previous one, except this time load the second
>> +callback demo module as a cumulative (ie, replacement) patch.  The
>> +livepatching core will only execute klp_object callbacks for the latest
>> +cumulative patch on the patch stack.
>> +
>> +- load livepatch
>> +- load second livepatch (atomic replace)
>> +- disable livepatch
> 
> Not needed.

Good catch.

-- Joe

  reply	other threads:[~2018-02-27 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 21:33 [PATCH v0 0/3] additional cumulative livepatch doc/samples Joe Lawrence
2018-02-23 21:33 ` [PATCH v0 1/3] livepatch: add sample cumulative patch Joe Lawrence
2018-02-25  1:38   ` Philippe Ombredanne
2018-02-27 11:54     ` Miroslav Benes
2018-03-02  1:19       ` Philippe Ombredanne
2018-03-02  8:31         ` Greg Kroah-Hartman
2018-03-02  9:11           ` Miroslav Benes
2018-02-27 11:37   ` Miroslav Benes
2018-02-23 21:33 ` [PATCH v0 2/3] livepatch: update documentation/samples for callbacks Joe Lawrence
2018-02-27 12:36   ` Miroslav Benes
2018-02-27 14:58     ` Joe Lawrence [this message]
2018-02-28 13:20       ` Miroslav Benes
2018-03-02 11:11       ` Petr Mladek
2018-03-02 22:08         ` Joe Lawrence
2018-02-23 21:33 ` [PATCH v0 3/3] livepatch: update documentation for shadow variables Joe Lawrence
2018-03-02 11:58   ` Petr Mladek

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=f87dbd4e-7262-5c90-0a5f-a54e4d0af20d@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=eshatokhin@virtuozzo.com \
    --cc=jbaron@akamai.com \
    --cc=jeyu@kernel.org \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --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).