Received: by 10.223.185.116 with SMTP id b49csp8921202wrg; Fri, 2 Mar 2018 10:10:20 -0800 (PST) X-Google-Smtp-Source: AG47ELv2XH8Xr81pvRFDOG1x1X7Rue/4DRk+ym2qNn/eM92sTSV/bs45walKjWL4JmAVNG20Zd9f X-Received: by 10.99.190.68 with SMTP id g4mr5153994pgo.143.1520014220096; Fri, 02 Mar 2018 10:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520014220; cv=none; d=google.com; s=arc-20160816; b=eMENT7mlL9xV2FYI18i+fNcuuB5RVPB7U48dwe+BqoKotMTvo7TQzWghNaWsof16DO UDXez+Ly6q88mFR+2U9z1cBSa8+v1czsTtlJqzsvI1nxVRBgxGmIpTRHjfkI2iPjXmyx tBLkOImOjryKHsj05hv4fpXfGc5vM3SkoW/bV7yC48O4TiRAszFSG0+i28NGqD5UVJJ6 EBheGYQeHmsVoVPctW5PRJ3nTqJAL/CmIBG0NiczZ+ERL/02l3HbGohz9f3UXeF+TlPV OsBRtMDi0WlGEQ+WRz165O8GlNcmnE04r+8GtDukP1Yh2nYnZP1Y6LU8fJ9kX6dCzhZA 2vPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=yKq7VE2IV9G16MaxFO2L12SL47vdrEwnOvXVaKmQRn0=; b=IMS2g7lYm6F53MJF9oRwtLri/7YPzs29gtQmsWUmjcYMiHl1IIkmkKpfy1cSPDbWtx pn1ZsjgDbsmlb7ihiIXjgLqvM2TLX+7Q4peNAGGmhl+AAfO8ZPl06p0BOsHc3oye5rpz 0zblYFvaJ95+vNIlmuircNQfE5PV4PW97GiV+jO6oAIJH7kcHV8fnbZ3YoHjKiycd1tv BsaSicBmu8VUQyoQcLI3L5kd978eQCBK9/PNXc0A2XqdPu8UZbCXfgUjoevXarcxF5b7 U7WjHiTwZy/qwIFHh9TkTrDxARlUV5vRdHJFvI86pQSUq5BN6LSmyQF8QKHCvsN89wpU D8JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si5134823plr.462.2018.03.02.10.10.05; Fri, 02 Mar 2018 10:10:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426981AbeCBLLV (ORCPT + 99 others); Fri, 2 Mar 2018 06:11:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:38905 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423519AbeCBLLN (ORCPT ); Fri, 2 Mar 2018 06:11:13 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9E718AB35; Fri, 2 Mar 2018 11:11:11 +0000 (UTC) Date: Fri, 2 Mar 2018 12:11:11 +0100 From: Petr Mladek To: Joe Lawrence Cc: Miroslav Benes , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Jessica Yu , Jiri Kosina , Jason Baron , Evgenii Shatokhin Subject: Re: [PATCH v0 2/3] livepatch: update documentation/samples for callbacks Message-ID: <20180302111111.f6tt2rnwa4nnbswh@pathway.suse.cz> References: <1519421630-12025-1-git-send-email-joe.lawrence@redhat.com> <1519421630-12025-3-git-send-email-joe.lawrence@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2018-02-27 09:58:40, Joe Lawrence wrote: > 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". Yes, I would consider this 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? Jason talked about using the atomic replace to get rid of any existing livepatches and adding another changes instead. The changes in the old and the new patch might be unrelated. They simply do not want to mind what was there before. The term "atomic replace" fits perfectly for this usecase. My understanding is that cumulative patches do similar thing. But the old and new patches should be related. In particular, any new patch should include most changes from the older one. The only exception is when an old change was wrong and we do not want it anymore. Now, your examples are close the the Jason's use case. They do: patch1 = A -replaced by- patch2 = B ------------------ result B I mean that one change is replaced by an "unrelated" one. It might confuse people. They might ask why the new patch is called cumulative when all the older changes are lost. I would suggest to rename the sample patch to livepatch-test-replace or so. Also I would try to avoid the world cumulative in the example to avoid confusion. I still would prefer to keep the documentation for the feature called cumulative-patches.txt. From my point of view, the atomic replace is rather a technical detail. It might be dangerous when used for non-related patches. On the other, cumulative patches seem to be a promising way how to keep livepatches maintainable and safe. Best Regards, Petr PS: I did not added these patches to v9 of the atomic replace patchset. It was already big enough. And I hope that v9 might be final. In addition, there are no conflicts on the touched files side. In each case, thanks a lot for these nice examples and for finding the bug.