Notebook
これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。
HTML ファイル生成日時: 2026/11/04 21:27:41.883 (台灣標準時)
NetBSD において特定の CPU を特定のコマンドの実行に使う方法
NetBSD において特定の CPU を特定のコマンドの実行に使うためには、
psrset コマンドを使えばよいようでござる。
NAME
psrset – control processor sets
SYNOPSIS
psrset [setid ...]
psrset -a setid cpuid ...
psrset -b setid pid ...
psrset -c [cpuid ...]
psrset -d setid
psrset -e setid command
psrset -i [setid ...]
psrset -p
psrset -r cpuid ...
psrset -u pid ...
DESCRIPTION
The psrset command can be used to control and inspect processor sets.
The system always contains at least one processor set: the default set.
The default set must contain at least one online processor (CPU) at all
times.
Where the system has symmetric multithreading (SMT), is is recommended
that CPUs representing different threads within a single core are not
assigned to different processor sets.
現在の processor set を表示させるには、以下のようにすればよいでござる。
# psrset
system processor set 0: processor(s) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
通常は、全てのプロセッサーが system processor set 0 に割り当てられてい
るでござる。
新たな processor set を作る場合には、以下のようにすればよいでござる。
# psrset -c
1
# psrset
system processor set 0: processor(s) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
user processor set 1: empty
空の user processor set 1 が作られたでござる。
user processor set 1 に、プロセッサーを割り当てるには、以下のようにす
ればよいでござる。
# psrset -a 1 1 3 5 7 9 11
# psrset
system processor set 0: processor(s) 0 2 4 6 8 10 12 13 14 15 16 17 18 19
user processor set 1: processor(s) 1 3 5 7 9 11
user processor set 1 に登録されたプロセッサーを使って、コマンドを実行
するには、以下のようにすればよいでござる。
% psrset -e 1 test.sh
psrset -e 1 をつけずに実行すると、 system processor set 0 に割り当てら
れているプロセッサーにより実行されるでござる。
user processor set 1 に割り当てたプロセッサーは、 system processor set
0 からは削除されるでござる。それぞれのプロセッサーは、一つのセットにし
か所属できないようでござる。
作った processor set を削除するには、以下のようにすればよいようでござ
る。
# psrset -d 1
# psrset
system processor set 0: processor(s) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
既に実行中であるコマンドの利用している processor set を変更するには、
以下のようにすればよいようでござる。
# psrset -b 1 12345
上の例では、 process ID 12345 のプロセスの processor set を 1 に変更し
ているでござる。
この psrset を使えば、例えば、特定の仮想機械に P-core を割り当て、別の
仮想機械に E-core を割り当てる、というようなことができるようでござる。
- About this article:
- author: daisuke
- file: 20261102_00.html
- category: Computer___NetBSD
- title: NetBSD において特定の CPU を特定のコマンドの実行に使う方法
- mode: public
- last modified: 2026/11/02 19:08:04 (UT+08:00)
- html generated: 2026/11/04 21:27:41.883 (Taiwan Standard Time)
Frequently accessed files
- Computer___Network/20260127_00.html
- 4955 page views
- title: radiko の API に変更があった
- Misc___Taiwan/20240207_00.html
- 3612 page views
- title: 台灣から台灣の外に EMS で荷物を発送する方法
- Computer___NetBSD/20250301_01.html
- 3374 page views
- title: yt-dlp で YouTube の動画をダウンロードするときのこと
- Misc___Taiwan/20240819_00.html
- 3026 page views
- title: 住所から台灣の郵便番号を調べる方法
- Book___Chinese/20240424_00.html
- 2095 page views
- title: 曹操の詩
- Computer___TeX/20231107_00.html
- 1997 page views
- title: LaTeX での counter の利用方法について
- Computer___TeX/20240414_01.html
- 1569 page views
- title: LuaTeX を使って日本語と中国語の漢字が混在した PDF ファイルを作成する方法
- Misc___Japan/20240718_00.html
- 1564 page views
- title: 日本の運転免許証が失効してしまったときの再取得の手続きについて
- Misc___Japan/20240610_00.html
- 1495 page views
- title: NHK ラジオの「聞き逃し」の変更点 (2024 年 06 月)
- Computer___TeX/20240411_00.html
- 1443 page views
- title: LuaTeX を使って PDF ファイルを作成する方法
- Misc___Taiwan/20240903_01.html
- 1397 page views
- title: 台湾の郵便局で EMS を利用して荷物を海外に送る方法
- Computer___TeX/20230726_01.html
- 1362 page views
- title: Beamer の Metropolis テーマで block の色を変える方法
- Computer___Network/20241214_00.html
- 1361 page views
- title: Google Colab で Python 3.12 を使う方法
- Computer___Python/20230803_00.html
- 1300 page views
- title: Python を使って QR コードを生成する方法
- Computer___Network/20230516_00.html
- 1295 page views
- title: OpenVPN 2.6 を使い VPN Gate に接続するときの注意点
- Computer___NetBSD/20230119_00.html
- 1243 page views
- title: NetBSD でバイナリーパッケージを利用する方法
- Computer___NetBSD/20250113_00.html
- 1171 page views
- title: TigerVNC での X server の解像度の指定について
- Computer___FreeBSD/20220621_0.html
- 1154 page views
- title: FreeBSD での X.org の設定の仕方
- Computer___TeX/20240414_00.html
- 1146 page views
- title: LuaTeX での fontspec を使ったフォントの設定の方法
- Computer___NetBSD/20250307_00.html
- 1097 page views
- title: uim と mozc による日本語入力の設定について
- Computer___Network/20240130_00.html
- 1037 page views
- title: Google Colaboratory で Python 3.12 を使う方法
- Computer___TeX/20240410_00.html
- 1014 page views
- title: pdfTeX を使って PDF ファイルを作る方法
- Computer___Python/20250330_00.html
- 1007 page views
- title: Jupyter Notebook で Matplotlib を使うときのこと
- Computer___NetBSD/20220818_1.html
- 1002 page views
- title: Emacs の markdown-mode について
- Computer___NetBSD/20240805_03.html
- 929 page views
- title: NetBSD 10 のインストール
- Computer___TeX/20230503_00.html
- 916 page views
- title: LaTeX CJK で日本語や中国語を取り扱うための準備について
- Computer___Network/20220413_1.html
- 914 page views
- title: HTML 文書の中の一部の文字を点滅させる方法
- Computer___Python/20240101_00.html
- 892 page views
- title: Matplotlib の 3D plot においての注意点
- Computer___NetBSD/20240101_03.html
- 870 page views
- title: ffmpeg で動画に metadata を追加する方法
- Computer___Hardware/20240820_00.html
- 856 page views
- title: Raspberry Pi 5 の演算性能
HTML file generated by Kinoshita Daisuke.