Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9904563imu; Wed, 5 Dec 2018 12:18:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/W70Cs3abP076e0ZMenrela9QrU5hk0FwwhJiT5XaGuBjR59ot/Y09ViXdz0+tpTwSDkvkQ X-Received: by 2002:a63:86c2:: with SMTP id x185mr19908599pgd.230.1544041127926; Wed, 05 Dec 2018 12:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544041127; cv=none; d=google.com; s=arc-20160816; b=jfb6IYtSkcjpAgJWIMaX3AJmXGLxZUcVZpslP8XTFxUUcmL1TcoK6D2HTMOrq0PEuP 1NndbWljQhAmSeKDGeJNJgx5hDKpPNGT+qjM4ZtHv10HeOadKXTKtnq+9OgKBtJoBodS uHUSU5VExuNJY8LeKaGfwGSykMSe39kirIwxf3DEQR7rV4BgGKhIRRVKZtbDWIwJe5is 4eQRyodSbtlnpQCJu0/BF7uHI3lFZmCvntSTw6Jzp5i7olhXuR0aPtg9DNRW9c0W+azk YceONcKv9TowFSCoQ21Vodm0yEyxiWUGI7+gZHR+YDpH4fc3rP9cHq9gOLPKs2sT8xcb 6YZQ== 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; bh=WqOdrq0ObaH/aVwOdRo7QCmtM7pbL6t2F6jyO92ltG0=; b=icNFeNupuj52ppko7H237HcKwidXnQUQidp7z/z7PIbvhX8qI1zvF3USvu0fWC9/3S XeuQag+SQbw6AiZM7xb62uj1PDAUYs7GxE9hKwq/fUX5k/bI652sSO/XlYmykySZd0Dj DTmYdvAycpTaJ5w0GQJGtteUOQ8ZOWoCs56tDDzuwXb0r+Ird01p2V0e8rFskrWkdEEd C+XgRhtdo6iqlJqkjo6BNHkyUayUCb0AWmSZAhroyobHWQaiYysRTYdg/gZGBM5Q+sXT kVkqNt1gFziKhX2XlfUnZjlcYVSJP1S9F0+7RPcD2I5CRmsMPNrLE6G1N4PZoUMny+Bc tDpw== 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 g10si20624413plq.371.2018.12.05.12.18.31; Wed, 05 Dec 2018 12:18:47 -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 S1728356AbeLEUR4 (ORCPT + 99 others); Wed, 5 Dec 2018 15:17:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727402AbeLEUR4 (ORCPT ); Wed, 5 Dec 2018 15:17:56 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46501C075D6C; Wed, 5 Dec 2018 20:17:56 +0000 (UTC) Received: from redhat.com (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E61B6910B; Wed, 5 Dec 2018 20:17:55 +0000 (UTC) Date: Wed, 5 Dec 2018 15:17:54 -0500 From: Joe Lawrence To: Petr Mladek Cc: Jiri Kosina , Josh Poimboeuf , Miroslav Benes , Jason Baron , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 08/11] livepatch: Remove Nop structures when unused Message-ID: <20181205201754.cvvywqlmxwgcbqzt@redhat.com> References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-9-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129094431.7801-9-pmladek@suse.com> User-Agent: Mutt/1.6.2-neo (2016-08-08) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 05 Dec 2018 20:17:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 10:44:28AM +0100, 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 make false feeling that the function is patched ^^^^^^^^^^^^^^^^^^ re-wording suggestion: "give the impression" > even though the ftrace handler has no effect. > > + Ftrace handlers are not completely for free. They cause slowdown that ^^^^^^^^ re-wording suggesions: "free" or "do not come for free" > might be visible in some workloads. The ftrace-related slowdown might > actually be the reason why the function is not longer patched in ^^^^^^^^^^ s/not longer/no longer > the new cumulative patch. One would expect that cumulative patch > would allow to solve these problems as well. ^^^^^^^^^^^^^^ re-wording suggestion: "help solve" > > + 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 processor, for example, see ^^^^^^^^^ s/processor/processors > arch/x86/kernel/alternative.c. And klp_ftrace_handler() is much > more complicated. > > + It sounds natural to clean up a mess that is not longer needed. ^^^^^^^^^^ s/not longer/no longer > 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 > --- Acked-by: Joe Lawrence -- Joe