[rh7,1/2] mm/vmscan: shrink slabs from offlined cgroups.

Submitted by Andrey Ryabinin on April 23, 2018, 1 p.m.

Details

Message ID 20180423130046.9339-1-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin April 23, 2018, 1 p.m.
Currently shrink_slab() skips offlined cgroups during per-memcg reclaim.
So only global reclaim can shrink slabs from offlined cgroups.
This doesn't make any sense, we should allow reclaiming offlined
cgroups, otherwise we can't destroy them (kmem pins memgc).

https://jira.sw.ru/browse/PSBM-83628
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 mm/vmscan.c | 3 ---
 1 file changed, 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4922f734cdb4..aefa4bc33062 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -395,9 +395,6 @@  static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
 	struct shrinker *shrinker;
 	unsigned long freed = 0;
 
-	if (memcg && !memcg_kmem_is_active(memcg))
-		return 0;
-
 	if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE)))
 		return 0;
 

Comments

Konstantin Khorenko April 27, 2018, 10:53 a.m.
Do you plan to send this to mainstream as well?

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 04/23/2018 04:00 PM, Andrey Ryabinin wrote:
> Currently shrink_slab() skips offlined cgroups during per-memcg reclaim.
> So only global reclaim can shrink slabs from offlined cgroups.
> This doesn't make any sense, we should allow reclaiming offlined
> cgroups, otherwise we can't destroy them (kmem pins memgc).
>
> https://jira.sw.ru/browse/PSBM-83628
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
>  mm/vmscan.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 4922f734cdb4..aefa4bc33062 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -395,9 +395,6 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
>  	struct shrinker *shrinker;
>  	unsigned long freed = 0;
>
> -	if (memcg && !memcg_kmem_is_active(memcg))
> -		return 0;
> -
>  	if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE)))
>  		return 0;
>
>
Andrey Ryabinin April 27, 2018, 1:39 p.m.
On 04/27/2018 01:53 PM, Konstantin Khorenko wrote:
> Do you plan to send this to mainstream as well?
> 

No, mainstream doesn't need it. On offline mainstream attaches kmem lru lists
to the parent cgroup. Thus kmem reclaimed when shrinking parent cgroup


> -- 
> Best regards,
> 
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team
> 
> On 04/23/2018 04:00 PM, Andrey Ryabinin wrote:
>> Currently shrink_slab() skips offlined cgroups during per-memcg reclaim.
>> So only global reclaim can shrink slabs from offlined cgroups.
>> This doesn't make any sense, we should allow reclaiming offlined
>> cgroups, otherwise we can't destroy them (kmem pins memgc).
>>
>> https://jira.sw.ru/browse/PSBM-83628
>> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
>> ---
>>  mm/vmscan.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 4922f734cdb4..aefa4bc33062 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -395,9 +395,6 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
>>      struct shrinker *shrinker;
>>      unsigned long freed = 0;
>>
>> -    if (memcg && !memcg_kmem_is_active(memcg))
>> -        return 0;
>> -
>>      if (unlikely(test_tsk_thread_flag(current, TIF_MEMDIE)))
>>          return 0;
>>
>>