On 2015/1/26 23:22, Cyril Hrubis wrote: > Hi! >> For kernel commit c4c27fbdda4e8ba87806c415b6d15266b07bce4b, >> disallow attaching kthreadd or PF_THREAD_BOUND threads to cgroups. >> >> So, we kindly avoid to attach these threads in cgroup tests. > > What happens when we try that out? Can you include the error message (if > any)? > >> Signed-off-by: Li Jinyue <lijin...@huawei.com> >> --- >> testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh >> b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh >> index 30476bd..30fffb6 100755 >> --- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh >> +++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh >> @@ -186,6 +186,16 @@ case $attach_operation in >> do >> cur_pid=`sed -n "$i""p" $TMPFILE` >> if [ -e /proc/$cur_pid/ ];then >> + #For kernel 3.4.0 and higher,kernel disallow attaching >> kthreadd or >> + #PF_THREAD_BOUND threads to cgroups. >> + #kernel commit: c4c27fbdda4e8ba87806c415b6d15266b07bce4b >> + tst_kvercmp 3 4 0 >> + if [ $? -ne 0 ]; then >> + thread_flag=`cat /proc/$cur_pid/stat | awk >> '{print $9}'` > > Why not just thread_flag=$(awk '{print $9}'/proc/$cur_pid/stat) ? > >> + if [ $cur_pid -eq 2 -o >> $((${thread_flag}&0x04000000)) -eq 67108864 ];then > > So you are relying on fact that kthreadadd pid is 2. Is that specified > somewhere? I doubt that this will hold forever. > > Also the magical constant 67108864 is very cryptic, what about using > -ne 0 instead -eq 67108864? > Hi, Thanks for the suggestions! I'll attach the error message and post a new one.
Regards, Li Jinyue lijin...@huawei.com ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list