Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1245138pxb; Fri, 10 Sep 2021 01:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx46aXKFTExr3usvreZwEaEIWD/ctcTPSBs5hMcgElMWusB2NrcIfAm1wzUXDMEPY455YE X-Received: by 2002:a05:6e02:20c3:: with SMTP id 3mr5575541ilq.139.1631261549579; Fri, 10 Sep 2021 01:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631261549; cv=none; d=google.com; s=arc-20160816; b=oaycTnceY42S8CNqHcBFhGTpblisx55Iu8uD+4kY1HSTRZLdOtId0B9wTuSv/4kBEY NZGarbittKT/z4qwOugHrRZYPbyKvlVX5Jb9+Qx6TCegcB9BYq8MPymKIeFbKr4PrEnD aCyVKHdWkOLCTg3NNdvltvDwqL8TPXen3lP8LysQ1ZPEYYdrNBE1otxI8YYG8sHZVLm8 6Kj5bOyz9QVjJcAEeFwMsdgsU8iP8S3eTFUjzGR6Dgi7WVZ2vsXRn6BlfQN29hwExrsF 3lJ1XDX+Y3b79DDrsy7Lvc3njJ5VbOPpxa4LkvzTBTa2LrcnhqvZ3t57fBtPhstgZsfl MpWA== 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=s3YO21RL5B4bIYQW/pvfgxRmZIFg+04XQ1r4GlVCaHM=; b=YzGde4txIQX1DKQJ3FIMbTa+H1WvlQJXhSPGxPJoRY4sBwhQy+wHhDMfPpusGp+kIZ hIE/dHj65k/8+BcywKFvF9CJ0rPWtkp3K3ehXdmktWW9OELBrkX2tSz7Z6ZWPeQ0PPVz iM3Ao0tXc0rWDr+Tv+wEJ0yMY+8wrJflDD3hGlR489PN6hTCKhmqCfVxtWNAoUBefLbo 84pvHQ9CIfaEu2iZUVvRjK1RvotXMoz6ERyoYUYXoM3nX05bsPsZz7fKw3SeJNfOpV5+ v+5m4MhYoWlGW5I5waybEauW2CxquB9Hp18O7mDIs4AumpvL66MG8oOZSH4im9MXWbbO iMLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Vl6K96n0; 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 o18si4829780jam.60.2021.09.10.01.12.12; Fri, 10 Sep 2021 01:12:29 -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=Vl6K96n0; 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 S231651AbhIJIKM (ORCPT + 99 others); Fri, 10 Sep 2021 04:10:12 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:54960 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbhIJIKL (ORCPT ); Fri, 10 Sep 2021 04:10:11 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id AE3352004C; Fri, 10 Sep 2021 08:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631261339; 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=s3YO21RL5B4bIYQW/pvfgxRmZIFg+04XQ1r4GlVCaHM=; b=Vl6K96n0ceSaujzU8wf4tTVN60AwLJpnN0TiIWN/T8wFljxQ7joXK3xmBEMhcqVn4oCZRk A910UPSOKm37b+4lgiTuGogoZesUuU+oqs9VIM43BKnlCfh7GB7/s4489jlyYsXxsjeaV+ KdwcIe5LhPJL/2kVWxrGSbaPYYj+0gI= 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 91147A3BA2; Fri, 10 Sep 2021 08:08:59 +0000 (UTC) Date: Fri, 10 Sep 2021 10:08:56 +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: Kick idle cpu's tasks to perform transition 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-09-09 10:54:05, Vasily Gorbik wrote: > On Fri, Aug 27, 2021 at 02:54:39PM +0200, Petr Mladek wrote: > > On Wed 2021-07-07 14:49:38, Vasily Gorbik wrote: > > > --- a/kernel/livepatch/transition.c > > > +++ b/kernel/livepatch/transition.c > > > @@ -415,8 +415,11 @@ void klp_try_complete_transition(void) > > > for_each_possible_cpu(cpu) { > > > task = idle_task(cpu); > > > if (cpu_online(cpu)) { > > > - if (!klp_try_switch_task(task)) > > > + if (!klp_try_switch_task(task)) { > > > complete = false; > > > + set_tsk_need_resched(task); > > > > Is this really needed? > > Yes, otherwise the inner idle loop is not left and > klp_update_patch_state() is not reached. Only waking up idle > cpus is not enough. I see. > > Also, please do this in klp_send_signals(). We kick there all other > > tasks that block the transition for too long. > > #define SIGNALS_TIMEOUT 15 > > Hm, kicking the idle threads in klp_send_signals() means extra 15 seconds > delay for every transition in our case and failing kselftests: > > I understand this 15 seconds delay for loaded system and tasks doing real > work is good, Yup. Also normal processes should not stay in the running state for this long. They are typically migrated quickly. But the idle task is special. > but those lazy idle "running" tasks could be kicked right > away with no harm done, right? Fair enough. Best Regards, Petr