taskset
john doe
io.sys.c at gmail.com
Mon Aug 23 18:04:06 UTC 2010
Hi,
we are trying to bind all processes to one core. We have good reason to do
so, note this for a special purpose, we are aware that for normal usage this
is not recommended.
We tried 2 different ways:
First approach is to bind the proces with pid 1 to one core at startup.
Since all child-processes are also bound this should result in all processes
running on one core. To do so, we added the following 2 lines to
/etc/init.d/rcS:
/usr/bin/taskset -p 1 1
/usr/bin/taskset -p 1 $$
According to boot.log both pids changed as desired. Thought when checking
processes after boot with top or htop, it occured that not all processes are
bound to one core. We had more the impression there was no affect at all.
Second we tried bind all processes at runtime to one core. Since all
child-processes will also be bound, this should work as well. We simply did
as root:
for i in {1..4500}; do sudo taskset -p 1 $i ; done
It turns out that some processes affinity cannot be changed, those are:
[migration/1], [ksoftirqd/1], [watchdog/1], [events/1], [kintegrityd/1],
[kblockd/1], [ata/1], , [aio/1], [crypto/1], [kmpathd/1], [kondemand/1],
[kconservative/1], [ext4-dio-unwrit]. Furthermore several other processes
seem to ignore their afinity. Top an htop show them running on seemingly
random cores.
The first approach seems much cleaner to us and it seems that it is common
approach for this kind of purpose:
http://www.linuxjournal.com/article/6799
http://forums.debian.net/viewtopic.php?f=10&t=54448
We are not sure what the problem here is. Any help is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100823/a47b0187/attachment.html>
More information about the ubuntu-users
mailing list