From bcf1e503f5ed774dc28126a0f1a8c839717eafac Mon Sep 17 00:00:00 2001 From: Martin Liu Date: Mon, 14 Nov 2022 11:50:47 +0800 Subject: [PATCH] ANDROID: adjust vendor hook to control blk_plug We shouldn't hold lru_lock to proceed blk_finish_plug. Fixes: 89fed37332fd ("ANDROID: vendor hook to control blk_plug for shrink_lruvec") Bug: 255471591 Change-Id: Ie9d9b0e4ee76b4735e802b2a202fbb79d0ae090e Signed-off-by: Martin Liu --- mm/vmscan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 02d2172afe89..8a6f6479cd71 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2051,8 +2051,6 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, spin_lock_irq(&pgdat->lru_lock); move_pages_to_lru(lruvec, &page_list); - if (do_plug) - blk_finish_plug(&plug); __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); lru_note_cost(lruvec, file, stat.nr_pageout); @@ -2064,6 +2062,9 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, spin_unlock_irq(&pgdat->lru_lock); + if (do_plug) + blk_finish_plug(&plug); + mem_cgroup_uncharge_list(&page_list); free_unref_page_list(&page_list);