All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/psi: bail out early from irq time accounting
@ 2023-09-25 10:21 Haifeng Xu
  2023-09-25 12:31 ` Johannes Weiner
  2023-09-25 13:56 ` [PATCH] sched/psi: bail " Chengming Zhou
  0 siblings, 2 replies; 8+ messages in thread
From: Haifeng Xu @ 2023-09-25 10:21 UTC (permalink / raw)
  To: hannes; +Cc: surenb, linux-kernel, Haifeng Xu

We could bail out early when psi was disabled.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
 kernel/sched/psi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 81fca77397f6..e74e14762d49 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -1005,6 +1005,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
 	struct psi_group_cpu *groupc;
 	u64 now;
 
+	if (static_branch_likely(&psi_disabled))
+		return;
+
 	if (!task->pid)
 		return;
 
-- 
2.25.1


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

* Re: [PATCH] sched/psi: bail out early from irq time accounting
  2023-09-25 10:21 [PATCH] sched/psi: bail out early from irq time accounting Haifeng Xu
@ 2023-09-25 12:31 ` Johannes Weiner
  2023-09-26 10:51   ` Haifeng Xu
  2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
  2023-09-25 13:56 ` [PATCH] sched/psi: bail " Chengming Zhou
  1 sibling, 2 replies; 8+ messages in thread
From: Johannes Weiner @ 2023-09-25 12:31 UTC (permalink / raw)
  To: Haifeng Xu; +Cc: surenb, linux-kernel

On Mon, Sep 25, 2023 at 10:21:43AM +0000, Haifeng Xu wrote:
> We could bail out early when psi was disabled.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Can you please resend this with Peter Ziljstra <peterz@infradead.org>
in CC? Thanks

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

* Re: [PATCH] sched/psi: bail out early from irq time accounting
  2023-09-25 10:21 [PATCH] sched/psi: bail out early from irq time accounting Haifeng Xu
  2023-09-25 12:31 ` Johannes Weiner
@ 2023-09-25 13:56 ` Chengming Zhou
  1 sibling, 0 replies; 8+ messages in thread
From: Chengming Zhou @ 2023-09-25 13:56 UTC (permalink / raw)
  To: Haifeng Xu, hannes; +Cc: surenb, linux-kernel

On 2023/9/25 18:21, Haifeng Xu wrote:
> We could bail out early when psi was disabled.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> ---
>  kernel/sched/psi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index 81fca77397f6..e74e14762d49 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -1005,6 +1005,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
>  	struct psi_group_cpu *groupc;
>  	u64 now;
>  
> +	if (static_branch_likely(&psi_disabled))
> +		return;
> +
>  	if (!task->pid)
>  		return;
>  

Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>

Thanks.

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

* Re: [PATCH] sched/psi: bail out early from irq time accounting
  2023-09-25 12:31 ` Johannes Weiner
@ 2023-09-26 10:51   ` Haifeng Xu
  2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
  1 sibling, 0 replies; 8+ messages in thread
From: Haifeng Xu @ 2023-09-26 10:51 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: surenb, linux-kernel



On 2023/9/25 20:31, Johannes Weiner wrote:
> On Mon, Sep 25, 2023 at 10:21:43AM +0000, Haifeng Xu wrote:
>> We could bail out early when psi was disabled.
>>
>> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> 
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> 
> Can you please resend this with Peter Ziljstra <peterz@infradead.org>
> in CC? Thanks

thanks, I'll send a new mail later.

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

* [PATCH RESEND] sched/psi: bail out early from irq time accounting
  2023-09-25 12:31 ` Johannes Weiner
  2023-09-26 10:51   ` Haifeng Xu
@ 2023-09-26 11:57   ` Haifeng Xu
  2023-09-26 12:14     ` Chengming Zhou
                       ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Haifeng Xu @ 2023-09-26 11:57 UTC (permalink / raw)
  To: hannes; +Cc: surenb, zhouchengming, peterz, linux-kernel, Haifeng Xu

We could bail out early when psi was disabled.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
 kernel/sched/psi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 81fca77397f6..e74e14762d49 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -1005,6 +1005,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
 	struct psi_group_cpu *groupc;
 	u64 now;
 
+	if (static_branch_likely(&psi_disabled))
+		return;
+
 	if (!task->pid)
 		return;
 
-- 
2.25.1


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

* Re: [PATCH RESEND] sched/psi: bail out early from irq time accounting
  2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
@ 2023-09-26 12:14     ` Chengming Zhou
  2023-10-03 11:20     ` Peter Zijlstra
  2023-10-13  8:06     ` [tip: sched/core] sched/psi: Bail " tip-bot2 for Haifeng Xu
  2 siblings, 0 replies; 8+ messages in thread
From: Chengming Zhou @ 2023-09-26 12:14 UTC (permalink / raw)
  To: Haifeng Xu, hannes; +Cc: surenb, peterz, linux-kernel

On 2023/9/26 19:57, Haifeng Xu wrote:
> We could bail out early when psi was disabled.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> ---
>  kernel/sched/psi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index 81fca77397f6..e74e14762d49 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -1005,6 +1005,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
>  	struct psi_group_cpu *groupc;
>  	u64 now;
>  
> +	if (static_branch_likely(&psi_disabled))
> +		return;
> +
>  	if (!task->pid)
>  		return;
>  

Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>

Thanks.

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

* Re: [PATCH RESEND] sched/psi: bail out early from irq time accounting
  2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
  2023-09-26 12:14     ` Chengming Zhou
@ 2023-10-03 11:20     ` Peter Zijlstra
  2023-10-13  8:06     ` [tip: sched/core] sched/psi: Bail " tip-bot2 for Haifeng Xu
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Zijlstra @ 2023-10-03 11:20 UTC (permalink / raw)
  To: Haifeng Xu; +Cc: hannes, surenb, zhouchengming, linux-kernel

On Tue, Sep 26, 2023 at 11:57:22AM +0000, Haifeng Xu wrote:
> We could bail out early when psi was disabled.
> 
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>

Thanks!

> ---
>  kernel/sched/psi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> index 81fca77397f6..e74e14762d49 100644
> --- a/kernel/sched/psi.c
> +++ b/kernel/sched/psi.c
> @@ -1005,6 +1005,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
>  	struct psi_group_cpu *groupc;
>  	u64 now;
>  
> +	if (static_branch_likely(&psi_disabled))
> +		return;
> +
>  	if (!task->pid)
>  		return;
>  
> -- 
> 2.25.1
> 

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

* [tip: sched/core] sched/psi: Bail out early from irq time accounting
  2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
  2023-09-26 12:14     ` Chengming Zhou
  2023-10-03 11:20     ` Peter Zijlstra
@ 2023-10-13  8:06     ` tip-bot2 for Haifeng Xu
  2 siblings, 0 replies; 8+ messages in thread
From: tip-bot2 for Haifeng Xu @ 2023-10-13  8:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Haifeng Xu, Peter Zijlstra (Intel), Chengming Zhou, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     0c2924079f5a83ed715630680e338b3685a0bf7d
Gitweb:        https://git.kernel.org/tip/0c2924079f5a83ed715630680e338b3685a0bf7d
Author:        Haifeng Xu <haifeng.xu@shopee.com>
AuthorDate:    Tue, 26 Sep 2023 11:57:22 
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 13 Oct 2023 09:56:29 +02:00

sched/psi: Bail out early from irq time accounting

We could bail out early when psi was disabled.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
Link: https://lore.kernel.org/r/20230926115722.467833-1-haifeng.xu@shopee.com
---
 kernel/sched/psi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 44a7877..519bc92 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -998,6 +998,9 @@ void psi_account_irqtime(struct task_struct *task, u32 delta)
 	struct psi_group_cpu *groupc;
 	u64 now;
 
+	if (static_branch_likely(&psi_disabled))
+		return;
+
 	if (!task->pid)
 		return;
 

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

end of thread, other threads:[~2023-10-13  8:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 10:21 [PATCH] sched/psi: bail out early from irq time accounting Haifeng Xu
2023-09-25 12:31 ` Johannes Weiner
2023-09-26 10:51   ` Haifeng Xu
2023-09-26 11:57   ` [PATCH RESEND] " Haifeng Xu
2023-09-26 12:14     ` Chengming Zhou
2023-10-03 11:20     ` Peter Zijlstra
2023-10-13  8:06     ` [tip: sched/core] sched/psi: Bail " tip-bot2 for Haifeng Xu
2023-09-25 13:56 ` [PATCH] sched/psi: bail " Chengming Zhou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.