Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp952392imm; Tue, 5 Jun 2018 07:03:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK9iKtmpW5dRtyZscHevQ1s8PiH+oeVji41vkxnIpa8BB1UO3Umzmtdgq4nPxlqoI3IzeSz X-Received: by 2002:a63:7f1b:: with SMTP id a27-v6mr21512713pgd.410.1528207404417; Tue, 05 Jun 2018 07:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528207404; cv=none; d=google.com; s=arc-20160816; b=jiXsZBiLFRpw0/qFiEpwIs+LQnc4ONlUTzDlPM5r0g99MKpuhPFSeyNJOiV1LfNIs+ ZZwRoUFHebPpW0BdqpPNkO5IBdwpLGKcURbmeiwrd1EB5ck7POCj9BtgKeOOlBIcJRrS ftNi9JaZw1chUadEIg8Ev9S3ncmBWV6vilADnQGcfSpv7V0pqTOOCx0E9Kr+HJjJQeTb /PC4U4ZYR22MoU0ebTHn/+uCGk7HlcLUrDSDA4la+ARoPiO1Zv1fIZwrBC5HkceaNy2j XpKDz8LExlE7SCczeIYcypbuNfGcAuONk2HPxr1Wi5m8BfgQT6qt4zXjwI+HC+Os7+bo uUmw== 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=Wn/uEJSuuOW2jUNwuSutELRPgSr1+zpRCwCyo1Ba1i8=; b=zHV4YccuEctXzM7bBwQB6BsLey3kblaaojmyIRmhsdAmbt6MrSeiRcafC78idXCiCV a114xOpwVYbnS0q8fLLhaUAPuyy7Q+xCpY05ZKQ64qyrfU1opAZweLCD8GWu4jKWDpRH a4+B11PQyiWerXNEIKcGH+GExQ8z3ZvZThHcjLPTCGucceE1+n19Ux2X1a5AxHL59SPc TLuRoX9QLiJ9s7hNVJWJMNbYgoePUwnrbYdZ+m2d/krU2O1BGftvLud6Vzgpuwh6qxHm dEGk9O+joYVTp4kHdo0XCPBvPz9pf9Giuqorxo9SB+bBe0FIK7wvkBgLxkrBJTpX4ZMa ucLQ== 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 m62-v6si21284158pfa.45.2018.06.05.07.02.45; Tue, 05 Jun 2018 07:03:24 -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 S1752021AbeFEOBo (ORCPT + 99 others); Tue, 5 Jun 2018 10:01:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751866AbeFEOBn (ORCPT ); Tue, 5 Jun 2018 10:01:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16E277D843; Tue, 5 Jun 2018 14:01:43 +0000 (UTC) Received: from treble (ovpn-120-138.rdu2.redhat.com [10.10.120.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6CBD10F1C10; Tue, 5 Jun 2018 14:01:42 +0000 (UTC) Date: Tue, 5 Jun 2018 09:01:41 -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: <20180605140040.in2ndsb34o42hert@treble> References: <20180604141636.11523-1-mbenes@suse.cz> <20180604141636.11523-2-mbenes@suse.cz> <20180604180325.yeewbafxpjkt6gi5@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 05 Jun 2018 14:01:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 05 Jun 2018 14:01:43 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 Tue, Jun 05, 2018 at 09:17:52AM +0200, Miroslav Benes wrote: > On Mon, 4 Jun 2018, Josh Poimboeuf wrote: > > > 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? > > I met (rare!) cases when doing it once was not enough due to a race and > the signal was missed. However involved testcases were really artificial. > > > 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. > > And there is 'force' option... > > So given all this, I'd call klp_send_signals() once and then leave it up > to the user. Would that work for you? Well, I don't know. Since the patching process will already need to be managed by user space, what's the benefit of having the kernel doing only this part of it? -- Josh