Detecting whether hyperthreading is enabled

We’ve recently had requests for our internal inventory to flag which systems have hyperthreading enabled and which don’t. This brought up the question of what’s the simplest and most universal way to detect if a given Linux server has hyperthreading enabled. The expected google searches turned up a lot of discussion but not a lot of definitive answers. With this post I’d like to offer three different tests I have found, and also open for discussion how reliable and universal these tests are, and if there are perhaps better alternatives.
Continue reading