controllers/cpuset: removed bash sweetnesses

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset/cpuset_base_ops_test: fix expected error

At least since kernel 3.0.0 writing '0-' to
$CPUSET/N/{cpus, mems} files doesn't raise an error.
Reading content of these files after writing gives '0'.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset/cpuset_syscall_test: fixes

cpuset_syscall_test.c:
I suppose that now there is no need in many '#if' and explicit
definition of functions get_mempolicy, set_mempolicy, mbind.
Including numa.h and numaif.h (as we do in the other testcases)
should be sufficient.

cpuset_syscall_testset.sh:
Since linux kernel 3.8.0 (commit 5606e3877ad8baea42f3a71ebde0a03622bbb551
"mm: numa: Migrate on reference policy") default task memory policy and
its output in /proc/<pid>/numa_maps changed.

For example in 3.7.10 for stack vma /proc/<pid>/numa_maps show:
 7fff81e01000 default stack anon=3 dirty=3 N3=3
but in 3.8.0:
 7fff08950000 prefer:3 stack anon=5 dirty=5 N2=4 N3=1

So modified a check in test 10 and removed unnessesary checks for "default"
memory policy from tests 14, 15, 16.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset/cpuset_lib: cpuinfo.c compiled incorrectly

Because of lack of '#include "config.h"' cpuinfo.c file
was compiled incorrectly (i.e. final lib libcpu_set.a didn't contain
the functions/variables from cpuinfo.c)

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset/cpuset_memory_test: fixes

cpuset_memory_test.c:
 * lack of "config.h"
 * incorrect use of HAVE_LINUX_MEMPOLICY macro
 * modification to make use of sigwaitinfo
 * some cleanup

cpuset_memory_testset.sh:
 * number of cpu and memory nodes are set based on environment
 * we send second SIGUSR1 signal to make the child free its resources
 * setting nr_hugepages to a value of 2 is not sufficient. Because there
   is no guarantee that these hugepages will be allocated on the specified
   node
 * cleanup and several typos are fixed

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset_memory_spread_test: number of nodes and sync

For unification number of nodes is set based on environment.

OS caches were not reliably dropped after execution of 'dd'
on DATAFILE. And since 'dd' was executed in root cpuset the
caches were spread among all available memory nodes. Because on
consecutive reading of DATAFILE in cpuset_mem_hog didn't increase
memory consumption. This situation caused random failures of
the testcase.

In accordance to Documentation/sysctl/vm.txt to reliably drop caches
we should invoke 'sync' before 'echo N > /proc/sys/vm/drop_caches'.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
cpuset/cpuset_load_balance_test: fixes

Fixed lack of '#include "config.h"', perform some cleanup
and set nr_cpus, nr_mems based on environment.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>