[PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()

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

 



In shrink_slab(), it directly goes to 'out' label only when it
can't get the lock of shrinker_rwsew. In this case, it doesn't
do the real work of shrinking slab, so we don't need trigger a
reschedule by cond_resched().

Signed-off-by: Xianting Tian <tian.xianting@xxxxxxx>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 466fc3144..676e97b28 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -687,8 +687,9 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
 	}
 
 	up_read(&shrinker_rwsem);
-out:
+
 	cond_resched();
+out:
 	return freed;
 }
 
-- 
2.17.1





[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