From: Cyril Hrubis <chrubis@suse.cz>
To: Li Jinyue <lijinyue@huawei.com>
Cc: ltp-list@lists.sourceforge.net, dingguofu@huawei.com,
zhanyongming@huawei.com
Subject: Re: [LTP] [PATCH] controllers: disallow attaching kthreadd or PF_THREAD_BOUND threads to cgroups on kernel > 3.4.0
Date: Mon, 26 Jan 2015 16:22:34 +0100 [thread overview]
Message-ID: <20150126152234.GA27890@rei.suse.de> (raw)
In-Reply-To: <1421656612-15165-1-git-send-email-lijinyue@huawei.com>
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 <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}'`
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?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
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
next prev parent reply other threads:[~2015-01-26 15:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150126152234.GA27890@rei.suse.de \
--to=chrubis@suse.cz \
--cc=dingguofu@huawei.com \
--cc=lijinyue@huawei.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=zhanyongming@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox