From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97478C07E99 for ; Thu, 8 Jul 2021 14:57:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E6526135C for ; Thu, 8 Jul 2021 14:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231983AbhGHO7s (ORCPT ); Thu, 8 Jul 2021 10:59:48 -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