2

How can I set processor affinity in Linux machine (Fedora) that user duel core Intel(any) CPU? I want the other core to shut down.

Thanks

1 Answer 1

3

Several ways come to mind, all using boot line parameters. Insert these in your grub configuration so they're used on next boot:

isolcpu=0   -or- isolcpu=1     -- specifies which cpu to ISOLATE.
maxcpus=0                      -- specifies to use only core 0
nosmp                          -- legacy version of maxcpus=0 (depreciated)

You could use the taskset command to individually set the cpu affinity for each running process. Ideally, you'd want to set affinity for init (pid 1) and have everything inherit that (which is essentially what the first command above does).

taskset -p [mask] pid

[mask] is a bitmask for valid cpus. to make a program only run on cpu 0, use '1' as the mask, to only use cpu 1, use '2', and so on. (to use both, use '3')

This can get tedious. No idea why you'd want to cripple your machine like this, but hey... it's your machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .