From: Andrew Morton <akpm@linux-foundation.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<xialonglong1@huawei.com>
Subject: Re: [PATCH] mm: add cond_resched() in swapin_walk_pmd_entry()
Date: Mon, 5 Dec 2022 13:03:59 -0800 [thread overview]
Message-ID: <20221205130359.2c81c5df0fb777cf55495a02@linux-foundation.org> (raw)
In-Reply-To: <20221205140327.72304-1-wangkefeng.wang@huawei.com>
On Mon, 5 Dec 2022 22:03:27 +0800 Kefeng Wang <wangkefeng.wang@huawei.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.
next prev parent reply other threads:[~2022-12-05 21:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 14:03 Kefeng Wang
2022-12-05 21:03 ` Andrew Morton [this message]
2022-12-06 1:40 ` Kefeng Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221205130359.2c81c5df0fb777cf55495a02@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=wangkefeng.wang@huawei.com \
--cc=xialonglong1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox