From: Steven Rostedt <rostedt@goodmis.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-users@vger.kernel.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH RT] sched: drop is_special_task_state() check from __set_current_state_no_track()
Date: Wed, 1 Aug 2018 09:19:42 -0400 [thread overview]
Message-ID: <20180801091942.46292953@gandalf.local.home> (raw)
In-Reply-To: <20180801090524.7hmzfdx7r4bivekq@linutronix.de>
On Wed, 1 Aug 2018 11:05:25 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> The is_special_task_state() check in __set_current_state_no_track()
> has been wrongly placed. __set_current_state_no_track() is used in RT
> while a sleeping lock is acquired. It is used at the begin of the wait
> loop with TASK_UNINTERRUPTIBLE and while leaving it and restoring the
> original state. The latter part triggers the warning.
>
> Drop the special state check. This is only used within the sleeping lock
> implementation and the assignment happens while the PI lock is held.
> While at it, drop set_current_state_no_track() because it has no users.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> include/linux/sched.h | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index a0c1c0cae992..b20264e17b02 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -132,16 +132,9 @@ struct task_group;
>
> #define __set_current_state_no_track(state_value) \
> do { \
> - WARN_ON_ONCE(is_special_task_state(state_value));\
> current->state = (state_value); \
> } while (0)
I don't think we need to keep the do { } while with a single line. It
is now equivalent to the non-debug version of __set_current_state()
which is defined as:
#define __set_current_state(state_value) \
current->state = (state_value)
-- Steve
>
> -#define set_current_state_no_track(state_value) \
> - do { \
> - WARN_ON_ONCE(is_special_task_state(state_value));\
> - smp_store_mb(current->state, (state_value)); \
> - } while (0)
> -
> #define set_special_state(state_value) \
> do { \
> unsigned long flags; /* may shadow */ \
> @@ -196,7 +189,6 @@ struct task_group;
> smp_store_mb(current->state, (state_value))
>
> #define __set_current_state_no_track(state_value) __set_current_state(state_value)
> -#define set_current_state_no_track(state_value) set_current_state(state_value)
>
> /*
> * set_special_state() should be used for those states when the blocking task
next prev parent reply other threads:[~2018-08-01 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 9:05 [PATCH RT] sched: drop is_special_task_state() check from __set_current_state_no_track() Sebastian Andrzej Siewior
2018-08-01 13:19 ` Steven Rostedt [this message]
2018-08-01 15:53 ` Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180801091942.46292953@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).