Hi there,

I had a question about something that produced a really hard-to-track bug.
I've been using my own python bindings against libcgroup for a while now,
and it makes heavy use of setting the cpuset.cpus value to limit logical
cores in transient cgroups.

A bug cropped up where some of our larger hosts were seeing "End of File or
iterator" errors while creating new cgroups. I finally tracked this down to
the following constant:

#define CG_VALUE_MAX 100

The problem is that I had been passing a comma-separated list logical cpu
ids to cpuset.cpus, and once this was happening on machines with 128
logical cpus, it turned out that libcgroup was truncating the string value
being set:

i.e., I pass something like this:
"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63"

And ultimately what libcgroup will set is this:
"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36\x01"

And then error out.

Strangely though, echoing the full string to cpuset.cpus via the filesystem
interface is perfectly supported and works fine. Is this 100 character
limit arbitrary? Is there a reason to prevent larger string values from
being set when it is doesn't seem to be a limit of the filesystem interface?

Obviously I could work around this problem if I took an extra step in
folding the values into a range like:  "0-63", or "0-10,11-20,21-30". But I
found this to be a very unexpected behaviour.

Appreciate your input.

-- justin
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to