On Wed, 26 Sep 2018, Ralf Ramsauer wrote: > Hi, > > If I set the SCHED_FIFO schedular, register a SIGALRM handler, set an > alarm() and consume 100% of CPU time on an isolated CPU (IOW, never > leave running/runable), the signal will never arrive in userspace. > According to /proc/timer_list the expiration time will become a negative > value. > > But if I synchronously send a SIGALRM via kill, it will immediately > arrive. Even a sched_yield() in the busy loop won't help. In order to > get the signal, I have to leave running/runable with usleep(). > > Now I'm not sure if this behaviour is intended for some reason or if > it's a bug. Please find a minimal example attached. Run it on an > isolated CPU with taskset. > > Reproduceable with 4.14.x-rt and latest -rt. Not reproducable with > mainline Linux and PREEMPT. The problem is that the alarm timer is delivered in softirq context. Assuming that your task loops with higher priority than the softirq thread it will simply starve it and the timer is never expired and therefore no siganl delivered. Not pretty, but nothing we can do about right now with the way signal based timers work. There are ideas to implement that differently, but that's more complex than it seems in the first place. Thanks, tglx