[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190731094917.GR31381@hirez.programming.kicks-ass.net>
Date: Wed, 31 Jul 2019 11:49:17 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Sebastian Siewior <bigeasy@...utronix.de>,
Anna-Maria Gleixner <anna-maria@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>,
Julia Cartwright <julia@...com>
Subject: Re: [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);
> +}
Powered by blists - more mailing lists