mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "brookxu.cn" <brookxu.cn@gmail.com>
Cc: bsingharora@gmail.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] delayacct: introduce delayacct_enabled() to simplify implement
Date: Sun, 8 Oct 2023 12:56:27 +0200	[thread overview]
Message-ID: <20231008105627.GB6320@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <8e5d6ed7d70ff7187a33130231783ed2c1d70841.1696761522.git.chunguang.xu@shopee.com>

On Sun, Oct 08, 2023 at 06:49:36PM +0800, brookxu.cn wrote:
> From: Chunguang Xu <chunguang.xu@shopee.com>
> 
> Introduce delayacct_enabled() to simplify the code and make it
> more concise.
> 
> Signed-off-by: Chunguang Xu <chunguang.xu@shopee.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.

  reply	other threads:[~2023-10-08 10:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 10:49 [PATCH 0/3] delayacct: optimization & code simplify brookxu.cn
2023-10-08 10:49 ` [PATCH 1/3] delayacct: introduce delayacct_enabled() to simplify implement brookxu.cn
2023-10-08 10:56   ` Peter Zijlstra [this message]
2023-10-08 11:03     ` brookxu
2023-10-08 10:49 ` [PATCH 2/3] delayacct: convert task->delays to a object brookxu.cn
2023-10-08 10:58   ` Peter Zijlstra
2023-10-08 11:10     ` brookxu
2023-10-09  8:43       ` Peter Zijlstra
2023-10-09 10:29         ` brookxu
2023-10-09 14:17           ` Peter Zijlstra
2023-10-09 11:38         ` brookxu
2023-10-09 14:18           ` Peter Zijlstra
2023-10-08 13:42   ` kernel test robot
2023-10-08 15:47   ` kernel test robot
2023-10-08 16:18   ` kernel test robot
2023-10-08 10:49 ` [PATCH 3/3] delayacct: remove delayacct_on to simplify the code brookxu.cn

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=20231008105627.GB6320@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=brookxu.cn@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    /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®