The whole LOC drama train is tied to code that doesn't get compiled when you specify the architecture.
Realtime OSs are currently in vogue because they better match how some IoTs devices work, so there's less abstraction that doesn't apply to that circumstances (and therefore improved performance/reduced complexity).
Is it, though? Linux has had NOMMU (running without an MMU at all) support since the early 2000s, and the atomics / barriers are more based on Alpha's memory model than anything else - several of those primitives just compile out to a compiler barrier or nothing at all on x86.
Most heavyweight things you don't need in an IoT context can be compiled-out completely - I think probably the major bit of infrastructure you can't is support for multiple user IDs?