lkml.org 
[lkml]   [2019]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 7/7] posix-timers: Prepare for PREEMPT_RT
    On Wed, Jul 31, 2019 at 12:33:55AM +0200, Thomas Gleixner wrote:
    > +static struct k_itimer *timer_wait_running(struct k_itimer *timer,
    > + unsigned long *flags)
    > +{
    > + const struct k_clock *kc = READ_ONCE(timer->kclock);
    > + timer_t timer_id = READ_ONCE(timer->it_id);
    > +
    > + /* Prevent kfree(timer) after dropping the lock */
    > + rcu_read_lock();
    > + unlock_timer(timer, *flags);
    > +
    > + if (kc->timer_arm == common_hrtimer_arm)
    > + hrtimer_cancel_wait_running(&timer->it.real.timer);
    > + else if (kc == &alarm_clock)
    > + hrtimer_cancel_wait_running(&timer->it.alarm.alarmtimer.timer);

    else WARN();

    > + rcu_read_unlock();
    > +
    > + /* Relock the timer. It might be not longer hashed. */
    > + return lock_timer(timer_id, flags);
    > +}

    \
     
     \ /
      Last update: 2019-07-31 11:51    [W:4.198 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site