Re: Bug or works as intended: signal behaviour on -RT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux