Received: by 10.223.185.116 with SMTP id b49csp5043384wrg; Tue, 27 Feb 2018 06:59:58 -0800 (PST) X-Google-Smtp-Source: AH8x224k+bqrStu+4UXn6nvcQnd3pfUU5ztrSQhO+faG7wDYiabERGpAsj+ONPKBQawwbr5c8ldN X-Received: by 10.98.62.196 with SMTP id y65mr14215679pfj.24.1519743598056; Tue, 27 Feb 2018 06:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519743598; cv=none; d=google.com; s=arc-20160816; b=crgtLaz2w48MhZROAJUEkmMGzx3mm8GjDU1z3rVCnYtgmj0nKj21GN1njnTD2OjQQ5 9pbbssyYqIDBRbv5T6t5XX/wUemYEhBZMASMiwMnoLiD2vgDD999EA5CT3MV/443OAbO WTuULrvP/nAmYIxNNydXCem2XpB7xp8Rnu/7HQTJ07MpP1t5da2UBDDfAMznygvOkpdY bhehiI4cEQLoANFmUOH4hky6BZFfTxKSmRJm6VZ9sw+NlusWdVS5pADz6Nv0cZRdd5OR SCDcTqh13X74tekt1SclKf6FP5QPKJ6Hm6k1gXshWuKrwgtO8H9Wlm6WNiupdLiAVKmk 7wgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:subject:from :arc-authentication-results; bh=oPtdK9Uow5AV1kiqFYYj/pMipk+3skJEoo6d48sM05o=; b=jQcbM8ax5nITrjaTh0cmO3btCjIgd9vlKyWuPE4RQ9ZyiU28AJrI3hJ2D8FKvGakFi YsqciKIuwVDDIKA15jEPq+0HRtIsYvLKoNNiJFDK9xooPZh2aEUeKCOiiGLjP94qePam 3g78TLYqysO4dxFob55kYnxOpJDTiposIMhseDDke5rpHsPxrT+ezuBVFEK8WwEgYHmn GollCgp46DivrD4WD/oP1i9xcJCyRcEBsaRpqFqTL5Y1XA8eWdW4ouH5yDOIcFNFXuw0 FWHWywBEymD1oawsegbweeEObS5TrxzMSqCBny/7tx/mq5MfLboZYIhMSjnm+PV/3EEK C1Aw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2-v6si8562601plp.544.2018.02.27.06.59.43; Tue, 27 Feb 2018 06:59:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754066AbeB0O6q (ORCPT + 99 others); Tue, 27 Feb 2018 09:58:46 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35412 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754055AbeB0O6m (ORCPT ); Tue, 27 Feb 2018 09:58:42 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DC2340363BE; Tue, 27 Feb 2018 14:58:41 +0000 (UTC) Received: from jlaw-desktop.bos.csb (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1914D2144B21; Tue, 27 Feb 2018 14:58:40 +0000 (UTC) From: Joe Lawrence Subject: Re: [PATCH v0 2/3] livepatch: update documentation/samples for callbacks To: Miroslav Benes Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Jessica Yu , Jiri Kosina , Petr Mladek , Jason Baron , Evgenii Shatokhin References: <1519421630-12025-1-git-send-email-joe.lawrence@redhat.com> <1519421630-12025-3-git-send-email-joe.lawrence@redhat.com> Organization: Red Hat Message-ID: Date: Tue, 27 Feb 2018 09:58:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 27 Feb 2018 14:58:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 27 Feb 2018 14:58:41 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'joe.lawrence@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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