Re: [PATCH 2/2] cgroup/rstat: check updated_next only for root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 05, 2022 at 08:35:04PM +0100, Michal Koutn? wrote:
>On Sat, Dec 25, 2021 at 12:09:32AM +0000, Wei Yang <richard.weiyang@xxxxxxxxx> wrote:
>> This means we can remove the check on ->updated_next, if we make sure
>> the subtree from @root is on list, which could be done by checking
>> updated_next for root.
>
>Nice refactoring.
>
>> @@ -96,9 +97,12 @@ static struct cgroup *cgroup_rstat_cpu_pop_updated(struct cgroup *pos,
>>  	 * We're gonna walk down to the first leaf and visit/remove it.  We
>>  	 * can pick whatever unvisited node as the starting point.
>>  	 */
>> -	if (!pos)
>> +	if (!pos) {
>>  		pos = root;
>> -	else
>> +		// return NULL if this subtree is not on-list
>> +		if (!cgroup_rstat_cpu(pos, cpu)->updated_next)
>> +			return NULL;
>> +	} else
>+		/* return NULL if this subtree is not on-list */
>
>Just a coding style nitpick.

Thanks for comment. Would you like me to send a v2?

>
>The patch is otherwise
>Reviewed-by: Michal Koutn? <mkoutny@xxxxxxxx>

-- 
Wei Yang
Help you, Help me



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux