LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 07-21-2012, 02:29 PM   #1
avinash82
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Cannot move certain kernel threads from root cgroup


Hi,

I created a "cpu" cgroup:
mkdir /dev/cgroup
mkdir /dev/cgroup/cpu
mount -t cgroup -o cpu cpu /dev/cgroup/cpu
cd /dev/cgroup/cpu/
mkdir low

Now, I try to move tasks to the sub-cgroup "low":
for task in `cat /dev/cgroup/cpu/tasks`; do /bin/echo $task > /dev/cgroup/cpu/low/tasks || echo "Failed to move PID $task"; done

/bin/echo: write error: Invalid argument
Failed to move PID 3
/bin/echo: write error: Invalid argument
Failed to move PID 4
/bin/echo: write error: Invalid argument
Failed to move PID 5
/bin/echo: write error: Invalid argument
Failed to move PID 6
/bin/echo: write error: Invalid argument
Failed to move PID 7
/bin/echo: write error: Invalid argument
Failed to move PID 8
/bin/echo: write error: Invalid argument
.
.
.
/bin/echo: write error: Invalid argument
Failed to move PID 58

I was able to move the "init" process itself. However, I failed to move specific kernel threads:

root 3 2 0 18:16 ? 00:00:00 [migration/0]
root 4 2 0 18:16 ? 00:00:00 [sirq-high/0]
root 5 2 0 18:16 ? 00:00:04 [sirq-timer/0]
root 6 2 0 18:16 ? 00:00:00 [sirq-net-tx/0]
root 7 2 0 18:16 ? 00:00:00 [sirq-net-rx/0]
root 8 2 0 18:16 ? 00:00:00 [sirq-block/0]
root 9 2 0 18:16 ? 00:00:00 [sirq-block-iopo]
root 10 2 0 18:16 ? 00:00:00 [sirq-tasklet/0]
root 11 2 0 18:16 ? 00:00:00 [sirq-sched/0]
root 12 2 0 18:16 ? 00:00:00 [sirq-hrtimer/0]
root 13 2 0 18:16 ? 00:00:04 [sirq-rcu/0]
root 14 2 0 18:16 ? 00:00:00 [watchdog/0]
root 15 2 0 18:16 ? 00:00:00 [desched/0]
root 16 2 0 18:16 ? 00:00:00 [migration/1]
root 17 2 0 18:16 ? 00:00:00 [sirq-high/1]
root 18 2 0 18:16 ? 00:00:03 [sirq-timer/1]
root 19 2 0 18:16 ? 00:00:00 [sirq-net-tx/1]
root 20 2 0 18:16 ? 00:00:00 [sirq-net-rx/1]
root 21 2 0 18:16 ? 00:00:00 [sirq-block/1]


Is there something special about these threads that prevents them from being moved to a different cgroup? Is there something I am missing?

Thanks!
Avi.
 
Old 07-24-2012, 04:29 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,401

Rep: Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120Reputation: 1120
You can't do squat with a kernel thread!

A kernel thread is part of the kernel. (Duh.) It is "a Godly Immortal, not of this Mortal Realm, with doth but deign to appear in the presence of Men." This mechanism exists merely for the convenience of The Masters of This Universe, who have found it convenient to take upon themselves "a robe of flesh" that they may, for instance, execute I/O operations and wait for those to be completed, without inventing an entirely new metaphor by which to do so.

Ye may glimpse these immortal beings as they flash to-and-fro among ye, but ye may not touch them.

Last edited by sundialsvcs; 07-24-2012 at 04:32 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can processes/threads move between cores? DavidA Programming 4 08-09-2011 10:10 AM
Alternative to 200 lines kernel patch, /sys/fs/cgroup/cpu missing Linux.tar.gz Slackware 27 11-29-2010 09:40 AM
On NFS, non-root users can move/rename files belonging to root. Stuart Morrow Linux - Server 2 11-05-2007 11:12 AM
Move own threads to a different forum dukeinlondon LQ Suggestions & Feedback 5 08-31-2006 05:35 AM


All times are GMT -5. The time now is 01:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration