From patchwork Fri Mar 1 20:48:42 2024 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: 209088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp149500dyc; Fri, 1 Mar 2024 12:58:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVvCLTNEyhA5FLVCVN1mka1PXwbKS/bBKEOwqS/TlR1kQtf6eTN7k29pOv4YclNqIBqX3YgY62e4a9GlRvXUaEvB2CC9Q== X-Google-Smtp-Source: AGHT+IEFm0hSL9TV8MBQv13mjt5asbbRgLLTzVgQgLAMeu3C3RAe2DLV6fdb1b6X3qkatMJcqAmr X-Received: by 2002:a17:906:46d8:b0:a44:2563:d30b with SMTP id k24-20020a17090646d800b00a442563d30bmr2195035ejs.68.1709326691221; Fri, 01 Mar 2024 12:58:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709326691; cv=pass; d=google.com; s=arc-20160816; b=J1Mq4RVDWsZ7bNE5WEMozhsTht60ehNSOIB0O/g2MP6QW3g+yGaIpze2tqxszCn0Ir oblSdZsmAb4G1rzrWLdIN67thnkWCm00W4p40j96p1dpOA5Y1pS5ZaO20AETHd97bU92 FgrT7A9CF1mkCLXsvD1ue+F11bVy53ZvGBmRJyHK3JeZygniuSj91tMtrTYq3WsQfAPV h1Do2/4C+mQysdN6oGSY8n0PPbPuBUfjDRoN6MgtLm8leGtScZzWMGrdluBNDyw0OaV3 bxGSZmlef3WFU5Ifuytn09mr1j3GkzPv0BSc/iSUsjESrY9KcNKaPOOkvl4ecGY+ocdd KbnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=VPt61NgyrrVAT3ev1oj2xf/IZRQk5WLtiQKyFPY39cM=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=DoD8CXOdABmc0+Z8YkHicQ+tm4k68vzRf09q8kksmmomVAu/uWZKrmCB4YcDAN42dH h+2+/RBAKk8ewgNfIfsXMcKJHmEHkIM8OTQRhJZsP9UQknzzjIzO0cgovFdJ8xWBfvsv bzCHR07Yay2NmhC1+dIiAo8HsHuMtk+Dk3zS4BxjCrpRrGOsaW6Iutt3hY+U64GtyTqF UqrzsImYIQpWeS4X4qdwERDEInD+FdYh+kMpCWCGHOE4jsaj39ClFDLCG3orF0Egs3uc qCCja47RRMhpc6GRW3OguFeLNc9jSkhz6AwEQD4Kckwl1xjd0Zk5Fw+dy/K2spBcIDNF P1yg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="elYG/t1N"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-89114-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89114-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g15-20020a170906394f00b00a446b7eacf3si1136512eje.1009.2024.03.01.12.58.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:58:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89114-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="elYG/t1N"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-89114-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89114-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 351181F27133 for ; Fri, 1 Mar 2024 20:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C36856B9F; Fri, 1 Mar 2024 20:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="elYG/t1N"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LemgOSdq" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 207EF537EC; Fri, 1 Mar 2024 20:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709326128; cv=none; b=BsMgfnwIAyn2lVDgIkD9toWf6Daj0xZELdg5LBj4Nv+rhqQqkvQyaPDP1iCoUJ4uW0ks0lnk4cuE2LegbaUvyTBWM0SjCTF3e+VbSlPHa0FgW6nsxR1gKRGJ/E+0zgPu3W/c+OrgYZx4HQnZrTvvfTv2/LggTerpSSz7ejInKz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709326128; c=relaxed/simple; bh=AmmkBhmavhgPhD/NMBu+VsLPjLOw/ch4lurlwmfpego=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=GJ0qWCPJLwZXMJEVbsf/wCJp4uaio15MADIYH2vXOwUh9vhR0JtdhlriNyuYC6VK9U8en6Ic+/zvInRLaHxtNmU6uJQ3LI7SaJHfqGr/tOU4N4H8GryQxSGXj+cYoVk/SuV8+Cn8YZUurXWbb5zrTDdiAOk18/P3upti5objkcY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=elYG/t1N; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LemgOSdq; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Fri, 01 Mar 2024 20:48:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709326123; 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=VPt61NgyrrVAT3ev1oj2xf/IZRQk5WLtiQKyFPY39cM=; b=elYG/t1N2EFRfsPhOjljmn3Dg+M1E0eKrbp6sgAAE8J573iKHsHIn8fhaG2Sk3F5XU9mzF 9i3YwxFaoWW+KQdiq408GYwB0L9tM51rrCJ6ouZTKQfbWbIRgTx0wUX/qPcOaIWcOb0PRY G3Gc99u+aXxvzsmRl/QSgIFTcocoFIgfu+acxt0b9XEz92GmdY5ZGA8Gn/45mxaO70s43G 5L3nJO6THO74hpqwg6h3OUnmInCQjB1mYiymJjRGzmFbeL9vuRc+j1b2Jdq/8n1qnx4IJy gLRQv1NqNaY2LkYfRF8VIlz2SgFg5hBun2CraMU06BG/4PVbyVxrqFguAF8iFQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709326123; 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=VPt61NgyrrVAT3ev1oj2xf/IZRQk5WLtiQKyFPY39cM=; b=LemgOSdqFP7GkvLGKApUd4gHFRCZrBstamgEHYe/64l4Yv/Aj5gPna9mbwep8nblZ3B66W QPcDwEanyV6NKQBA== 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: x86/core] x86/idle: Clean up idle selection Cc: Thomas Gleixner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240229142248.392017685@linutronix.de> References: <20240229142248.392017685@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170932612275.398.5909023853768866399.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792243903191256035 X-GMAIL-MSGID: 1792358944489786394 The following commit has been merged into the x86/core branch of tip: Commit-ID: 18a9f4806dcb33ed7eab93232d13facf5c6e2b70 Gitweb: https://git.kernel.org/tip/18a9f4806dcb33ed7eab93232d13facf5c6e2b70 Author: Thomas Gleixner AuthorDate: Thu, 29 Feb 2024 15:23:38 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 01 Mar 2024 21:33:12 +01:00 x86/idle: Clean up idle selection Clean up the code to make it readable. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20240229142248.392017685@linutronix.de --- arch/x86/kernel/process.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 5853d56..b6512f7 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -910,11 +910,13 @@ static __cpuidle void mwait_idle(void) void select_idle_routine(const struct cpuinfo_x86 *c) { -#ifdef CONFIG_SMP - if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1) - pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n"); -#endif - if (x86_idle_set() || boot_option_idle_override == IDLE_POLL) + if (boot_option_idle_override == IDLE_POLL) { + if (IS_ENABLED(CONFIG_SMP) && smp_num_siblings > 1) + pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n"); + return; + } + + if (x86_idle_set()) return; if (prefer_mwait_c1_over_halt(c)) {