taskset command

linux의 taskset 명령어(CLI)는 프로세스의 CPU 선호도(affinity)를 설정하거나 찾는 명령어 입니다. 간단하게 말하면 프로세스가 동작할 때 CPU(CPU or Core)를 지정하는 명령어 입니다. 기본 사용법 # CPU 0번째(1번) Core를 통해 프로세스를 실행하기 $> taskset -c 0 ./process taskset help $> taskset --help Usage: taskset [options] [mask | cpu-list] [pid|cmd [args...]] Show or change the CPU affinity of a process. Options: -a, --all-tasks operate on all the tasks (threads) for a given pid -p, --pid operate on existing given pid -c, --cpu-list display and specify cpus in list format -h, --help display this help -V, --version display version The default behavior is to run a new command: taskset 03 sshd -b 1024 You can retrieve the mask of an existing task: taskset -p 700 Or set it: taskset -p 03 700 List format uses a comma-separated list instead of a mask: taskset -pc 0,3,7-11 700 Ranges in list format can take a stride argument: e.

Continue reading

taskset command

linux의 taskset 명령어를 통해 프로세스가 사용할 CPU를 보여주거나 설정할 수 있습니다. 기본 사용법 $> taskset -p 6525 pid 6525's current affinity mask: ff $> taskset -pc 6525 pid 6525's current affinity list: 0-7 응용 동일한 코어에서 두 스레드 간에 메세지를 보내는데 걸리는 시간 측정 (이 결과로 컨텍스트 스위칭시 성능을 알 수 있습니다.) $> taskset -c 0 perf bench sched pipe -T # Running 'sched/pipe' benchmark: # Executed 1000000 pipe operations between two threads Total time: 3.

Continue reading

Author's picture

GeekSaga

.

Dreamer

Korea