Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6733506imu; Mon, 21 Jan 2019 14:49:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN48vbXKYFRZj9xnd5dhaICZKRaNfn7MwxVG8mamteojT09h0J0l0o2wN7odo2Ld2uvL2sbg X-Received: by 2002:a62:4886:: with SMTP id q6mr32170709pfi.182.1548110963530; Mon, 21 Jan 2019 14:49:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548110963; cv=none; d=google.com; s=arc-20160816; b=TZz1o8fVuGufvnafHi+OBmf3/CBHPtxOZj5QzUQat4GvtQBpStd4/fG6Yp9sM17o23 FD7YZwb4chJeCBEhdD6KP0BYnohvOHhVOcRVfsR4BGdioML8XIKvtxKB20kZUyjkYsh2 Y96TVJMNLjeqzHU993xx3Oaw2RHRQ74ue301Oe7npEaJf9zqeGtK/z+duLRZK27ba8jT pfskYF3eDDogr7hx4d1WCd10l3I/j1Hl34CuXA0cFsFxPMHNmRHQFHOhdB/vrIhaH4+u RwpNtl6abH4wuFyoQSHxnqrH/DaqziieHX9zHncL+tTEZBgLXh0HFkI11+S1eslci3ML mrRA== 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=v2yu5s25jJU2puB0D9Uit/UorJAsiFU1kVisBufeJQ4=; b=cHe89o4nHoNT+T1ULNdgDIJVPGdX2gtm7uHFodMRB2ztJuA+97tWJ+6Ecnz9D2d8Im MF72h7PbccDlQJQQ/GtSCc/dRIKbHarpezEimU9hAwN+rjffSwEBzhWQeJMHoUSSsgdx a0ydKw9+fFqt1OtjwN6tfVlm1Nz8o7Qoz0EzH1Jv4SE3kVbkozB4GT6ZUqpZZUT+rFvG sc5rFyH1NO0rKPGvVdzpxYsW4KqjkzjlK3mnKC+yqebEnyc3V9DvNn8+3Z3rT8brRwht du2hOWTRYh7Kyv9HJfYmStdb2EWfSbHzY/1XGw9pF/yWRNujj0ZQNFNt23iCpzva5EUy S4gQ== 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 p19si14203068pgj.375.2019.01.21.14.49.08; Mon, 21 Jan 2019 14:49:23 -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 S1728171AbfAUWrb (ORCPT + 99 others); Mon, 21 Jan 2019 17:47:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50168 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbfAUWrb (ORCPT ); Mon, 21 Jan 2019 17:47:31 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E86A7F6B3; Mon, 21 Jan 2019 22:47:31 +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 331695DD91; Mon, 21 Jan 2019 22:47:30 +0000 (UTC) Date: Mon, 21 Jan 2019 17:47:28 -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 3/4] livepatch: Module coming and going callbacks can proceed all listed patches Message-ID: <20190121224728.GC8766@redhat.com> References: <20190116161720.796-1-pmladek@suse.com> <20190116161720.796-4-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190116161720.796-4-pmladek@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 21 Jan 2019 22:47:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 16, 2019 at 05:17:19PM +0100, Petr Mladek wrote: > Livepatches can not longer get enabled and disabled repeatedly. nit: s/not longer/no longer/g > The list klp_patches contains only enabled patches and eventually > the patch in transition. > > The module coming and going callbacks do not longer need to > check for these state. They have to proceed all listed patches. nit: suggestion to modify "proceed all" to "proceed with" or "execute all". Same suggestion for the subject line. (I keep reading it as "precede all" and I'm wondering if there is some kind of ordering change.) > > Suggested-by: Josh Poimboeuf > Signed-off-by: Petr Mladek > --- > kernel/livepatch/core.c | 26 ++++++-------------------- > 1 file changed, 6 insertions(+), 20 deletions(-) > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > index b716a6289204..684766d306ad 100644 > --- a/kernel/livepatch/core.c > +++ b/kernel/livepatch/core.c > @@ -1141,21 +1141,14 @@ static void klp_cleanup_module_patches_limited(struct module *mod, > if (!klp_is_module(obj) || strcmp(obj->name, mod->name)) > continue; > > - /* > - * Only unpatch the module if the patch is enabled or > - * is in transition. > - */ > - if (patch->enabled || patch == klp_transition_patch) { > - > - if (patch != klp_transition_patch) > - klp_pre_unpatch_callback(obj); > + if (patch != klp_transition_patch) > + klp_pre_unpatch_callback(obj); > > - pr_notice("reverting patch '%s' on unloading module '%s'\n", > - patch->mod->name, obj->mod->name); > - klp_unpatch_object(obj); > + pr_notice("reverting patch '%s' on unloading module '%s'\n", > + patch->mod->name, obj->mod->name); > + klp_unpatch_object(obj); > > - klp_post_unpatch_callback(obj); > - } > + klp_post_unpatch_callback(obj); > > klp_free_object_loaded(obj); > break; > @@ -1194,13 +1187,6 @@ int klp_module_coming(struct module *mod) > goto err; > } > > - /* > - * Only patch the module if the patch is enabled or is > - * in transition. > - */ > - if (!patch->enabled && patch != klp_transition_patch) > - break; > - > pr_notice("applying patch '%s' to loading module '%s'\n", > patch->mod->name, obj->mod->name); > > -- > 2.13.7 > Any simplication to the callback code is welcome! Thanks for cleaning this one up. With a few commit msg nits, Acked-by: Joe Lawrence -- Joe