Archive

Posts Tagged ‘one-liner’

One-liner pin shell and processes

November 26th, 2010 No comments

There’s no rocket science content in this post. It’s just something I use often and don’t want to forget.
If you want to pin a shell and all prospectively started processes to a specific subset of cpus execute:

taskset -pc `echo $$` <cpu-list>

Not only that it limits intererences between processes (user 1 might work on node 1, user 2 on node 2), it can also help increase energy efficiency. If all background threads are pinned on a single processor-core, other cores can be send to sleep for a longer time period, which allows higher C-states.

Update: Added <cpu-list>

Categories: linux, nerdcore Tags: , ,