Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3897754imm; Mon, 4 Jun 2018 11:04:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI63sgvykX8EtPWePKgbPvJ7CywR6jLd/b0M5MlP+AMcDsHepnfS3LpcMjdDhHJA5qmSF56 X-Received: by 2002:a63:7d1b:: with SMTP id y27-v6mr17978942pgc.418.1528135451691; Mon, 04 Jun 2018 11:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528135451; cv=none; d=google.com; s=arc-20160816; b=hcutjqLHw4BrrR3YIxo84JQjVq/TV5vOdnkH1L8ndVvUmhGZTUYkQYsYuYPeSjGlVI 4J9OXxMjefzOtWM5Clkg3y68Lw61lqA9eqlSa7cTvnavdcmp7u/BqaFA44MOpBxP6ANr 0vuDB8t/yXC5LXCOiwvSJ1JNygkAbjrv6MoAEZxErjtvzrJT/np8B5neW/gQOm0ISwE1 KomFqnL67eRX8BuHZXN0C8+R/8DT8EvE/IPRNJfTfx25F3/ENhTPdY1E427FZ7KUqKli ZkF3gKK7SqueBHgNuLK4hSbGP9to0H1Xs7vR+qOVg6U8U0QOLivfxB9K1ZKG9iptYAfJ XFbQ== 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=AwO81wh+Ej2BzpTVDitmioX+XzktA+D+DbBDog4fPuY=; b=cXJUEutQcrin1bdzNd39jLuNLE91BcCHF51f4FaxknRfxLA3DLsKyalHiH7eYgqcdZ 2hsdt+IX1GPS8SGxB50un4KP8w0wKOArMyvAMGtZy8UFnyNLE/9wPOOpPb9nrxhhpZW3 6lAz083ONSq+7NAJhHWz92De6fk+CdkJRrz/eGzAdGtm9Dq7+5ibM5ihC4AYDe/LqsmO 88EJBPSjFAx1PrQQBt+oicSbu+3EOUmt5d51uPVvmFrpUF2UXohLqBUbC+k9MsJw1+w+ 2idT8wx0cMBkV7bL1grLOuOEYL7JeyAq/J9ZUjneeGxImwT3qINMbnzbZY0Y5IYQ/6Wg k/8Q== 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 n6-v6si47401531pla.12.2018.06.04.11.03.53; Mon, 04 Jun 2018 11:04:11 -0700 (PDT) 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 S1751568AbeFDSDa (ORCPT + 99 others); Mon, 4 Jun 2018 14:03:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751445AbeFDSD2 (ORCPT ); Mon, 4 Jun 2018 14:03:28 -0400 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 5E889402382F; Mon, 4 Jun 2018 18:03:27 +0000 (UTC) Received: from treble (ovpn-122-112.rdu2.redhat.com [10.10.122.112]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0049B2144B22; Mon, 4 Jun 2018 18:03:26 +0000 (UTC) Date: Mon, 4 Jun 2018 13:03:25 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: jikos@kernel.org, jeyu@kernel.org, pmladek@suse.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] livepatch: Send a fake signal periodically Message-ID: <20180604180325.yeewbafxpjkt6gi5@treble> References: <20180604141636.11523-1-mbenes@suse.cz> <20180604141636.11523-2-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180604141636.11523-2-mbenes@suse.cz> User-Agent: NeoMutt/20180323 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.6]); Mon, 04 Jun 2018 18:03:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 04 Jun 2018 18:03:27 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 04, 2018 at 04:16:35PM +0200, Miroslav Benes wrote: > An administrator may send a fake signal to all remaining blocking tasks > of a running transition by writing to > /sys/kernel/livepatch//signal attribute. Let's do it > automatically after 10 seconds. The timeout is chosen deliberately. It > gives the tasks enough time to transition themselves. > > Theoretically, sending it once should be more than enough. Better be safe > than sorry, so send it periodically. This is the part I don't understand. Why do it periodically? Instead, might it make sense to just send the signals once, and if that doesn't work, reverse the transition? Then we could make patching a synchronous operation. But then, it might be remotely possible that the reverse operation also stalls (e.g., on a kthread). So, maybe it's best to just leave all these controls in the hands of the user. All that said, a few code review comments: - AFAICT, it does an 8 second delay instead of a 10 second delay, because a) try_complete_transition() is first called before there's any delay; b) the preincrement operator used on signals_cnt. - I think 15 seconds might be a better default. I've seen longer patching delays on a system with 100+ CPUs. - If a kthread or idle task is sleeping on a patched function, the pr_notice("signaling remaining tasks\n") will be repeated continously. - It might be cleaner to do it from the delayed work function (klp_transition_work_fn). -- Josh