1

In Solaris, how we can find the status or check hyper-threading or multi-threading is enabled or not using commands?

2

Use psrinfo command, to view info of your CPUs:

psrinfo -vp to view info of physical and virtual CPUs,
psrinfo to view online/offline CPUs.

Let's say you have 4 CPUs, including HT virtual CPUs, 0-3, and want to disable HTs. They will be presented in pairs, 1st physical will have (0,2), 2nd (1,3). 2 and 3 are the HTs.

To disable/enable:
psradm -f 2 3 will disable them (offline).
psrinfo to view the online/offline CPUs (check the difference)
psradm -n 2 3 to enable them (online).

These settings are runtime only. You must enable/disable HT through BIOS/EFI for persistence. I've tested these on Solaris 11.4 x86.

| improve this answer | |
  • I just want to know the status no need to change. So how we can decide by looking at the cpu info. – sandeep Jun 12 at 8:41
  • If for example you have 2 physical CPUs and HT is enabled in BIOS/EFI, executing psrinfo you'll get 4 CPUs, if HT is used by Solaris. Else you'll see only 2. – Krackout Jun 12 at 9:42
  • Here cpu means cores right? Consider i have set 2 cores and if we check the core count using kstat cpu_info | grep core_id | sort -u | wc -l then it would be showing 4 is it ? – sandeep Jun 12 at 10:28
  • Yes, correct, by CPUs I meant CPU cores. kstat ... command you mentioned gives me one more line, pkg_core_id, probably different output due to version. But yes, it should show you 4 core_ids (0,1, etc), equivalent to psrinfo output. – Krackout Jun 12 at 17:38
  • So how do we get the actual cpu count? – sandeep Jun 15 at 4:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.