linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] sched: show cpu number when sched_show_task
@ 2023-02-08 12:46 Peng Fan (OSS)
  2023-02-08 13:48 ` Phil Auld
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan (OSS) @ 2023-02-08 12:46 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

It would be helpful to show cpu number when dump task. Such as
when doing system suspend, we could know the failed freezing
process run on which cpu.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index daff72f00385..0c7a1b2f7baf 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8876,7 +8876,7 @@ void sched_show_task(struct task_struct *p)
 	if (!try_get_task_stack(p))
 		return;
 
-	pr_info("task:%-15.15s state:%c", p->comm, task_state_to_char(p));
+	pr_info("task:%-15.15s state:%c cpu:0x%x", p->comm, task_state_to_char(p), task_cpu(p));
 
 	if (task_is_running(p))
 		pr_cont("  running task    ");
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC] sched: show cpu number when sched_show_task
  2023-02-08 12:46 [RFC] sched: show cpu number when sched_show_task Peng Fan (OSS)
@ 2023-02-08 13:48 ` Phil Auld
  2023-02-28  1:13   ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Auld @ 2023-02-08 13:48 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel,
	Peng Fan

On Wed, Feb 08, 2023 at 08:46:55PM +0800 Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> It would be helpful to show cpu number when dump task. Such as
> when doing system suspend, we could know the failed freezing
> process run on which cpu.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  kernel/sched/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index daff72f00385..0c7a1b2f7baf 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -8876,7 +8876,7 @@ void sched_show_task(struct task_struct *p)
>  	if (!try_get_task_stack(p))
>  		return;
>  
> -	pr_info("task:%-15.15s state:%c", p->comm, task_state_to_char(p));
> +	pr_info("task:%-15.15s state:%c cpu:0x%x", p->comm, task_state_to_char(p), task_cpu(p));
>  
>  	if (task_is_running(p))
>  		pr_cont("  running task    ");
> -- 
> 2.37.1
> 

Looks useful, thanks.

Reviewed-by: Phil Auld <pauld@redhat.com>


-- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [RFC] sched: show cpu number when sched_show_task
  2023-02-08 13:48 ` Phil Auld
@ 2023-02-28  1:13   ` Peng Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Fan @ 2023-02-28  1:13 UTC (permalink / raw)
  To: Phil Auld, mingo, peterz, juri.lelli, vincent.guittot,
	dietmar.eggemann, rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel

> Subject: Re: [RFC] sched: show cpu number when sched_show_task

Should I send a formal patch with Phil's R-b or this is fine since no more comments?

Thanks,
Peng.

> 
> On Wed, Feb 08, 2023 at 08:46:55PM +0800 Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > It would be helpful to show cpu number when dump task. Such as when
> > doing system suspend, we could know the failed freezing process run on
> > which cpu.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  kernel/sched/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c index
> > daff72f00385..0c7a1b2f7baf 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -8876,7 +8876,7 @@ void sched_show_task(struct task_struct *p)
> >  	if (!try_get_task_stack(p))
> >  		return;
> >
> > -	pr_info("task:%-15.15s state:%c", p->comm, task_state_to_char(p));
> > +	pr_info("task:%-15.15s state:%c cpu:0x%x", p->comm,
> > +task_state_to_char(p), task_cpu(p));
> >
> >  	if (task_is_running(p))
> >  		pr_cont("  running task    ");
> > --
> > 2.37.1
> >
> 
> Looks useful, thanks.
> 
> Reviewed-by: Phil Auld <pauld@redhat.com>
> 
> 
> --


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-28  1:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 12:46 [RFC] sched: show cpu number when sched_show_task Peng Fan (OSS)
2023-02-08 13:48 ` Phil Auld
2023-02-28  1:13   ` Peng Fan

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).