On 12.12.23 12:40, Julien Grall wrote:
Hi Juergen,On 12/12/2023 11:09, Juergen Gross wrote:On 12.12.23 11:10, Julien Grall wrote:Hi Juergen, On 12/12/2023 09:47, Juergen Gross wrote:Looking at arch/Kconfig, it looks like we are limiting NR_CPUS to maximum 4096. So can you outline why we need this?Allow 16 bits per cpu number, which is the limit imposed by spinlock_tickets_t. This will allow up to 65535 cpus, while increasing only the size of recursive spinlocks in debug builds from 8 to 12 bytes.The limit of 4096 cpus is dictated by the current limit of the spinlock implementation. So asking "why do we need to support more than 4096 cpus in spinlock_t when the current Xen limit is 4096" is kind of the wrong question. > The correct question would be: why is Xen limited to 4096 cpus? Answer: because of the limit in spinlock_t.I thought there was also some lock contention issue in Xen. Hence why I asked the question because the commit message doesn't really give any clue why we are raising the limit... (This is a hint that it probably needs to be expanded a bit).
Okay, are you fine with the following addition: The current Xen limit of 4095 cpus is imposed by SPINLOCK_CPU_BITS being 12. There are machines available with more cpus than the current Xen limit, so it makes sense to have the possibility to use more cpus. Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature