Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp763723pxb; Wed, 29 Sep 2021 09:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxANYfAi/nz2AmPOzJkuhwgTyDjg6Me6xGqDnhkWGqBcW6N14yXQldNB1nSYeInsEuQ4Uy/ X-Received: by 2002:a63:cf41:: with SMTP id b1mr628958pgj.407.1632931891240; Wed, 29 Sep 2021 09:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632931891; cv=none; d=google.com; s=arc-20160816; b=pCOzi6jY8FwuT9KnDcZ3GZ8uC7BvjzSNm7OQVqW7f568YCR7AXvGhDFr0taYj5eIyI ZYyfU2Jg9l1uKDMNU79uJMbmEnzF0/TfgN3r6HlD3gcIz8aYu27gsNb4j42P2GBc4XBt yLqOtGtvnUojMz0oOEOjzAsgxUAspambzAAkNY85C9r2LOTXMStHFeALeBovqREzZ6ns dV9ejbLNTPN1wCYAOQ6vBg6ETrGAujqC+TE1wsv64cly3A7x9kEj2EwdI4PKV0/FtiAn ugFhMTymG9clzmeMA+dpyXEvqGYAs9pjCqgxOM3FRCtalnXdBYRWL6I6207TQR2hOc+5 YCqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id:dkim-signature; bh=H1cuga11mvZk+h9olL/e15hBNLlFvhKrZGWUXQh2rrU=; b=J1ZM9nSY9mHdceiuLu2hQCNAi71ZsaDp+YRWYgEC8aDkTB16+K3jTNPW7uo6zRZ88m bg4ban7D0R4lvGzV6RJxG6xSbOxx+hdOB216lUiPNMvmhlZ1kIF8euOiJ5RCRjbtOjMd WCQVACAuRsgbrIgigNtMYB4AypGiVNOpaTgQ9ELIVTgGHp9uTSlclWGetrZ21PnKBYwb NX2Fp4qoEEisAjQfyoae1gx7rOoCSThQUbDsGY5fWjpbjE38C5JxVbjx7Bvt4NwUardk APabYW5ERGREPzBh62Y/rpLr+iRuPN5vcexoq8wtPn0tdKpAJ7NrlKDcuzOHfxECqJu2 dALg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KONycvIf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si211837pfy.345.2021.09.29.09.11.17; Wed, 29 Sep 2021 09:11:31 -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=@infradead.org header.s=casper.20170209 header.b=KONycvIf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345394AbhI2QKI (ORCPT + 99 others); Wed, 29 Sep 2021 12:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344649AbhI2QJ5 (ORCPT ); Wed, 29 Sep 2021 12:09:57 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F141C0613E4; Wed, 29 Sep 2021 09:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=H1cuga11mvZk+h9olL/e15hBNLlFvhKrZGWUXQh2rrU=; b=KONycvIffex9Rz1f5r3Qt2sSnb EXXpXIrEWJ4gKJg5V2l2DRW3JFsU39NE7hBsh6bouQngBLOyVm6Te70bO43G4Etzpy34Jj95MiiKf ryPagaL/fsTqRfunYsbZj/1d+0W22xK+lyf69YAlOGZ4dOqw/jgv0x6o8Gz4wSc47C1NGa4XjMGmR Gmpfau51PaCJ/HvjwmQF8QRFenytx1qKh+K5VVuLlOgoASn58upU+IQ+0kjlQ6sYiYY4zBtiGTTmw d8aMbU3ETZvP0Eq+4+Q8W9OjSyfZgUWUUGQYUWHRFSiUkWTFxqXJCWh2E06xttFSWazCm30ZsADAT HYzOGp+g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVbxj-00Bz4Q-BG; Wed, 29 Sep 2021 15:57:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CF627302A13; Wed, 29 Sep 2021 17:57:37 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 2F4FD2C78F4FE; Wed, 29 Sep 2021 17:57:37 +0200 (CEST) Message-ID: <20210929152428.828064133@infradead.org> User-Agent: quilt/0.66 Date: Wed, 29 Sep 2021 17:17:28 +0200 From: Peter Zijlstra To: gor@linux.ibm.com, jpoimboe@redhat.com, jikos@kernel.org, mbenes@suse.cz, pmladek@suse.com, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, joe.lawrence@redhat.com, fweisbec@gmail.com, tglx@linutronix.de, hca@linux.ibm.com, svens@linux.ibm.com, sumanthk@linux.ibm.com, live-patching@vger.kernel.org, paulmck@kernel.org, rostedt@goodmis.org, x86@kernel.org Subject: [PATCH v2 05/11] sched,livepatch: Use wake_up_if_idle() References: <20210929151723.162004989@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure to prod idle CPUs so they call klp_update_patch_state(). Signed-off-by: Peter Zijlstra (Intel) --- kernel/livepatch/transition.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -413,8 +413,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; + /* Make idle task go through the main loop. */ + wake_up_if_idle(cpu); + } } else if (task->patch_state != klp_target_state) { /* offline idle tasks can be switched immediately */ clear_tsk_thread_flag(task, TIF_PATCH_PENDING);