- Subject: Re: timerfd-add-tfd_notify_clock_set-to-watch-for-clock-changes.patch added to -mm tree
- From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
- Date: Fri, 11 Mar 2011 17:23:36 +0100 (CET)
- Cc: Alexander Shishkin <virtuoso@xxxxxxxxx>, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxx>, Feng Tang <feng.tang@xxxxxxxxx>, Michael Tokarev <mjt@xxxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, John Stultz <johnstul@xxxxxxxxxx>, Chris Friesen <chris.friesen@xxxxxxxxxxx>, Kay Sievers <kay.sievers@xxxxxxxx>, "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx>, Artem Bityutskiy <dedekind1@xxxxxxxxx>, Davide Libenzi <davidel@xxxxxxxxxxxxxxx>, Michael Kerrisk <mtk.manpages@xxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <20110311135023.GA23552@xxxxxxxxxx>
- References: <20110311135023.GA23552@xxxxxxxxxx>
- User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Fri, 11 Mar 2011, Oleg Nesterov wrote:
> > @@ -218,10 +266,12 @@ SYSCALL_DEFINE4(timerfd_settime, int, uf
> > * it to the new values.
> > */
> > for (;;) {
> > + spin_lock(¬ifiers_lock);
> > spin_lock_irq(&ctx->wqh.lock);
> > - if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
> > + if (!list_empty(¬ifiers_list) || hrtimer_try_to_cancel(&ctx->tmr) >= 0)
> > break;
>
> Confused. Why do we check the global notifiers_list?
>
> IOW. Suppose that this list is not empty and timerfd_settime() is called
> without TFD_NOTIFY_CLOCK_SET. Now we are going to reprogramm the timer
> without stopping it?
>
> And. What if timerfd_settime(TFD_NOTIFY_CLOCK_SET, utmr => NULL) is called
> twice? timerfd_setup() blindly does list_add(), and we corrupt the list, no?
And why is this hack in -mm at all ?
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Home]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]