mm/madvise: pageout under plugging
Subsystems (3)
PATCH 1/1 mm/madvise: pageout under plugging
Likewise shrink_lruvec[1], madvise_pageout could get the benefit from per-task block plug.
[1] 3da367c3e5fc, vmscan: add block plug for page reclaim
--- mm/vmscan.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/vmscan.c +4 -0
@@ -2556,6 +2556,7 @@ unsigned long reclaim_pages(struct list_head *page_list)struct reclaim_stat dummy_stat;struct page *page;unsigned int noreclaim_flag; +struct blk_plug plug;struct scan_control sc = { .gfp_mask =GFP_KERNEL , .may_writepage =1 ,
@@ -2564,6 +2565,7 @@ unsigned long reclaim_pages(struct list_head *page_list) .no_demotion = 1, }; +blk_start_plug (&plug); noreclaim_flag =memalloc_noreclaim_save ();while (!list_empty (page_list)) {
@@ -2603,6 +2605,8 @@ unsigned long reclaim_pages(struct list_head *page_list) }memalloc_noreclaim_restore (noreclaim_flag); +blk_finish_plug (&plug); +return nr_reclaimed; }
Signature · 1 line
2.34.1.173.g76aa8bc2d0-goog
Hi:
Quoted 4 lines · Minchan Kim
Likewise shrink_lruvec[1],
madvise_pageoutcould get the benefit from per-task block plug.[1]
3da367c3e5fc, vmscan: add block plug for page reclaim
It seems there is a block plug in the caller do_madvise already. This one might not be necessary for madvise.
Many thanks.
Quoted 35 lines
Signed-off-by Minchan Kim <[email protected]>--- mm/vmscan.c | 4 ++++ 1 file changed, 4 insertions(+)mm/vmscan.c +4
-0@@ -2556,6 +2556,7 @@ unsigned long reclaim_pages(struct list_head *page_list)struct reclaim_stat dummy_stat;struct page *page;unsigned int noreclaim_flag; +struct blk_plug plug;struct scan_control sc = { .gfp_mask =GFP_KERNEL , .may_writepage =1 ,@@ -2564,6 +2565,7 @@ unsigned long reclaim_pages(struct list_head *page_list) .no_demotion = 1, }; +blk_start_plug (&plug); noreclaim_flag =memalloc_noreclaim_save ();while (!list_empty (page_list)) {@@ -2603,6 +2605,8 @@ unsigned long reclaim_pages(struct list_head *page_list) }memalloc_noreclaim_restore (noreclaim_flag); +blk_finish_plug (&plug); +return nr_reclaimed; }
Quoted 9 lines · Miaohe Lin
Hi:
Quoted 4 lines · Minchan Kim
Likewise shrink_lruvec[1],
madvise_pageoutcould get the benefit from per-task block plug.[1]
3da367c3e5fc, vmscan: add block plug for page reclaimIt seems there is a block plug in the caller
do_madvisealready. This one might not be necessary for madvise.
I missed the place where it was already doing.
I will drop it.
Thanks for the catch.