mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/core: Optimize sched_core_next()
@ 2022-04-24 17:08 Cruz Zhao
  2022-05-10  7:37 ` cruzzhao
  0 siblings, 1 reply; 2+ messages in thread
From: Cruz Zhao @ 2022-04-24 17:08 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot
  Cc: linux-kernel

As there is __node_2_sc() defined before, just use it instead of
container_of() in function sched_core_next().

Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.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 d50d4dd..d3e3d6e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -284,7 +284,7 @@ static struct task_struct *sched_core_next(struct task_struct *p, unsigned long
 	if (!node)
 		return NULL;
 
-	p = container_of(node, struct task_struct, core_node);
+	p = __node_2_sc(node);
 	if (p->core_cookie != cookie)
 		return NULL;
 
-- 
1.8.3.1


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

* Re: [PATCH] sched/core: Optimize sched_core_next()
  2022-04-24 17:08 [PATCH] sched/core: Optimize sched_core_next() Cruz Zhao
@ 2022-05-10  7:37 ` cruzzhao
  0 siblings, 0 replies; 2+ messages in thread
From: cruzzhao @ 2022-05-10  7:37 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot
  Cc: linux-kernel

ping... Is this patch necessary?

在 2022/4/25 上午1:08, Cruz Zhao 写道:
> As there is __node_2_sc() defined before, just use it instead of
> container_of() in function sched_core_next().
> 
> Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.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 d50d4dd..d3e3d6e 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -284,7 +284,7 @@ static struct task_struct *sched_core_next(struct task_struct *p, unsigned long
>  	if (!node)
>  		return NULL;
>  
> -	p = container_of(node, struct task_struct, core_node);
> +	p = __node_2_sc(node);
>  	if (p->core_cookie != cookie)
>  		return NULL;
>  

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

end of thread, other threads:[~2022-05-10  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 17:08 [PATCH] sched/core: Optimize sched_core_next() Cruz Zhao
2022-05-10  7:37 ` cruzzhao

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®