LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2012, 12:41 AM   #1
guanglei
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Rep: Reputation: 0
migrate system process using cpuset failed


Hi,
some system processes are bound to a specific cpu, but when I want to migrate them to a sub cpuset, the echo will give an error of "write error: Invalid argument":

[root@pexserv02 tmp]# numactl --hardware
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3
node 0 size: 16373 MB
node 0 free: 14278 MB
node 1 cpus: 4 5 6 7
node 1 size: 16384 MB
node 1 free: 15231 MB
node distances:
node 0 1
0: 10 21
1: 21 10
[root@pexserv02 tmp]# taskset -c -p 31987
pid 31987's current affinity list: 1
[root@pexserv02 tmp]# pwd
/dev/cpuset/tmp
[root@pexserv02 tmp]# cat cpus
2-3
[root@pexserv02 tmp]# cat mems
0-1
[root@pexserv02 tmp]# echo 31987 > tasks
-bash: echo: write error: Invalid argument
[root@pexserv02 tmp]#

Does anyone know why the migration failed? Thanks
 
Old 02-09-2012, 12:56 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Pretty obvious I would have thought. The only CPU that the task has affinity to isn't in the subset.
Change its affinity mapping first.
 
Old 02-09-2012, 01:47 AM   #3
guanglei
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Pretty obvious I would have thought. The only CPU that the task has affinity to isn't in the subset.
Change its affinity mapping first.
But when I tried to migrate a process to a cpuset which is the subset of its current cpu list, it still failed:

[root@pexserv02 tmp]# cat /dev/cpuset/cpus
0-7
[root@pexserv02 tmp]# grep "\<25\>" /dev/cpuset/tasks
25
[root@pexserv02 tmp]# taskset -pc 25
pid 25's current affinity list: 7
[root@pexserv02 tmp]# cat /dev/cpuset/tmp/cpus
1-2,5-7
[root@pexserv02 tmp]# echo 25 > /dev/cpuset/tmp/tasks
-bash: echo: write error: Invalid argument
[root@pexserv02 tmp]#
 
Old 02-09-2012, 03:26 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
What system/kernel level are you using - and what cpusets doco ?.

cpusets is deprecated, and I haven't used it in years - cgroups is the current implementation (current cpusets gets mapped to cgroups). Maybe you're hitting a compatibility snag. I always follow the cgroups doco and mount at /sys.
However it is also true that I don't have (never had) access to NUMA equipment to test.
 
Old 02-09-2012, 08:18 AM   #5
guanglei
LQ Newbie
 
Registered: Jan 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
What system/kernel level are you using - and what cpusets doco ?.

cpusets is deprecated, and I haven't used it in years - cgroups is the current implementation (current cpusets gets mapped to cgroups). Maybe you're hitting a compatibility snag. I always follow the cgroups doco and mount at /sys.
However it is also true that I don't have (never had) access to NUMA equipment to test.
Thanks for your reply. I am using RHEL6, and kerenl version is 2.6.32-71.el6.x86_64.
I am not aware that cpuset is deprecated. I will try cgroups.
 
  


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
how to migrate an existing system with RHEL5 OS to RAID1 (problem with '/dev/root' ) cdriba Linux - Newbie 1 03-09-2011 01:21 AM
How to migrate from suse linux to Exchange- mail system parkarnoor Linux - Server 1 04-27-2010 06:38 PM
Compile kernel, migrate to target system Irving Linux - General 2 06-20-2006 06:27 PM
migrate from suse, what should i migrate to? any suggestions?:twocents: Siljrath Linux - General 4 12-26-2005 01:14 PM
Migrate System ICH7R from PATA to SATA. Cidi Rome Debian 3 12-23-2005 03:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration