>As for IoT devices... ...Since the tools for Linux are generally excellent and the runtime cost is zero, it's clearly going to be the defacto choice unless there is a reason to choose differently.
Three big reasons:
The size of OSs such as QNX are a tenth the size of Linux. This is important if your application is taking power from an AA cell or harvesting it from piezo-electric switch or from elsewhere.
Also, IoT applications may be more of a pain in the arse if they go wrong- QNX has a longer, more battle-hardened pedigree in critical systems than Linux.
Yet more, Linux isn't a real time OS.
The idea that Linux is a panacea is mere shabby thinking, or at least narrow thinking based upon the presumption that a computer is a discrete lump of X Mhrtz and Z MB etc