Skip to content

Commit 28ae3ca

Browse files
authored
Limit MAX_CPU to 1024 for now
Some Linux distributions (notably SuSE) have raised CPU_SETSIZE to 4096, apparently disregarding API limitations. From #1348, the highest value to survive array initialization (on a desktop system) is 3232, and 1024 - which is the more usual CPU_SETSIZE limit, was demonstrated to work fine on an actual bignuma system.
1 parent bede1c4 commit 28ae3ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

driver/others/init.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9090

9191
#if defined(BIGNUMA)
9292
// max number of nodes as defined in numa.h
93-
// max cpus as defined in sched.h
93+
// max cpus as defined in most sched.h
94+
// cannot use CPU_SETSIZE directly as some
95+
// Linux distributors set it to 4096
9496
#define MAX_NODES 128
95-
#define MAX_CPUS CPU_SETSIZE
97+
#define MAX_CPUS 1024
9698
#else
9799
#define MAX_NODES 16
98100
#define MAX_CPUS 256

0 commit comments

Comments
 (0)