Re: [PATCH 2/3] mm/memcg: set pos to prev unconditionally

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

 



On Wed, Mar 30, 2022 at 08:08:49AM -0400, Johannes Weiner wrote:
>On Wed, Mar 30, 2022 at 12:47:50AM +0000, Wei Yang wrote:
>> Something like this?
>> 
>> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> index eed9916cdce5..5d433b79ba47 100644
>> --- a/mm/memcontrol.c
>> +++ b/mm/memcontrol.c
>> @@ -1005,9 +1005,6 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
>>  	if (!root)
>>  		root = root_mem_cgroup;
>>  
>> -	if (prev && !reclaim)
>> -		pos = prev;
>> -
>>  	rcu_read_lock();
>>  
>>  	if (reclaim) {
>> @@ -1033,6 +1030,8 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
>>  			 */
>>  			(void)cmpxchg(&iter->position, pos, NULL);
>>  		}
>> +	} else if (prev) {
>> +		pos = prev;
>>  	}
>>  
>>  	if (pos)
>
>Yep!

Sure, I would prepare a v2.

BTW, do you have some comment on patch 3?

-- 
Wei Yang
Help you, Help me




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

  Powered by Linux