Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp383951rwd; Tue, 16 May 2023 02:21:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40vSGgBjFZ8ktKbj7EUeEzQcibGWt+RWO5cQ7ZObY786aBVQN8T12pEmxzgevYkv/OhBTn X-Received: by 2002:a05:6a20:3d8f:b0:102:bee9:ab07 with SMTP id s15-20020a056a203d8f00b00102bee9ab07mr29057305pzi.53.1684228893012; Tue, 16 May 2023 02:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228892; cv=none; d=google.com; s=arc-20160816; b=k3M/bk0o6yqwX9BHgL4sP3BCQSnlIc98FarhSkDrh5aVkDp/4FXWhAzel4qBEj8QLI JlJZb+E1SO5Gn1mKDqqyz8r7csb6WMfywFg5MbqLSP9twS/EhEFL/1kxNEjiOBiCu8yY p4CjwnShCt7pxr3GirVQ2MTqDJ6LlHag6Hgh9yc9Nkb9DzYRbUw/tZnsPfRTiQpBn+UC KHcGLW4JJD2A7tE0zz0vk56JKSQ/Nq+JnUdFhrbrrzqpxpuI53aTM25SBKkFQMJlXwo8 HuzGnUWTHiZPDafK943VGUwLP1tAw6hnvV4VmBlOKKGH1qW6xZiQxRO+qqltaWI+XOJV bydg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=XhbS6Js/pR5XPdMOadQRXi/oWX0jfWyVYx38A9j697Q=; b=lOfcVKisMRjqX+hrwt2eOmT5n3fvkuIbyEmZfWyvO6/0p+cPtuoFXAxZEfEwE7Jmiq lEfOnitk0aVyZRzjiOExr/62Kp5gXQ9ZMS3fuQ0Y+FEp9vYJ7Wic9q0hllmJL9rVoDYR GqXOBuA9VBssN3qYGvFEY57F7BeGmU0JnS8YhjvL5YQkbw9YAgnQKtJrboIaA7qETCnT 44KC+UZDHCY3UYYkN9a6sf22Pg6b/lQl8WkwAUB/KRLUBYHLXT00LQXDiZTUAYnDgNXH 0JtvkayH9kkSMV1v2zxJ6aO2oD6fyewwcf3XTTIWu1wOSydo14gxRWakG3iQUfk+fi/4 2cSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hrpIFZh+; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f199-20020a6238d0000000b0063b8eec0832si18864311pfa.114.2023.05.16.02.21.20; Tue, 16 May 2023 02:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hrpIFZh+; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231863AbjEPJKq (ORCPT + 99 others); Tue, 16 May 2023 05:10:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231782AbjEPJKE (ORCPT ); Tue, 16 May 2023 05:10:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B9649EB; Tue, 16 May 2023 02:10:01 -0700 (PDT) Date: Tue, 16 May 2023 09:09:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228196; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XhbS6Js/pR5XPdMOadQRXi/oWX0jfWyVYx38A9j697Q=; b=hrpIFZh+nbxdbPxfwYTeC+Ge+0FpS79FotRouxKRU3l4E3Bvosf8N9QMpCgstdD3e3k1AT XrsQ7ytgyVE2r80mz65hTHC3lEEm4ohiZ3P9y5BQeYd3MZ5AFlvMzoTpijtZHj5Zam85Ez so4Hvn2DiebBwg6r/QwjsET3Cl3QuS3DIR3hEmLdaV8F1CEsV6nqg1L13wqQIwS7AOfrYw 9WYl9jwi2fPi3e42adpigtpOOxeVIeMdfpNx5jwnpvIdwDnwwzH7gZmh5S32dubHlbGyxV OGHTCD54Ontdf7NEDogEGJG/zCoN4N7YuC1YInf66q4+u+S1T9Caa4WG4FWXlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228196; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XhbS6Js/pR5XPdMOadQRXi/oWX0jfWyVYx38A9j697Q=; b=SfubuBo09wbxMCZDy3FdMSM5O6whZ4RDyKZnM14WUXNt+iaM/2Cbr4228xkZqd8hs5zfTs XXCsMHBW5tP2sjAQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] cpu/hotplug: Remove unused state functions Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205256.972894276@linutronix.de> References: <20230512205256.972894276@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819603.404.16882958545555269439.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the smp/core branch of tip: Commit-ID: bc088f9a0d5bdf12bb18980739336dfcc092e55b Gitweb: https://git.kernel.org/tip/bc088f9a0d5bdf12bb18980739336dfcc092e55b Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:41 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:45:00 +02:00 cpu/hotplug: Remove unused state functions All users converted to the hotplug core mechanism. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.972894276@linutronix.de --- include/linux/cpu.h | 2 +- kernel/smpboot.c | 75 +-------------------------------------------- 2 files changed, 77 deletions(-) diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 68f69e8..d321dbd 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -193,8 +193,6 @@ static inline void play_idle(unsigned long duration_us) } #ifdef CONFIG_HOTPLUG_CPU -bool cpu_wait_death(unsigned int cpu, int seconds); -bool cpu_report_death(void); void cpuhp_report_idle_dead(void); #else static inline void cpuhp_report_idle_dead(void) { } diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 1940f33..f47d8f3 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -325,78 +325,3 @@ void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *plug_thread) cpus_read_unlock(); } EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread); - -#ifndef CONFIG_HOTPLUG_CORE_SYNC -static DEFINE_PER_CPU(atomic_t, cpu_hotplug_state) = ATOMIC_INIT(CPU_POST_DEAD); - -#ifdef CONFIG_HOTPLUG_CPU -/* - * Wait for the specified CPU to exit the idle loop and die. - */ -bool cpu_wait_death(unsigned int cpu, int seconds) -{ - int jf_left = seconds * HZ; - int oldstate; - bool ret = true; - int sleep_jf = 1; - - might_sleep(); - - /* The outgoing CPU will normally get done quite quickly. */ - if (atomic_read(&per_cpu(cpu_hotplug_state, cpu)) == CPU_DEAD) - goto update_state_early; - udelay(5); - - /* But if the outgoing CPU dawdles, wait increasingly long times. */ - while (atomic_read(&per_cpu(cpu_hotplug_state, cpu)) != CPU_DEAD) { - schedule_timeout_uninterruptible(sleep_jf); - jf_left -= sleep_jf; - if (jf_left <= 0) - break; - sleep_jf = DIV_ROUND_UP(sleep_jf * 11, 10); - } -update_state_early: - oldstate = atomic_read(&per_cpu(cpu_hotplug_state, cpu)); -update_state: - if (oldstate == CPU_DEAD) { - /* Outgoing CPU died normally, update state. */ - smp_mb(); /* atomic_read() before update. */ - atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_POST_DEAD); - } else { - /* Outgoing CPU still hasn't died, set state accordingly. */ - if (!atomic_try_cmpxchg(&per_cpu(cpu_hotplug_state, cpu), - &oldstate, CPU_BROKEN)) - goto update_state; - ret = false; - } - return ret; -} - -/* - * Called by the outgoing CPU to report its successful death. Return - * false if this report follows the surviving CPU's timing out. - * - * A separate "CPU_DEAD_FROZEN" is used when the surviving CPU - * timed out. This approach allows architectures to omit calls to - * cpu_check_up_prepare() and cpu_set_state_online() without defeating - * the next cpu_wait_death()'s polling loop. - */ -bool cpu_report_death(void) -{ - int oldstate; - int newstate; - int cpu = smp_processor_id(); - - oldstate = atomic_read(&per_cpu(cpu_hotplug_state, cpu)); - do { - if (oldstate != CPU_BROKEN) - newstate = CPU_DEAD; - else - newstate = CPU_DEAD_FROZEN; - } while (!atomic_try_cmpxchg(&per_cpu(cpu_hotplug_state, cpu), - &oldstate, newstate)); - return newstate == CPU_DEAD; -} - -#endif /* #ifdef CONFIG_HOTPLUG_CPU */ -#endif /* !CONFIG_HOTPLUG_CORE_SYNC */