[PATCH] Re: timerfd read does not return

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

 



On 19.04.2013 21:53, Stanislav Meduna wrote:

>> There is no return from the read until the RT throttler got activated.
>> Kernel version 3.4.25-rt37 - I'll check whether anything relevant
>> has changed since then.

FWIW, the following patch seems to solve the issue for me.
Unfortunately I have no idea whether this is a sane way to
do and whether it solves or just masks or delays the issue,
I just decided to try it after seeing http://lkml.org/lkml/2012/2/8/487

Note that in my case the ksoftirqd has lower priority than
the thread reading the timerfd, so the latter gets woken up
immediately and it is well possible and usual that it returns
into the kernel to do another read before the hrtimer softirq
ends. Would it be possible that there is some race in this
situation?


diff --git a/fs/timerfd.c b/fs/timerfd.c
index 57f0e4e..b06ba86 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -222,6 +222,7 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
                ctx->ticks = 0;
        }
        spin_unlock_irq(&ctx->wqh.lock);
+       hrtimer_wait_for_timer(&ctx->tmr);
        if (ticks)
                res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks);
        return res;


Thanks
-- 
                                         Stano

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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