[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210910124530.iezmxpzzhkbl6gwt@linutronix.de>
Date: Fri, 10 Sep 2021 14:45:30 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: tglx@...utronix.de, boqun.feng@...il.com,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Davidlohr Bueso <dave@...olabs.net>,
Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Mike Galbraith <efault@....de>,
Daniel Bristot de Oliveira <bristot@...hat.com>
Subject: Re: [PATCH 1/4] sched/wakeup: Strengthen
current_save_and_set_rtlock_wait_state()
On 2021-09-09 12:59:16 [+0200], Peter Zijlstra wrote:
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -253,22 +254,24 @@ struct task_group;
> */
> #define current_save_and_set_rtlock_wait_state() \
> do { \
> - lockdep_assert_irqs_disabled(); \
> - raw_spin_lock(¤t->pi_lock); \
> + unsigned long flags; /* may shadow */ \
could we haz __flags so no shadow?
> + \
> + raw_spin_lock_irqsave(¤t->pi_lock, flags); \
> current->saved_state = current->__state; \
> debug_rtlock_wait_set_state(); \
> - WRITE_ONCE(current->__state, TASK_RTLOCK_WAIT); \
> - raw_spin_unlock(¤t->pi_lock); \
> + smp_store_mb(current->__state, TASK_RTLOCK_WAIT); \
> + raw_spin_unlock_irqrestore(¤t->pi_lock, flags); \
Sebastian
Powered by blists - more mailing lists