Subject: MAXDSIZ cannot handle values larger than 2^31-1
To: NetBSD amd64 <>
From: Nicolas Joly <>
List: port-amd64
Date: 11/18/2003 14:35:35

I wanted to increase the maximum size limit of processes for the data
segment, on our amd64 machine, up to 2.5GB; but it seems that it
cannot use currently more than 2^31-1 bytes.

I made a custom kernel for that, GENERIC.MP with the following line :

options         MAXDSIZ=2684354560

While cross-compiling the kernel from i386, i noticed that the MAXDSIZ
used value was incorrect:

njoly@hal [NetBSD/src]> ./ -Uu -m amd64 kernel=CALIMERO
#   compile  param.o
/local/src/NetBSD/tool/amd64/bin/x86_64--netbsd-gcc -mcmodel=kernel
-mno-red-zone -ffreestanding -O2 -Werror -Wall -Wno-main
-Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes
-Wstrict-prototypes -Wno-sign-compare -Damd64 -Dx86_64
-I. -I/local/src/NetBSD/src/sys/arch -I/local/src/NetBSD/src/sys
-nostdinc -DLKM -DMAXDSIZ=0x7fffffff -DMAXUSERS=32 -D_KERNEL
-D_KERNEL_OPT -c param.c

Confirmed later with simple limits queries (under zsh) :

njoly@calimero [~]> limit datasize
datasize        128MB
njoly@calimero [~]> unlimit
njoly@calimero [~]> limit datasize
datasize        2047MB

Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.