Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04B43CD6E55 for ; Wed, 3 Jun 2026 13:06:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1326263.1591803 (Exim 4.92) (envelope-from ) id 1wUlJ0-0002KH-9o; Wed, 03 Jun 2026 13:06:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1326263.1591803; Wed, 03 Jun 2026 13:06:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUlJ0-0002J1-3r; Wed, 03 Jun 2026 13:06:46 +0000 Received: by outflank-mailman (input) for mailman id 1326263; Wed, 03 Jun 2026 13:06:44 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wUlIy-0001rX-7y for xen-devel@lists.xenproject.org; Wed, 03 Jun 2026 13:06:44 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wUlIx-00C2Yc-Jg for xen-devel@lists.xenproject.org; Wed, 03 Jun 2026 15:06:43 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a2026db-2eae-0a2a0a5409dd-0a2a450bb19a-20 for ; Wed, 03 Jun 2026 15:06:43 +0200 Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a2026e3-212f-0a2a450b0019-d155dd36b45b-3 for ; Wed, 03 Jun 2026 15:06:43 +0200 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-45fd461e4a5so3260943f8f.0 for ; Wed, 03 Jun 2026 06:06:43 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f34413csm7284992f8f.21.2026.06.03.06.06.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2026 06:06:41 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1780492003; x=1781096803; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=1MJA+2NbmVQKXujYvUSkt1kO/HT1VLx1sANxeZf3v3c=; b=JxkLkfnvw+1/i9VyC1p7onOV41uNFnLzc0mfOXCUDLBs0VC+o2zRSrCSGrICiD6mFj dhiAji6pTaF1fOJp+kTXbRPw0MwNJwvkiMiC4EdwR21yZzG620b/RoUZ3fL4DTW4fxDa 8XYLfz3oaFThFbk9E5ojsL//ExVnb6peSmbhTaMkMQY/IYMBa2IcHYM7xGYCRsqeqS4d +UgPZJUC8hehMIA1Uc5ujVyr0Nxotwb0J1aRrfoptVQ1cGlorhTs8DHw2rzcNPeLpgik lgNlhWMro/tpcQ3NqeWSFQb/KQ9nYfKVxFkPtc2a2pv2y7uFQ4QtFJ69YEjaJ8ingmBL 3uog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780492003; x=1781096803; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1MJA+2NbmVQKXujYvUSkt1kO/HT1VLx1sANxeZf3v3c=; b=By9hBXb95MPFpG+uBf2k1+XA7bTSoDwf/1L7B6ByID/91utR5V+XNakZVoncxGfinb peH+RG+VzjiV0+mCWRKJ1Go8jxswqAO+tu2ZS+9gArddZsGI3oi1ln0ZQdvj2wgwri18 cSb4oPXV2u+WPg6dRRJARpsWfIkpVuKqa+n86nNnF2dl5fIc3/FPTIHI2z8poQU5Iu77 37peMpkLDBPxSQxLFiGJBclYAjUGeGL1mUy7RMcw+ocvPLTzApnBIDfdXgrkYnSpJKwI BXTz2tX19P91zkDYcmFSOcooLhK8MNRPrzJa7zjCO/qJrggHHa58jsYUQn0Ui/NickTV A9Ew== X-Forwarded-Encrypted: i=1; AFNElJ/vJn1QgINfj/HxB/TOMJwVgwiwUCwmYbXKBGcqKy+t7co74WGJUtR36u1s0rekDLs/POIHAXkvYCk=@lists.xenproject.org X-Gm-Message-State: AOJu0YwOEOKY1AxDO73Sn6yJgdgm2QNZI4iErAvlvl0of48ANP4sKVFo BmTwhz7sq7tpXBq766NBx72awcB5G3G5ud/7ODZuylTmbV8+xuJR1+cqBEnGAQUaMw== X-Gm-Gg: Acq92OHexQj4LEUIrCZjvd1sawVJzyHP3Obnq47xwSV8qFWrNtM97OgCs5M1gELoKsn S7hr+87YnJ0UNOcO/w7XQREGCDS2deDybh11B584MEf/cKxGeCfMwZXo580+RDIAjooPyEVTLWX 7ybI0vWzNH7X1HnufMclJOga4Zur0GuAmhUs/uiIt1FAPcOEItZLc9sC20n8wjGFpFP2vdgiykf u20ZymdOtNEREgzbF5plblQbDuJMF5TZA9XzYW8aeHgLEbaVoH+CWiu7OzvbmGb/2sDxQ8NUrQo WkOi0PGDVQY3knCngIKIQ6J7Bqc5533avfTIZ1dW1QUcrxVLJmKeBqDe+S9pUe/HzNvK7o+UtDu E9TvcHBdkksP5+F4iGXNahAKRXAaIaTF/AOPET54rC30W4fVYk/D0XMhFcPFWMgMWWdDQ/1dPYC trxRg1VwagiVW10qh2TFI532UTi08Haxkowd7EPogsSmXW+OwdpTFnxJ/HSEB2HWc1U0mgMUqsW GgSXlEDC8ieDYNJZbJF7/BQ4w== X-Received: by 2002:a05:600c:1d86:b0:48a:9428:5522 with SMTP id 5b1f17b1804b1-490b60de617mr51873705e9.16.1780492002716; Wed, 03 Jun 2026 06:06:42 -0700 (PDT) Message-ID: <4d52e642-c235-477b-92f8-f8d3af6db23e@suse.com> Date: Wed, 3 Jun 2026 15:06:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 07/24] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration To: Hirokazu Takahashi Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "xen-devel@lists.xenproject.org" References: <20260531224755.9481-1-taka@valinux.co.jp> <20260531224755.9481-8-taka@valinux.co.jp> <7040c58f-2d4c-48f2-854f-c874efdcefbd@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7s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EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-purgate-ID: tlsNG-42698a/1780492003-1BF7EF3B-195F1061/0/0 X-purgate-type: clean X-purgate-size: 1816 On 03.06.2026 15:01, Hirokazu Takahashi wrote: > Hello, > >>>> + >>>> +#ifdef CONFIG_DT_CPU_TOPOLOGY >>>> +extern struct cpu_topology cpu_topology[NR_CPUS]; >>> >>> If at all possible, no new NR_CPUS dimensioned arrays please. >> >> This is also part of the code imported from Linux kernel 7.0, which is used to >> store >> unique topology data per CPU. >> >> I kept it as an array to match the original Linux source, but I understand the >> concern >> about adding new NR_CPUS dimensioned arrays in Xen. I can refactor it to use >> Xen's >> per-CPU infrastructure instead. > > Just a quick follow-up to my previous email: > > While I was looking into moving the topology data to a per-CPU variable, > I remembered the ongoing effort by the team working on CPU hotplug. > > This introduces a dilemma: during the early boot phase when we parse > the Device Tree topology, the per-CPU areas for CPUs that are not yet active > (or yet to be hotplugged) have not been allocated yet. Therefore, we wouldn't > have a place to record the topology information for those inactive CPUs > at boot time. > > Should we have the hotplug team parse the Device Tree topology information > on-demand when a CPU is hot-plugged? > > Currently, the functions used to read the topology from the Device Tree are > marked with '__init'. Removing '__init' to keep these functions resident in > memory feels like a waste of memory. Indeed. > What do you think would be the best approach here? Can you know early enough how many CPUs there are going to be? If so, allocate the array just at the size needed. Next best option may be to have a NR_CPUS-dimensioned array in .init.data, for the used part then to be moved to a dynamically allocated, generally much smaller one. Jan