From 28ae3ca76fffe35206afaff947283c1dfff7f5e8 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 5 Dec 2017 12:54:15 +0100 Subject: [PATCH] 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. --- driver/others/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/driver/others/init.c b/driver/others/init.c index 5fb032fd5..c1bbdac3f 100644 --- a/driver/others/init.c +++ b/driver/others/init.c @@ -90,9 +90,11 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if defined(BIGNUMA) // max number of nodes as defined in numa.h -// max cpus as defined in sched.h +// max cpus as defined in most sched.h +// cannot use CPU_SETSIZE directly as some +// Linux distributors set it to 4096 #define MAX_NODES 128 -#define MAX_CPUS CPU_SETSIZE +#define MAX_CPUS 1024 #else #define MAX_NODES 16 #define MAX_CPUS 256