From patchwork Tue May 16 09:09:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 94570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp284767vqo; Tue, 16 May 2023 02:13:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HB3i6PX6JegO326axBO8A3ywBuebhvpGSehS6IpbbmzAXKqQDc7toQcGwEvS1tVlqS7Rh X-Received: by 2002:a05:6a20:7283:b0:102:dd98:509b with SMTP id o3-20020a056a20728300b00102dd98509bmr28435873pzk.21.1684228435550; Tue, 16 May 2023 02:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228435; cv=none; d=google.com; s=arc-20160816; b=YW5HOItPR5FppXGa2roEhDr4VlzZvZ172HN68D7ZguaNu7kre0o/nEpkMc5JB3epny xBeZq3uTVFPCfbq6KrXfvgw4rLZKp8SoFsS4pLLQaQvf9H3wAXZM9CLPskTKmxKJbiBR gRG711dsDqNvPImn0f+TdQL8NQ2YFdZ3UChlkmUsZ8ow1va7Af7gTro6V+pRvJeWTxYN R9Puoqt7DWQFyFnzl6jlVoDq5+84mLinsWGfv/QkdUJu84SxsD15+9P3GuIDf6Rljv74 P9f029yI8z6elHQ5H2+yFr3J6gdwCAxhB6EM1VbickNjb0cEfvc+kqgvuS5NGfieCfzn ZgKw== 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=qdbvvu6BrxBV7t5evLs0L6TSfLdjo8KI9T2x9+XWKOE=; b=f5ua/XujNQKMLJ8kHqCRrZbW5XzcWy9BWyP34e414ECxfY9leW7uqid72OzA6f6D9g 97P7yhx8saE44g3tOwXef3Lz1oYY5FnMe9fuXxWz6PVJjCJscuexiO2dhW/F2P1Mwu76 A3iPC5hpWtsiW5SZa1FMnTyfMe578ANJ3IQUarvuWfqo4tPE3rZm8XFpXrEy7ICp77ve dhkpWzU7Tzkilh85CKZn4hihi36C58x9gGAYfjF1WYYZTJjenuMISmwODwTcjCmXfffd EOwxzEuZVWnB1jJaN+pMLXusxtKBpzVO/ohoQNEdwzkfBl3m4OjgPar0ylNolxfeahYf siWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CQ1EjrCb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=V+DArtJS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020aa79531000000b00643b4daa91asi19128435pfp.369.2023.05.16.02.13.40; Tue, 16 May 2023 02:13:55 -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=CQ1EjrCb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=V+DArtJS; 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 S231839AbjEPJLY (ORCPT + 99 others); Tue, 16 May 2023 05:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbjEPJKH (ORCPT ); Tue, 16 May 2023 05:10:07 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3834C27; Tue, 16 May 2023 02:10:03 -0700 (PDT) Date: Tue, 16 May 2023 09:09:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228198; 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=qdbvvu6BrxBV7t5evLs0L6TSfLdjo8KI9T2x9+XWKOE=; b=CQ1EjrCbCkebiA6aQbJLYX/Qs+wJtITFvnznb0Y3UfdYLipmN9V8/0t1rUe3C4BSfz7bIU ifvT1qv8hcBxfwh0Uqot0WIqfjkaNqEEqZISiswevbKZ9W7ubge1+C6Si8b9i0WsGw/fVg KJOu0EcTm08i6c09nqAb0uHFK1RtorMTdEyF9kSYZqdmmaS1HY9ZlragNSKljdr7nhqPhW MBHtRNCHaTL4M0MFQdyt9/st5CG7rX1oruqZJM3mhkRW7qxTzXSVUwRm3fpeVpgKx5O+Qy +Pib8jF/rJkveOPpVwxbcHer48HbRYbikBP6ddbxKfriSkjKwkdQ3AFfJ5jGEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228198; 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=qdbvvu6BrxBV7t5evLs0L6TSfLdjo8KI9T2x9+XWKOE=; b=V+DArtJSTytdCe/7gkS2PPQrQpfNRj7PovwSgj6r2m9/GsGdOOmsSPGhLlO8FzYCRUS1UG sEI61gtP0uCmUUDw== 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 cpu_report_state() and related unused cruft 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.582584351@linutronix.de> References: <20230512205256.582584351@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819798.404.4048606373768134100.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765724612122028904?= X-GMAIL-MSGID: =?utf-8?q?1766041516273732025?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 5356297d12d9ee6f70d09485878904bc41bac422 Gitweb: https://git.kernel.org/tip/5356297d12d9ee6f70d09485878904bc41bac422 Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:30 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:56 +02:00 cpu/hotplug: Remove cpu_report_state() and related unused cruft No more users. 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.582584351@linutronix.de --- include/linux/cpu.h | 2 +- kernel/smpboot.c | 90 +-------------------------------------------- 2 files changed, 92 deletions(-) diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 8582a71..68f69e8 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -184,8 +184,6 @@ void arch_cpu_idle_enter(void); void arch_cpu_idle_exit(void); void __noreturn arch_cpu_idle_dead(void); -int cpu_report_state(int cpu); -int cpu_check_up_prepare(int cpu); void cpu_set_state_online(int cpu); void play_idle_precise(u64 duration_ns, u64 latency_ns); diff --git a/kernel/smpboot.c b/kernel/smpboot.c index 3dcfd3f..1940f33 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -329,97 +329,7 @@ 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); -/* - * Called to poll specified CPU's state, for example, when waiting for - * a CPU to come online. - */ -int cpu_report_state(int cpu) -{ - return atomic_read(&per_cpu(cpu_hotplug_state, cpu)); -} - -/* - * If CPU has died properly, set its state to CPU_UP_PREPARE and - * return success. Otherwise, return -EBUSY if the CPU died after - * cpu_wait_death() timed out. And yet otherwise again, return -EAGAIN - * if cpu_wait_death() timed out and the CPU still hasn't gotten around - * to dying. In the latter two cases, the CPU might not be set up - * properly, but it is up to the arch-specific code to decide. - * Finally, -EIO indicates an unanticipated problem. - * - * Note that it is permissible to omit this call entirely, as is - * done in architectures that do no CPU-hotplug error checking. - */ -int cpu_check_up_prepare(int cpu) -{ - if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) { - atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE); - return 0; - } - - switch (atomic_read(&per_cpu(cpu_hotplug_state, cpu))) { - - case CPU_POST_DEAD: - - /* The CPU died properly, so just start it up again. */ - atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE); - return 0; - - case CPU_DEAD_FROZEN: - - /* - * Timeout during CPU death, so let caller know. - * The outgoing CPU completed its processing, but after - * cpu_wait_death() timed out and reported the error. The - * caller is free to proceed, in which case the state - * will be reset properly by cpu_set_state_online(). - * Proceeding despite this -EBUSY return makes sense - * for systems where the outgoing CPUs take themselves - * offline, with no post-death manipulation required from - * a surviving CPU. - */ - return -EBUSY; - - case CPU_BROKEN: - - /* - * The most likely reason we got here is that there was - * a timeout during CPU death, and the outgoing CPU never - * did complete its processing. This could happen on - * a virtualized system if the outgoing VCPU gets preempted - * for more than five seconds, and the user attempts to - * immediately online that same CPU. Trying again later - * might return -EBUSY above, hence -EAGAIN. - */ - return -EAGAIN; - - case CPU_UP_PREPARE: - /* - * Timeout while waiting for the CPU to show up. Allow to try - * again later. - */ - return 0; - - default: - - /* Should not happen. Famous last words. */ - return -EIO; - } -} - -/* - * Mark the specified CPU online. - * - * Note that it is permissible to omit this call entirely, as is - * done in architectures that do no CPU-hotplug error checking. - */ -void cpu_set_state_online(int cpu) -{ - (void)atomic_xchg(&per_cpu(cpu_hotplug_state, cpu), CPU_ONLINE); -} - #ifdef CONFIG_HOTPLUG_CPU - /* * Wait for the specified CPU to exit the idle loop and die. */