Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
カーネルモジュールが実行されている物理コアと論理コア (ハイパースレッディングの場合) の数を返す Linux のカーネル関数はありますか?
の最後を見てくださいinclude/linux/smp.h:smp_processor_id() 現在実行中の CPU の番号が表示されます。が呼び出されるget_cpu()までその CPU にとどまるように、同じことを行い、プリエンプションも無効にします。put_cpu()
include/linux/smp.h
smp_processor_id()
get_cpu()
put_cpu()
ユーザー空間から、sched_getcpu()またはgetcpu()同じ情報を取得するために使用できます。
sched_getcpu()
getcpu()