@aldous: thanks, I had read about both of these. The thing is, the kernel_task seems to be super high even when I don’t have that much going on. I do wonder if the kernel_task percentage can stay high even after I close an app that’s using a lot of CPU.
The number of open apps isn't really relevant, so just to check, you mean no other processes are using CPU etc in Activity Monitor? So the MDS thing isn't happening on most of the occasions that kernel_task is spiking?
If you've already checked out the temperature, that the fan's working properly, etc, with powermetrics or similar(?) then that leaves kernel_task's other functions. Have you got an external monitor by any chance? If you see kernel_task going nuts again, try unplugging it (as a diagnostic; not a fix), similarly any other external devices.
Seems to be that way. I’ve tried restarting in order to stop the Spotlight from indexing, but that doesn’t always work.
If it keeps indexing and doesn't stop, despite being given plenty of time to finish (e.g. after system updates) and without lots of constantly-changing files (e.g. because you're a software developer), then it may be suck on a dodgy index.
You can force it to rebuild the index by finding the settings for "Spotlight", "Privacy", adding "Macintosh HD" to the list of excluded locations, restarting, then removing it again. I suggest doing this at the end of the day because it'll then (correctly!) start feverishly indexing everything, but it should successfully conclude.