Re: Serious regression on 6.1.x-stable caused by "bounds: support non-power-of-two CONFIG_NR_CPUS"

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

 



29.04.2024 15:17, Matthew Wilcox пишет:
CONFIG_NR_CPUS=8192

Since you're using a power-of-two, this should have been a no-op.
But bits_per() doesn't work the way I thought it did!

#define bits_per(n)                             \
(                                               \
         __builtin_constant_p(n) ? (             \
                 ((n) == 0 || (n) == 1)          \
                         ? 1 : ilog2(n) + 1      \
         ) :                                     \

CONFIG_NR_CPUS is obviously a constant, and larger than 1, so we end up
calling ilog2(n) + 1.  So we allocate one extra bit.

I should have changed this to
DEFINE(NR_CPUS_BITS, bits_per(CONFIG_NR_CPUS - 1))

Can you test that and report back?  I'll prepare a fix for mainline in
the meantime.
Yes, this fix solved the problem





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux