Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752794AbdF3Uc3 (ORCPT ); Fri, 30 Jun 2017 16:32:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39830 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbdF3Uc2 (ORCPT ); Fri, 30 Jun 2017 16:32:28 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C19EC61B90 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C19EC61B90 Date: Fri, 30 Jun 2017 15:32:22 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: Petr Mladek , Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina Subject: Re: [PATCH 3/3] livepatch: add shadow variable sample program Message-ID: <20170630203222.73ah24pmlw7flnm3@treble> References: <1496341526-19061-1-git-send-email-joe.lawrence@redhat.com> <1496341526-19061-4-git-send-email-joe.lawrence@redhat.com> <20170614142102.GA2583@pathway.suse.cz> <20170614145756.gom3zf6uv7ua423h@treble> <20170615105943.GE15013@pathway.suse.cz> <20170615134927.n53bn3ckizi6anhi@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 30 Jun 2017 20:32:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1689 Lines: 36 On Mon, Jun 19, 2017 at 06:56:37PM +0200, Miroslav Benes wrote: > > > > > I often wonder whether it's really a good idea to even allow the > > > > unloading of patch modules at all. It adds complexity to the livepatch > > > > code. Is it worth it? I don't have an answer but I'd be interested in > > > > other people's opinion. > > > > > > I could imagine a situation when a livepatch causes, for example, > > > performance, problems on a server because of the redirection > > > to the new code. Then it might be handy to disable the patch > > > and ftrace handlers completely. > > > > Fair enough, though it sounds theoretical. It would be good to know > > we're supporting actual real world use cases. > > We distribute cumulative "replace_all" patches at SUSE. replace_all means > that all previous patches are reverted in the process of application. All > livepatch modules with zero refcount are removed. This keeps a number of > loaded modules low and system's state well defined, which is always a good > thing, because a customer might run into problems and we'd have to debug > it. We used to have something similar in kpatch. And we recently discovered that this "replace_all" feature would also be nice to have in livepatch. We had a patch B which needed to partially revert patch A. We had to manually do the revert at a function level, which basically means repatching the function so that it resembles its original state. It would be much more straightforward to be able to tell klp to revert everything in patch A while applying patch B. Then the func stack would never have more than one entry. And that would be good for performance as well. -- Josh