Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp493897imm; Wed, 6 Jun 2018 00:50:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLGGiRhBpeErcpgTEO7gCZC79gJ9kFk16LJ+mZQlrjLFq7c5bgxuCnvph2JqMjjZzwJg1UP X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr2181568pld.268.1528271448972; Wed, 06 Jun 2018 00:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528271448; cv=none; d=google.com; s=arc-20160816; b=m9rV7hhFp83cxSuOSisnzG4KOyVFGzG7xnlz7P7qb45vOlfk5XDmGqLMHHU5kOvSVq XhRNcxpy3EfbUKhV84COHTqFTelg/gXOtx43O57uP5ZAKxE83GqdnwdzAGdMeDd4OGEo TuXvYwSl7hyHWzJh5rkjdoCf+WFraLsL6DgiWO63tZvqDb3UoiLWFBrvIrV7z9hlMEje iFI2WurMfwDq8TD0kYm9rC9W4pkOh8xea5nzWabXVe890Z8TbaJrjpucQKTUCrwqOXso dHL8DqJb/l7r3H7rGXBX6P+E7NCINhGhisGFsjUeQerlQntPLZ642h3cjoaBiS6nNpba rE6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=s+qRhPUCNyNkNuvgF3LHgwQibuUQLDsq1I9LrghKXlM=; b=OK593ovXy7c0R0WpvCK6hw4JV1n5x0ZGTbaMD0TyLhABq8y2HgwLej3yzRVHznPcJl phowcmVVyXFGVETuqHE4jVKMG05vl0cl8TLlNPXz+tH40d19loo7gJWQ1AiYVAqR3KZt +64dcU6Eclm6ekHH3YDj5Fr+119L7EyBiXSP2iys+IRptc1TARTGYnN74o30OBqAHx1b JluGBau7LyYw4WLWehn6cgvksFyhUj/EMrX31BppHcvvUrSRBRYJeGCW/kE3QkGe7P8R BvqNJf/eliiIOZTPnsVUxF7U74QwLIh8BZp/Wjtgq4nBI01MRVwAjna/qm6xLLbg5ZgD DdtQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j184-v6si2853516pgc.520.2018.06.06.00.50.34; Wed, 06 Jun 2018 00:50:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932381AbeFFHtx (ORCPT + 99 others); Wed, 6 Jun 2018 03:49:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:33952 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932214AbeFFHtw (ORCPT ); Wed, 6 Jun 2018 03:49:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1E2F6ADFA; Wed, 6 Jun 2018 07:49:51 +0000 (UTC) Date: Wed, 6 Jun 2018 09:49:50 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf 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 In-Reply-To: <20180605140040.in2ndsb34o42hert@treble> Message-ID: References: <20180604141636.11523-1-mbenes@suse.cz> <20180604141636.11523-2-mbenes@suse.cz> <20180604180325.yeewbafxpjkt6gi5@treble> <20180605140040.in2ndsb34o42hert@treble> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jun 2018, Josh Poimboeuf wrote: > 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? I'm not sure about 'will already need to be managed by user space' part. Sending the fake signal would unblock transition in certain cases "for free". No user interaction is really needed and we can do it automatically. That's why I find it beneficial. If it does not help, then the user must decide what to do next. Reversion or force. That's up to them. Miroslav