[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221205130359.2c81c5df0fb777cf55495a02@linux-foundation.org>
Date: Mon, 5 Dec 2022 13:03:59 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Kefeng Wang <wangkefeng.wang@...wei.com>
Cc: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<xialonglong1@...wei.com>
Subject: Re: [PATCH] mm: add cond_resched() in swapin_walk_pmd_entry()
On Mon, 5 Dec 2022 22:03:27 +0800 Kefeng Wang <wangkefeng.wang@...wei.com> wrote:
> When handle MADV_WILLNEED in madvise(), the soflockup may be occurred
> in swapin_walk_pmd_entry() if swapin lots of memory on slow device,
> add a cond_resched() into it to avoid the possible softlockup.
>
> ...
>
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -226,6 +226,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
> put_page(page);
> }
> swap_read_unplug(splug);
> + cond_resched();
>
> return 0;
> }
I wonder if this would be better in walk_pmd_range(), to address other
very large walk attempts.
Powered by blists - more mailing lists