[torquedev] [Bug 175] buffer overruns in cpuset.c

bugzilla-daemon at supercluster.org bugzilla-daemon at supercluster.org
Tue Apr 24 18:11:05 MDT 2012


http://www.clusterresources.com/bugzilla/show_bug.cgi?id=175

--- Comment #3 from Martin Siegert <siegert at sfu.ca> 2012-04-24 18:11:05 MDT ---
The problem is more complicated: apparently there exists a 4095 byte limit 
for the kernel VFS.

uv1000:/dev/cpuset/torque/martin # seq -s, 1 1041 | wc
      1       1    4098
uv1000:/dev/cpuset/torque/martin # seq -s, 1 1040 > cpus ; cat cpus
1-1040
uv1000:/dev/cpuset/torque/martin # seq -s, 1 1041 > cpus ; cat cpus
1
uv1000:/dev/cpuset/torque/martin # echo "1-1041" > cpus ; cat cpus
1-1041

Thus, it is not possible to simply increase the string size of cpusbuf,
at least not beyond 4095 which is good for a maximum of only 1040 cpus.
The solution is indicated above: it is possible to write ranges to the
cpus file, instead of writing a comma separated list of cpus.

The attached patch implements such a solution: first sort the list of
cpus, then construct a cpusbuf string that collapse the list of cpus
into ranges as much as possible.

-- 
Configure bugmail: http://www.clusterresources.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the torquedev mailing list