[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core parking broken with NR_CPUS=1


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Feb 2023 17:56:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uz1B4ZwDYVJs1GUArQztzdg/Oss6AlYDIWpxSyBKX1g=; b=Jkcw1mR0sMId8/16GBBqR426h6cpvHrrKarQouvVvfSUpRkxCwRbApQ77u7SYZ0UzmH67z4RPU/mKLt6FqpzDuzsjQh7ZLx4t7+vpzuxrqSu0KpcbtTIfAOIYSeLFOXiXMqdQkbQBJJN+U+2CMlSGoWijI8E2Hm0fFep3eINtZoGLlfzwz7rnKJBqJoK7hvgAvKkwIsgEc4825EZhFkjotQ7o1LS42vlCrSgmk11zy84fDzX4lbZnHgg/iVVXGxnADug73vGU372XKxRQ0G68oO9gdH5Hjp+nGjrxvNYUbtk8WZRv5zcNKR7mRYHRfgXAhy/rPTtrI0SOULnpGWCIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AbfDcXX66t2PACUS+KViHmjV51EhnlvPSJYInv4EKO3/sebttXKT6A1aSG6WH/zrjCWuOhmJ7KwlHauVhDAMvOPg7UCOS9+60exInOSfCeiGmVw8eSPqaQ5JouPH+yAEBkhaNzl50NvKnT8RXH1+gKO5UK98Aq4hsxKFOmGnJxkfuoJcFfhoUY5TtjQqaqV+T1tUrf476MlhwsR98pCjTGkJPU20LD3yNYbHWPdKbp3R/ihgSiwJo6fCTzInkSxrGbruNie3y004Q+Glux76GEHB1PKhfyVjJc6nAo5bg2E0NniptyZCEqCAlNejQS7EH7nWA6hv/yr6wBcYBxCLNA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Feb 2023 16:57:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.02.2023 17:20, Andrew Cooper wrote:
> On 22/02/2023 4:17 pm, Jan Beulich wrote:
>> On 22.02.2023 17:04, Andrew Cooper wrote:
>>> While testing the rebuilt debian unstable container, I found:
>>>
>>> common/core_parking.c: In function 'core_parking_remove':
>>> common/core_parking.c:230:53: error: array subscript 1 is above array
>>> bounds of 'unsigned int[1]' [-Werror=array-bounds]
>>>   230 |         core_parking_cpunum[i] = core_parking_cpunum[i + 1];
>>>       |                                  ~~~~~~~~~~~~~~~~~~~^~~~~~~
>>> common/core_parking.c:31:21: note: while referencing 'core_parking_cpunum'
>>>    31 | static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ...
>>> NR_CPUS-1] = -1};
>>>       |                     ^~~~~~~~~~~~~~~~~~~
>>>
>>>
>>> which is an legitimate complaint - this logic is simply broken with
>>> NR_CPUS=1.
>>>
>>> In principle, I think the best fix is probably to have CORE_PARKING
>>> depend on NR_CPUS > 1, except none of the interacting x86 code has been
>>> written in a way that would be compatible.
>>>
>>> But it also occurs to me that this is the kind of thing an embedded x86
>>> usecase would want to compile.  Frankly, its niche even on regular x86
>>> use-cases.
>>>
>>> Except having looked at the code, it's a different to the other thing we
>>> call core parking which is the smt=0 logic to keep the stacks valid for
>>> cores/threads we don't want to use, because of #MC broadcast problems -
>>> and this logic does need to stay.
>>>
>>> Thoughts?
>> See "core-parking: fix build with gcc12 and NR_CPUS=1" sent back in September
>> last year.
> 
> I'd clearly missed that thread, but the final part seems to have agreed
> on a NR_CPUS check, with you saying that you'd send a v2 "in a minute".

And so I did:

https://lists.xen.org/archives/html/xen-devel/2022-09/msg00906.html

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.