mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Yue Hu <zbestahu@gmail.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	mgorman@suse.de, bristot@redhat.com,
	linux-kernel@vger.kernel.org, huyue2@yulong.com,
	zbestahu@163.com
Subject: Re: [PATCH] sched: Use SCHED_WARN_ON() instead of WARN_ON_ONCE() with CONFIG_SCHED_DEBUG
Date: Tue, 9 Feb 2021 12:49:43 -0500	[thread overview]
Message-ID: <20210209124943.4a97b1d2@gandalf.local.home> (raw)
In-Reply-To: <20210203095012.627-1-zbestahu@gmail.com>

On Wed,  3 Feb 2021 17:50:12 +0800
Yue Hu <zbestahu@gmail.com> wrote:

> From: Yue Hu <huyue2@yulong.com>
> 
> Since SCHED_WARN_ON() is provided as a wrapper for WARN_ON_ONCE().

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Peter, care to take this?

Also, looks like we can get rid of the #ifdef CONFIG_SCHED_DEBUG in
set_task_cpu() by replacing all the WARN_ON_ONCE() with SCHED_WARN_ON().

-- Steve


> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>
> ---
>  kernel/sched/core.c | 2 +-
>  kernel/sched/rt.c   | 4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 8c54810..8f1f345 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5347,7 +5347,7 @@ asmlinkage __visible void __sched preempt_schedule_irq(void)
>  int default_wake_function(wait_queue_entry_t *curr, unsigned mode, int wake_flags,
>  			  void *key)
>  {
> -	WARN_ON_ONCE(IS_ENABLED(CONFIG_SCHED_DEBUG) && wake_flags & ~WF_SYNC);
> +	SCHED_WARN_ON(wake_flags & ~WF_SYNC);
>  	return try_to_wake_up(curr->private, mode, wake_flags);
>  }
>  EXPORT_SYMBOL(default_wake_function);
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 8f720b7..a90eab3 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -114,9 +114,7 @@ static void destroy_rt_bandwidth(struct rt_bandwidth *rt_b)
>  
>  static inline struct task_struct *rt_task_of(struct sched_rt_entity *rt_se)
>  {
> -#ifdef CONFIG_SCHED_DEBUG
> -	WARN_ON_ONCE(!rt_entity_is_task(rt_se));
> -#endif
> +	SCHED_WARN_ON(!rt_entity_is_task(rt_se));
>  	return container_of(rt_se, struct task_struct, rt);
>  }
>  


      reply	other threads:[~2021-02-09 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  9:50 Yue Hu
2021-02-09 17:49 ` Steven Rostedt [this message]

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=20210209124943.4a97b1d2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=huyue2@yulong.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=zbestahu@163.com \
    --cc=zbestahu@gmail.com \
    /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

all inboxes | Powered by JetHome®