Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2021612imm; Thu, 18 Oct 2018 07:55:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV62AY4eaCTI1hUmi5KCHxzSZ+2vgrSLGdMzdpS+kHre8TTYGB5D9iEdiZbUB/OWBZes/UcJW X-Received: by 2002:a62:8708:: with SMTP id i8-v6mr30854867pfe.150.1539874538359; Thu, 18 Oct 2018 07:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539874538; cv=none; d=google.com; s=arc-20160816; b=YBtaVOFmXIozhrB29xvUfy7hY4kG402miNgT/6HWHnXDI4d/FskUbCDYgif7ubtsu4 28i3y9qea4TkMGAQg//ocKnky6QP3z8bNqmxwc2lkexxGsSGNdPV0xXBlyDOcl3a73y/ 4B83h/PUGRZG8af5YxhEBqQBPe11H/HEtyE3Dx03Zeq8jGqwddF4SZ0otmJMZBeVvzkb vwXrCa46qh8TjIBLXVppRkI/JZD0KrBngvLPjt7Hahy824imUEHonuTlR057AoX8aZhz gzj6Dli7z+qMoivBalObs4PHHtlunF586gLhPVoDBz5uSLjztmH0NJ/9Rb/eVrPQdZty JjUw== 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=9ZBfGss/XAf6EWebRgiNc39eGw1Di2WLm/yGoiRfkiQ=; b=Wl2PfBb7EtPnAKwAYzQDJyqG0bkUwt6MhF/eS5KmXCfsyObS6rsrxZh5ghSgZ5Q8WS F8QvzPTvzCh+hcn5uFmgSp3eTrFRBguAwdJSmjZfRIlPGnK5SpqJ0BWKVFnFXBDwzp+L 5lKhiXeB8q2ORlN3wcFsY5CtaNL8M7Zo4XXPm2evbcomnSKD8GZJECB3k98Px3E8Zgq+ 7kBPjvVIqVselxPUjabPv6zUbX6EL3A/HYjNI+n9uHgHvUG36xdVtZBJ9Ir/I6G0gkV+ 7lW6tjfn0HCt1GrY9xmIUhJChWryp8bh0XGgcv+ZU83SBq+V98QCZtFIqyOv1H/vtNIh zN8Q== 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 8-v6si5885007pgz.395.2018.10.18.07.55.21; Thu, 18 Oct 2018 07:55:38 -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 S1727323AbeJRW4V (ORCPT + 99 others); Thu, 18 Oct 2018 18:56:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:50074 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726133AbeJRW4V (ORCPT ); Thu, 18 Oct 2018 18:56:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E219BAD77; Thu, 18 Oct 2018 14:54:57 +0000 (UTC) Date: Thu, 18 Oct 2018 16:54:56 +0200 From: Petr Mladek To: Miroslav Benes Cc: Jiri Kosina , Josh Poimboeuf , Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 06/12] livepatch: Simplify API by removing registration step Message-ID: <20181018145456.nrekm2iuyf5ztw3n@pathway.suse.cz> References: <20180828143603.4442-1-pmladek@suse.com> <20180828143603.4442-7-pmladek@suse.com> <20181012130120.f5berowklyccd7lj@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2018-10-15 18:01:43, Miroslav Benes wrote: > On Fri, 12 Oct 2018, Petr Mladek wrote: > > > On Wed 2018-09-05 11:34:06, Miroslav Benes wrote: > > > On Tue, 28 Aug 2018, Petr Mladek wrote: > > > > Also the API and logic is much easier. It is enough to call > > > > klp_enable_patch() in module_init() call. The patch patch can be disabled > > > > by writing '0' into /sys/kernel/livepatch//enabled. Then the module > > > > can be removed once the transition finishes and sysfs interface is freed. > > > > > > I think it would be good to discuss our sysfs interface here as well. > > > > > > Writing '1' to enabled attribute now makes sense only when you need to > > > reverse an unpatching transition. Writing '0' means "disable" or a > > > reversion again. > > > > > > Wouldn't be better to split it to two different attributes? Something like > > > "disable" and "reverse"? It could be more intuitive. > > > > > > Maybe we'd also find out that even patch->enabled member is not useful > > > anymore in such case. > > > > I though about this as well. I kept "enabled" because: > > > > + It keeps the public interface the same as before. Most people > > would not notice any change in the behavior except maybe that > > the interface disappears when the patch gets disabled. > > Well our sysfs interface is still in a testing phase as far as ABI is > involved. Moreover, each live patch is bound to its base kernel by > definition anyway. So we can change this without remorse, I think. > > > + The reverse operation makes most sense when the transition > > cannot get finished. In theory, it might be problem to > > finish even the reversed one. People might want to > > reverse once again and force it. Then "reverse" file > > might be confusing. They might not know in which direction > > they do the reverse. > > I still think it would be better to have a less confusing interface and it > would outweigh the second remark. OK, what about having just "disable" in sysfs. I agree that it makes much more sense than "enable" now. It might be used also for the reverse operation the same way as "enable" was used before. I think that standalone "reverse" might be confusing when we allow to reverse the operation in both directions. Best Regards, Petr