Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp525779pxv; Thu, 8 Jul 2021 07:58:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFo2xeqoOxR/m3u4HqzHRTHt7U0hbuTUhrRGEHW4KcwQebJy1knoECNIhYTKs8z2W+mBxV X-Received: by 2002:a17:906:58c7:: with SMTP id e7mr28058356ejs.197.1625756320316; Thu, 08 Jul 2021 07:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625756320; cv=none; d=google.com; s=arc-20160816; b=ELNhgfrEp48e/s9SegN6TDUFHRyXuPWo5d6mRMkJjs2DTphNDzxZKkSQLQDEQocBLz 7teFuYXnNsF8hDH421FwRAWa83Ot+qbvkgGLABmDneZpbePbpBqBsypP5QpIP1v3yvrk rVizZHPsx7eWHj6XejqjgdME4eXvjghmijNRl8MzbbbwTlZL50aqWLpAp/1qaavobZG9 dWb47LAsyKr8qJN2IAl8PB6m/onODTaLoeCuCOhreGBntvtrkRITPnR1lFPiEntBdpKm C4agNb6Cw0yWo/E6/ugB4n2zLr1Hp+KdMuwqepu1GI70RhgZp85+0Z05GpLAGH5jpVpb 1ucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d+w+ftWQRSGcaS7USD2rNrsIWh5yIVNwfoY5jSFqupE=; b=i/jaGiTSb46GobkMcHqoeRNX+BSSjU+cR9lAbWtP/lEyo+3u7YPvdeYxaZ38n0mjnx AI92zDH19/LJxbMzoBmaUd/B/pNMRuaRYKSu0jZCAP+siyQ8x+wQlhiU4qu5o/6soGCv QCaHrcuu2j/aLz602V9euR18ZcrKezE4YkyDKUG0FebUGfv+3a5dXomWnAEHlskcnWhk WrV9wUX5R0eukKIbtxRsqhvVxobnLfv6T+XUHdllaJpgML1iISdnA1PlRXNYcFrMiJAw QDR4IgxbiyyyQChAhTQqN6JWwQ1C2bYf0Mjkkuz7Z+z2Hlo7MmQsNISKjzWarCoejWVX qdfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=J876vjgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm10si3110041ejc.298.2021.07.08.07.58.16; Thu, 08 Jul 2021 07:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=J876vjgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbhGHO7r (ORCPT + 99 others); Thu, 8 Jul 2021 10:59:47 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:35670 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbhGHO7q (ORCPT ); Thu, 8 Jul 2021 10:59:46 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BFF27201EA; Thu, 8 Jul 2021 14:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1625756223; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d+w+ftWQRSGcaS7USD2rNrsIWh5yIVNwfoY5jSFqupE=; b=J876vjgxxb1UxT9ci9UL8oQtz1KU3XMqZRhRpNDfal/B+eVett1CrKyXY/FAzPlmWTJMUa h4sYgc/pIOrZ4xKz3MtFMRsjzDMBzKeUFv9P2hXSf+5Yu/uD1A4YDQMXWGK22IlYO+jaeT RZgeXLhXXzQOVXve2CpC3EVHD63i7V0= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A5098A3B87; Thu, 8 Jul 2021 14:57:03 +0000 (UTC) Date: Thu, 8 Jul 2021 16:57:03 +0200 From: Petr Mladek To: Vasily Gorbik Cc: Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , Heiko Carstens , Sven Schnelle , Sumanth Korikkar , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] livepatch: Speed up transition retries Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2021-07-08 15:19:25, Vasily Gorbik wrote: > On Thu, Jul 08, 2021 at 12:35:24PM +0200, Petr Mladek wrote: > > On Wed 2021-07-07 14:49:41, Vasily Gorbik wrote: > > > That's just a racy hack for now for demonstration purposes. > > > > > > For s390 LPAR with 128 cpu this reduces livepatch kselftest run time > > > from > > > real 1m11.837s > > > user 0m0.603s > > > sys 0m10.940s > > > > > > to > > > real 0m14.550s > > > user 0m0.420s > > > sys 0m5.779s > > > > > > Would smth like that be useful for production use cases? > > > Any ideas how to approach that more gracefully? > > > > Honestly, I do not see a real life use case for this, except maybe > > speeding up a test suite. > > > > The livepatch transition is more about reliability than about speed. > > In the real life, a livepatch will be applied only once in a while. > > That's what I thought. Thanks for looking. Dropping this one. If you still wanted to speed up the transition from some reason then an easy win might be to call klp_send_signals() earlier. Well, my view is the following. The primary livepatching task is to fix some broken/vulnerable functionality on a running kernel. It should ideally happen on background and do not affect or slow down the existing work load. klp_send_signals() is not ideal. The fake signal interrupts syscalls and they need to get restarted. Also the function wakes up a lot of tasks and might increase load. Hence, it is used as a last resort that allows to finish the transition in a reasonable time frame. That said, the current timeouts are arbitrary chosen values based rather on a common sense than on some measurement. I could imagine that we could modify them or allow to trigger klp_send_signal() via sysfs when there is a good reason. Best Regards, Petr