lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5dba07eb-88f0-bf84-494e-b979f32ad44d@gmail.com>
Date:   Sun, 8 Oct 2023 19:10:01 +0800
From:   brookxu <brookxu.cn@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     bsingharora@...il.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] delayacct: convert task->delays to a object


在 2023/10/8 18:58, Peter Zijlstra 写道:
> On Sun, Oct 08, 2023 at 06:49:37PM +0800, brookxu.cn wrote:
>> From: Chunguang Xu <chunguang.xu@...pee.com>
>>
>> Since in some scenarios we still want to get the task delayacct
>> through taskstats, so commit <0cd7c741f01de> introduces a sysctl to
> This is not the canonical way to reference a commit.
>
>> enable it dynamically. However, since task->delays is allocated
>> during fork(), task->delays will not be reallocated when delayacct
>> is enabled later. This will make we cannot get the delayacct of old
>> tasks, but the new tasks cans. This can easily lead to confusion.
>> Therefore, try to workaround this issue by convert task->delays to
>> an object.
> And grow task_struct for no reason? I think not.
>
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index 77f01ac385f7..5cc78184a31f 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -37,6 +37,7 @@
>>   #include <linux/kcsan.h>
>>   #include <linux/rv.h>
>>   #include <linux/livepatch_sched.h>
>> +#include <linux/delayacct.h>
>>   #include <asm/kmap_size.h>
>>   
>>   /* task_struct member predeclarations (sorted alphabetically): */
>> @@ -1331,7 +1332,7 @@ struct task_struct {
>>   	struct page_frag		task_frag;
>>   
>>   #ifdef CONFIG_TASK_DELAY_ACCT
>> -	struct task_delay_info		*delays;
>> +	struct task_delay_info		delays;
>>   #endif
> Yeah, no.
Yes, this way will increase about 80 bytes for task_struct, about 0.85% 
of size of task_struct, I think this just like sched_statistics, so that 
can better support dynamically enable through sysctl.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ