[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 2 Mar 2020 17:22:03 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Minchan Kim <minchan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>,
Josef Bacik <josef@...icpanda.com>,
Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH v2] mm: fix long time stall from mm_populate
On Mon, Mar 02, 2020 at 04:26:38PM -0800, Minchan Kim wrote:
> @@ -1196,6 +1196,7 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
> struct vm_area_struct *vma = NULL;
> int locked = 0;
> long ret = 0;
> + bool tried = false;
How about ...
int *lockedp = &locked;
>
> end = start + len;
>
> @@ -1226,14 +1227,18 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
> * double checks the vma flags, so that it won't mlock pages
> * if the vma was already munlocked.
> */
> - ret = populate_vma_page_range(vma, nstart, nend, &locked);
> + ret = populate_vma_page_range(vma, nstart, nend,
> + tried ? NULL : &locked);
ret = populate_vma_page_range(vma, nstart, nend, lockedp);
> if (ret < 0) {
> if (ignore_errors) {
> ret = 0;
> continue; /* continue at next VMA */
> }
> break;
> - }
> + } else if (ret == 0)
> + tried = true;
> + else
> + tried = false;
} else if (ret == 0)
lockedp = NULL;
Maybe there's a better name than lockedp.
Powered by blists - more mailing lists