Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is a most convenient way to set affinity mask for init process in linux (debian) on the startup the system?

I know about taskset, but i want set affinity mask for init on it's startup, so all processes will inherit it.

Thank you.

share|improve this question

3 Answers 3

Try the "isolcpus" kernel boot arg. You can list the CPUs you want the scheduler to ignore; the CPUs not listed will effectively form a mask for init and all its children. You can then place a process on the ignored CPUs by running it via taskset.

share|improve this answer

If you just want your machine to boot slower then try pulling some of the RAM out or nobble your hard disks to disable DMA.

Since init is the grand-daddy of every process on your system setting the affiinity at boot will mean that you set the affinity for every process - surely you want to be more selective than that?

Perhaps if you gave a bit more information about what you are trying to achieve by setting the affinity it might be possible to make a sensible answer.

share|improve this answer
    
Yeah, I do agree — it seems asker doesn't know what he really needs. Also, nothing really makes him unable to set affinity masks for all processes later. –  poige Mar 2 '11 at 12:44

What are you trying to accomplish by binding init and its child processess to a particular CPU? Is there another application that you wish to run in order to isolate system processes from application CPU resources? If so, you may want to look into establishing CPU shields. THe realtime Linux distributions have utilities available for this, but you could try the CPU Set (cset) utility outlined at:

https://rt.wiki.kernel.org/index.php/Cpuset_management_utility/tutorial

By default, creating a shield will place all of your processes in a single set, allowing you to define which important processes should move into later-defined sets.

Is this close to what you are looking for?

share|improve this answer
    
Thank you, I think this is what do I need. –  Boris Mar 2 '11 at 11:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.