linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab()
@ 2020-10-16  3:39 Xianting Tian
  2020-10-16 12:07 ` Michal Hocko
  0 siblings, 1 reply; 7+ messages in thread
From: Xianting Tian @ 2020-10-16  3:39 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Xianting Tian

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@h3c.com>
---
 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-16 15:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16  3:39 [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab() Xianting Tian
2020-10-16 12:07 ` Michal Hocko
2020-10-16 12:48   ` Tianxianting
2020-10-16 13:02     ` Michal Hocko
2020-10-16 13:20       ` Tianxianting
2020-10-16 13:44         ` Michal Hocko
2020-10-16 14:33           ` Tianxianting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox