[RHEL7,COMMIT] mm: Fixing rwsem_is_contented conditional code in shrink_slab_memcg

Submitted by Vasily Averin on Aug. 21, 2020, 2:41 p.m.

Details

Message ID 202008211441.07LEfjqL016647@vz7build.vvs.sw.ru
State New
Series "mm: Fixing rwsem_is_contented conditional code in shrink_slab_memcg"
Headers show

Commit Message

Vasily Averin Aug. 21, 2020, 2:41 p.m.
The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.5
------>
commit 41057a6cdd8f0c3d4c8bf9cb4ad5254b62127b98
Author: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
Date:   Fri Aug 21 17:41:44 2020 +0300

    mm: Fixing rwsem_is_contented conditional code in shrink_slab_memcg
    
    Fixes commit 38afbd5ecdd6 ("Reduce access frequency to shrinker_rwsem during shrink_slab")
    that partially reverts code in shrink_slab_memcg by adding missing line.
    
    https://jira.sw.ru/browse/PSBM-99181
    
    Signed-off-by: Valeriy Vdovin <valeriy.vdovin@virtuozzo.com>
---
 mm/vmscan.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4fa86e7..13ae9bd 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -598,6 +598,7 @@  static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid,
 			map = memcg_nid_shrinker_map(memcg, nid);
 			nr_max = min(shrinker_nr_max, map->nr_max);
 		} else if (rwsem_is_contended(&shrinker_rwsem)) {
+			freed = freed ? : 1;
 			break;
 		}
 	}