Message ID | 20240213210252.050264369@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-64295-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp813459dyb; Tue, 13 Feb 2024 13:17:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYDiP6ZijO5JOGaQ0oTqYomPJpQLBbsR4uTvq+bju5IULIXlyjKKVyWU3goBIg2Oe0G+INY1zUaOqMVteXc9nLBlpq8A== X-Google-Smtp-Source: AGHT+IHn2lOCsX5f5Cc1puc7wFuUTNt6HfDP2g7YREAGL7IUxCOFSfrWzBJwmaU1mk/6zDoqDa29 X-Received: by 2002:aa7:c688:0:b0:561:e912:fd43 with SMTP id n8-20020aa7c688000000b00561e912fd43mr540455edq.18.1707859045187; Tue, 13 Feb 2024 13:17:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707859045; cv=pass; d=google.com; s=arc-20160816; b=0m+aTU83KvnwKnOP/idVxdCm40A+VhakByo09zJlZM+KQBOq/KMnZbyqztldQzxgag SGyEgFo2sqVffYs+4i1d7U1rQvWM3Tqqkiabs8649KjyAeHNi7wCBPiTbliseTP7MTcT iSpcug+wW17gSQrDA3moMsVwG9+9Cs1nbVXUVODV6Wv/ldgHJi5v+O0LejWecyZnxF97 0XCeXP2/YcFoeUGRCKWY53EO65g5g1I0x77wYNoCGQk3r/2yVUfIyHWFGgjmFfz1OfEc PaMgGWCvUuMYGfhbqtheP5T6T/sekPP6JUhoA0J6S9agY9AwLx600ZYUJfh39ODVk8wf jmLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=jUfwyP6RwJ+NG2QZotkyjvNHejpXh2HAb8201sP7et4=; fh=eLpObTosNw2JDqj5qyigZ4BgX5CHsS3zf11XqEx0A+Q=; b=gCDVh+46dONpOryZv6f1ZdiSANxOCI/JSScICywWSCXm5/QZN8t2hTNY3z0jLxVQek PzeaQG5jh8zdhYBnMsz2JcxGnNXa3cfgAbQB6hB/rOlDAY57k9lUy3vBbIzfwqQpR+GK 9iOxMqioLM0X7hzpjXWTh3rddZWN0Yzrt3rvJ8BQkhsFHdRsnniLgA9fkrCFjAzXVjS2 rT1/HsSJXi1MpxwoDsZCHU3toABj7iWtcOapZJGVmP1mN5ib46IwbOaYueKnjYHTxtUa qJGvf7Sbc5ZYHRjhgTtwJf39nBntKhNEwN/tuY1oR9SBM4x52Rg4nsV5/k6af8ddVaEF Yz7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rUnMeu+f; 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-64295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64295-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCXSEvFJka+E1pdlyO+YNw23nQeS6YIqpf+cdZgX3VKRxODJ9ZrGpL02GmtAIL82dokSabjajj9WUQQYRhNGEokgkhNY0Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n29-20020a5099dd000000b00561b93ff5d5si2211594edb.174.2024.02.13.13.17.25 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rUnMeu+f; 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-64295-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64295-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 C995E1F230FE for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 21:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE8657FBCF; Tue, 13 Feb 2024 21:05:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rUnMeu+f"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ScfTmaep" 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 C66507E101 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 21:05:49 +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=1707858351; cv=none; b=s+ezc/zYk4LUrC8x0MlvcR4jJGoEkLzXhXYkA3hMFxyBejOg7qqVzeIlAm5UioP1P8/s9EZZeCBg23g4rCrAG8s02rnXZBoeIhLm31R9Y3H2QrpG9RSr8KYEpX2nGK6dNr+Uc4CBBvuHOG2KVOLKb2gTPt0iIUxoM8c5WBJyDO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858351; c=relaxed/simple; bh=5IeBHR+hi4fg1vQf0hDj/BBesg9OuajUyfYPsFjXYFU=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=u8ifL88kM6CN6ldMq2rR3PvCN9zq20mzmkrVlfpqNVme1vsth65WRkU5W+BOr4d/MFCFjrpiOXCv7brh0b+ZjZ8agIOFqnlixgi241Gtq9KxdAM6148zZkxLCpv0bOdHm+cKv4Ky4eDoTq5LzJ0akovaMEQlQaEEhCNYt0ukdNQ= 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=rUnMeu+f; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ScfTmaep; 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 Message-ID: <20240213210252.050264369@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=jUfwyP6RwJ+NG2QZotkyjvNHejpXh2HAb8201sP7et4=; b=rUnMeu+fJoD6WHPEtzIoDbT+Q7+upy4kbBH0WbmnooP6GGci5od+qh8+N2D7aGHo4cCa++ b5XRpRdDyciTqqHgVnahQb0DPY7L/7oCbrQ/+nQLglT3kG7H7utX10+hE2uMoT9pIiJLnA 2E7tLevqaaTZLN3nZ2rV1YxdlQmCgVAtrGRvv7yq5cObWv+xL0L8nXSX9lh49ajWMP80No nyKihM0crHv3Qu4Sj4jKFzCjrmfE8FJjMF02naREN4towBXXzf732/h1gVAssdKr6GF26/ uflasigfWdwyDmtQn2lsXZiEBCo2OGexAy0Yq4HnCqxdIE5aeG3wJt/etIwdeA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=jUfwyP6RwJ+NG2QZotkyjvNHejpXh2HAb8201sP7et4=; b=ScfTmaepVt/4T1ejBLyvwXVZ/G3LTfMnyRBYEAz1MwLutCpveJtl/dbZkJVaqOMS6djW4W ZsjpJa97acQ2ITCA== From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: x86@kernel.org, Tom Lendacky <thomas.lendacky@amd.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Arjan van de Ven <arjan@linux.intel.com>, Huang Rui <ray.huang@amd.com>, Juergen Gross <jgross@suse.com>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, Sohil Mehta <sohil.mehta@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Kan Liang <kan.liang@linux.intel.com>, Zhang Rui <rui.zhang@intel.com>, "Paul E. McKenney" <paulmck@kernel.org>, Feng Tang <feng.tang@intel.com>, Andy Shevchenko <andy@infradead.org>, Michael Kelley <mhklinux@outlook.com>, "Peter Zijlstra (Intel)" <peterz@infradead.org> Subject: [patch 10/30] x86/cpu/topology: Simplify APIC registration References: <20240213205415.307029033@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 13 Feb 2024 22:05:47 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790820006031630890 X-GMAIL-MSGID: 1790820006031630890 |
Series |
x86/apic: Rework APIC registration
|
|
Commit Message
Thomas Gleixner
Feb. 13, 2024, 9:05 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> Having the same check whether the number of assigned CPUs has reached the nr_cpu_ids limit twice in the same code path is pointless. Repeating the information that CPUs are ignored over and over is also pointless noise. Remove the redundant check and reduce the noise by using a pr_warn_once(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/kernel/cpu/topology.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) ---
--- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -107,14 +107,6 @@ static int allocate_logical_cpuid(u32 ap if (cpu >= 0) return cpu; - /* Allocate a new cpuid. */ - if (nr_logical_cpuids >= nr_cpu_ids) { - WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %u reached. " - "Processor %d/0x%x and the rest are ignored.\n", - nr_cpu_ids, nr_logical_cpuids, apic_id); - return -EINVAL; - } - cpuid_to_apicid[nr_logical_cpuids] = apic_id; return nr_logical_cpuids++; } @@ -135,7 +127,7 @@ static void cpu_update_apic(int cpu, u32 static int generic_processor_info(int apicid) { - int cpu, max = nr_cpu_ids; + int cpu; /* The boot CPU must be set before MADT/MPTABLE parsing happens */ if (cpuid_to_apicid[0] == BAD_APICID) @@ -155,21 +147,12 @@ static int generic_processor_info(int ap } if (num_processors >= nr_cpu_ids) { - int thiscpu = max + disabled_cpus; - - pr_warn("APIC: NR_CPUS/possible_cpus limit of %i reached. " - "Processor %d/0x%x ignored.\n", max, thiscpu, apicid); - + pr_warn_once("APIC: CPU limit of %d reached. Ignoring further CPUs\n", nr_cpu_ids); disabled_cpus++; - return -EINVAL; + return -ENOSPC; } cpu = allocate_logical_cpuid(apicid); - if (cpu < 0) { - disabled_cpus++; - return -EINVAL; - } - cpu_update_apic(cpu, apicid); return cpu; }