mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: brookxu <brookxu.cn@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
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 19:03:01 +0800	[thread overview]
Message-ID: <2b2dbd18-b018-7212-8a3c-5d207697709d@gmail.com> (raw)
In-Reply-To: <20231008105627.GB6320@noisy.programming.kicks-ass.net>


在 2023/10/8 18:56, Peter Zijlstra 写道:
> 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.
Sorry, As Patch 2 will convert tsk->delays to object,  we donot need to 
check whether tsk->delays is null or not, so relative code can be simplify.

  reply	other threads:[~2023-10-08 11:03 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
2023-10-08 11:03     ` brookxu [this message]
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=2b2dbd18-b018-7212-8a3c-5d207697709d@gmail.com \
    --to=brookxu.cn@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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

Powered by JetHome