Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp232952lqt; Thu, 18 Apr 2024 13:26:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsv4WP9Y+arKiv4RJZ9HijSN5SVsMwqNMrOKUtOHehOg+HIosuUWCS1uJkfh6esGXMrDmrsqTZOhz8mga/yRNei5vTyepV4taKOL9TMg== X-Google-Smtp-Source: AGHT+IE1ykZYjpz4qSO2PvKypztCYt+KaH3gFV+Ps3KiNxfSVD0mQLqsJREy90UE+6omLmYU2D7Q X-Received: by 2002:a05:620a:4ac5:b0:78a:3d2a:e0c with SMTP id sq5-20020a05620a4ac500b0078a3d2a0e0cmr250381qkn.8.1713471968626; Thu, 18 Apr 2024 13:26:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713471968; cv=pass; d=google.com; s=arc-20160816; b=UeiF7ZxQ7PJBoyV+a3kfSA34es0UUCVzYqdyy28Oa8H0xQDthrQNkOMfmKxipzKzho 5zxvi4BNROYwERJ+9b7t/3l8aXZI9mNjJ4zN2UPb1Pzi0r0bNZed2hik67+2n81vCMCZ o/bmG3/UvVyNpXbqe20kZboyuY+TW55JU50CrfsCiGm2lc0VTBTQBXndPf9PS8n2TFuS s4KoCjklpD9o6a3lzm0AQHTefHVTvdeA4KDSRzqxiAhZRX9dEYTw2JTzejpK3uapztvh 4+RSvAcnPEXSOdFXtjJW9p/lNXS9nXBu1qpPI75IfzqxW9zGcb9LztrdQpAo3sJ6p3e4 ym6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ZbEq+9jUJUFh8JLPxclVC7az53DkdvmlPfzrraaJ4Dc=; fh=FOhnaL9fupBZ9pOG+0oUwhD+MHtZHf9JzkGYIL/uhBo=; b=K5T0geNBzGPS/wYSPaPhzR0TqRh4jiWXiwueSE+FXYnmbTjbDSsoYGjT7SJdTqM14P iKBK2BYDj1lXllhmSF1H5uodJX4/vmtm+t0jiMND9iqkmbY085WiJZvevOLIFKztuaz0 MZU1HQUFG6YCgITZ14P9OyOXlijOTBL+Eb/U/Vt4TcIGMC5bby5/Sm35Lj0oxHbsYKp5 hhT5ai0GPeGhZXj3mtSTWEizWU1NHrE2zYnmgmbFPq2N/ImxI4hPEVfUq+fOaaP5r32v mxXcyJaFYaM2CY2dw5+O1rTg3yQYXiGAIsGAJGe6fYJ2t/YKPH4/scIkXrYRcXCUCY1A r7VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="06hsNJH/"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-150743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150743-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vu21-20020a05620a561500b0078d747da301si2235107qkn.163.2024.04.18.13.26.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="06hsNJH/"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-150743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150743-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5F0561C20FE0 for ; Thu, 18 Apr 2024 20:26:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31CC21836CB; Thu, 18 Apr 2024 20:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="06hsNJH/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 594EF2F30 for ; Thu, 18 Apr 2024 20:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713471962; cv=none; b=saA3+cYx4uM6Ly3sQGn6HlFV11rmvc8RxO2BYk87PC1hQoqDgJ5tjbL6qYQEuonQ0suAWAJewhShKOkpUNcDlhA0FKMsKqfdcCxxPxJJ03LXBXU+TBr9My4pdONwx25siIFKRUNHoqGpSJUUsMaQB/bgw/FM4LAOUl7sXrUbBoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713471962; c=relaxed/simple; bh=PCvEAVXvgM6u371jplSGRmq+8CDhW77O6b83jGw9Zy4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=DMAbekO7QBZx0VXTZLM05gLCoxzgyv1+a3rxJgrbuLY+u5a0s7P7P/KRpEm89vwhiHXzLt1/kZE88XWEsRtR2gu7cOyPZy9lKM7avZ/0u82jRTvfVSo0QjSq+u2aIMmpR8WKfZ59uG2dBb7uJ/iWXZuA6bgCUGLr/yIhXDkNrxM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=06hsNJH/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9158FC113CC; Thu, 18 Apr 2024 20:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1713471961; bh=PCvEAVXvgM6u371jplSGRmq+8CDhW77O6b83jGw9Zy4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=06hsNJH/gAWkXBp+LDoqehpGxJ+z/bIkR2RDaAaQXkGcfa8njuA90MVWViHHFU2pM ik50i12nj1g2jqhY5R1tV0c7nXntJZQXcUOMyReyObunDFJx6BxtfVAgpHK+EC7msh eHNwNzCqVtQobclwTX7b/4n+bMowJyvL+Sz79LnI= Date: Thu, 18 Apr 2024 13:26:00 -0700 From: Andrew Morton To: Alexey Dobriyan Cc: tglx@linutronix.de, peterz@infradead.org, yury.norov@gmail.com, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpu: memoise number of possible cpus Message-Id: <20240418132600.ffbf4d53b39eaaeaffc28198@linux-foundation.org> In-Reply-To: <20240418041927.3903-1-adobriyan@gmail.com> References: <20240418041927.3903-1-adobriyan@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 18 Apr 2024 07:19:27 +0300 Alexey Dobriyan wrote: > cpu_possible_mask is fixed after boot, so it makes sense > to calculate number of possible cpus to > a) make num_possible_cpus() faster (distros ship with _large_ NR_CPUS), > b) unscrew codegen elsewhere replacing function call > with simple memory load. There are a lot of calls to set_cpu_possible(). Perhaps calculating num_possible_cpus within there would reduce risk of things getting out of sync, either now or in the future. reset_cpu_possible_mask() appears to have no callers. Kill?