public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] controllers: disallow attaching kthreadd or PF_THREAD_BOUND threads to cgroups on kernel > 3.4.0
@ 2015-01-19  8:36 Li Jinyue
  2015-01-26 15:22 ` Cyril Hrubis
  2015-01-28  8:23 ` [LTP] [PATCH] controllers: disallow attaching kthreadd or PF_THREAD_BOUND threads " Wanlong Gao
  0 siblings, 2 replies; 7+ messages in thread
From: Li Jinyue @ 2015-01-19  8:36 UTC (permalink / raw)
  To: ltp-list; +Cc: dingguofu, zhanyongming

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.

Signed-off-by: Li Jinyue <lijinyue@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}'`
+				if [ $cur_pid -eq 2 -o $((${thread_flag}&0x04000000)) -eq 67108864 ];then
+					continue
+				fi
+			fi
 			do_echo 1 1 "$cur_pid" /dev/cgroup/subgroup_1/tasks
 		fi
 	done
-- 
1.8.2.2


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-29 11:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19  8:36 [LTP] [PATCH] controllers: disallow attaching kthreadd or PF_THREAD_BOUND threads to cgroups on kernel > 3.4.0 Li Jinyue
2015-01-26 15:22 ` Cyril Hrubis
     [not found]   ` <54C9DCBE.9010609@huawei.com>
2015-01-29 11:35     ` [LTP] [PATCH v3] controllers: disallow attaching kthreadd or threads with flag 0x04000000 " Cyril Hrubis
2015-01-28  8:23 ` [LTP] [PATCH] controllers: disallow attaching kthreadd or PF_THREAD_BOUND threads " Wanlong Gao
2015-01-28  8:49   ` Lijinyue
2015-01-28  9:07     ` Wanlong Gao
2015-01-28  9:28       ` Lijinyue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox