diff mbox series

mm: Add missed mem_cgroup_iter_break() into shrink_node_memcgs()

Message ID 158142103093.888182.8911729633457501747.stgit@localhost.localdomain (mailing list archive)
State New, archived
Headers show
Series mm: Add missed mem_cgroup_iter_break() into shrink_node_memcgs() | expand

Commit Message

Kirill Tkhai Feb. 11, 2020, 11:38 a.m. UTC
Leaving mem_cgroup_iter() loop requires mem_cgroup_iter_break().

Fixes: bf8d5d52ffe8 "memcg: introduce memory.min"
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 mm/vmscan.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Vasily Averin Feb. 11, 2020, 11:46 a.m. UTC | #1
On 2/11/20 2:38 PM, Kirill Tkhai wrote:
> Leaving mem_cgroup_iter() loop requires mem_cgroup_iter_break().
> 
> Fixes: bf8d5d52ffe8 "memcg: introduce memory.min"
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> ---
>  mm/vmscan.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index b1863de475fb..f6efe2348ba3 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2653,8 +2653,9 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
>  				continue;
>  			}
>  			memcg_memory_event(memcg, MEMCG_LOW);
> -			break;

It is not cycle break, it is switch/case break.

> +			/* fallthrough */
>  		case MEMCG_PROT_NONE:
> +			mem_cgroup_iter_break(target_memcg, memcg);
>  			/*
>  			 * All protection thresholds breached. We may
>  			 * still choose to vary the scan pressure
> 
>
Kirill Tkhai Feb. 11, 2020, 11:48 a.m. UTC | #2
On 11.02.2020 14:46, Vasily Averin wrote:
> On 2/11/20 2:38 PM, Kirill Tkhai wrote:
>> Leaving mem_cgroup_iter() loop requires mem_cgroup_iter_break().
>>
>> Fixes: bf8d5d52ffe8 "memcg: introduce memory.min"
>> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
>> ---
>>  mm/vmscan.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index b1863de475fb..f6efe2348ba3 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -2653,8 +2653,9 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
>>  				continue;
>>  			}
>>  			memcg_memory_event(memcg, MEMCG_LOW);
>> -			break;
> 
> It is not cycle break, it is switch/case break.

Oh, I missed this, thanks.
 
>> +			/* fallthrough */
>>  		case MEMCG_PROT_NONE:
>> +			mem_cgroup_iter_break(target_memcg, memcg);
>>  			/*
>>  			 * All protection thresholds breached. We may
>>  			 * still choose to vary the scan pressure
>>
>>
diff mbox series

Patch

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b1863de475fb..f6efe2348ba3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2653,8 +2653,9 @@  static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
 				continue;
 			}
 			memcg_memory_event(memcg, MEMCG_LOW);
-			break;
+			/* fallthrough */
 		case MEMCG_PROT_NONE:
+			mem_cgroup_iter_break(target_memcg, memcg);
 			/*
 			 * All protection thresholds breached. We may
 			 * still choose to vary the scan pressure