[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231008105627.GB6320@noisy.programming.kicks-ass.net>
Date: Sun, 8 Oct 2023 12:56:27 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "brookxu.cn" <brookxu.cn@...il.com>
Cc: bsingharora@...il.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] delayacct: introduce delayacct_enabled() to simplify
implement
On Sun, Oct 08, 2023 at 06:49:36PM +0800, brookxu.cn wrote:
> From: Chunguang Xu <chunguang.xu@...pee.com>
>
> Introduce delayacct_enabled() to simplify the code and make it
> more concise.
>
> Signed-off-by: Chunguang Xu <chunguang.xu@...pee.com>
> ---
> include/linux/delayacct.h | 74 +++++++++++----------------------------
> kernel/delayacct.c | 2 +-
> 2 files changed, 21 insertions(+), 55 deletions(-)
>
> diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
> index 6639f48dac36..660e534ce7c4 100644
> --- a/include/linux/delayacct.h
> +++ b/include/linux/delayacct.h
> @@ -94,137 +94,103 @@ static inline void delayacct_tsk_init(struct task_struct *tsk)
> __delayacct_tsk_init(tsk);
> }
>
> +static inline bool delayacct_enabled(void)
> +{
> + return static_branch_unlikely(&delayacct_key);
> +}
> +
> /* Free tsk->delays. Called from bad fork and __put_task_struct
> * where there's no risk of tsk->delays being accessed elsewhere
> */
> static inline void delayacct_tsk_free(struct task_struct *tsk)
> {
> - if (tsk->delays)
> + if (delayacct_enabled())
This isn't an equivalent change and your Changelog does not clarify.
Powered by blists - more mailing lists