* [PATCH] mm/madvise: pageout under plugging
@ 2021-12-10 0:30 Minchan Kim
2021-12-10 2:02 ` Miaohe Lin
0 siblings, 1 reply; 3+ messages in thread
From: Minchan Kim @ 2021-12-10 0:30 UTC (permalink / raw)
To: Andrew Morton
Cc: Jens Axboe, linux-mm, LKML, Suren Baghdasaryan, John Dias, Minchan Kim
Likewise shrink_lruvec[1], madvise_pageout could get the benefit
from per-task block plug.
[1] 3da367c3e5fc, vmscan: add block plug for page reclaim
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
mm/vmscan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index fb9584641ac7..cf11113f6adb 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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;
}
--
2.34.1.173.g76aa8bc2d0-goog
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/madvise: pageout under plugging
2021-12-10 0:30 [PATCH] mm/madvise: pageout under plugging Minchan Kim
@ 2021-12-10 2:02 ` Miaohe Lin
2021-12-10 3:25 ` Minchan Kim
0 siblings, 1 reply; 3+ messages in thread
From: Miaohe Lin @ 2021-12-10 2:02 UTC (permalink / raw)
To: Minchan Kim, Andrew Morton
Cc: Jens Axboe, linux-mm, LKML, Suren Baghdasaryan, John Dias
Hi:
On 2021/12/10 8:30, Minchan Kim wrote:
> Likewise shrink_lruvec[1], madvise_pageout could 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.
> Signed-off-by: Minchan Kim <minchan@kernel.org>
> ---
> mm/vmscan.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index fb9584641ac7..cf11113f6adb 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/madvise: pageout under plugging
2021-12-10 2:02 ` Miaohe Lin
@ 2021-12-10 3:25 ` Minchan Kim
0 siblings, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2021-12-10 3:25 UTC (permalink / raw)
To: Miaohe Lin
Cc: Andrew Morton, Jens Axboe, linux-mm, LKML, Suren Baghdasaryan, John Dias
On Fri, Dec 10, 2021 at 10:02:24AM +0800, Miaohe Lin wrote:
> Hi:
> On 2021/12/10 8:30, Minchan Kim wrote:
> > Likewise shrink_lruvec[1], madvise_pageout could 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.
I missed the place where it was already doing.
I will drop it.
Thanks for the catch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-10 3:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 0:30 [PATCH] mm/madvise: pageout under plugging Minchan Kim
2021-12-10 2:02 ` Miaohe Lin
2021-12-10 3:25 ` Minchan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox