From: Uladzislau Rezki <urezki@gmail.com>
To: Adrian Huang12 <ahuang12@lenovo.com>
Cc: Uladzislau Rezki <urezki@gmail.com>,
Adrian Huang <adrianhuang0701@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jiwei JW10 Sun <sunjw10@lenovo.com>
Subject: Re: [External] Re: [PATCH 1/1] mm/vmalloc: Add preempt point in purge_vmap_node() when enabling kasan
Date: Mon, 8 Jul 2024 18:06:54 +0200 [thread overview]
Message-ID: <ZowOnkxaFbqxv6sW@pc636> (raw)
In-Reply-To: <TYZPR03MB619290520C6552B540870C32B3DA2@TYZPR03MB6192.apcprd03.prod.outlook.com>
On Mon, Jul 08, 2024 at 01:39:57PM +0000, Adrian Huang12 wrote:
> Hi,
>
> > Could you please test it:
> >
> > <snip>
> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 03b82fb8ecd3..6dc204b8495a
> > 100644
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> > @@ -2190,10 +2190,12 @@ static void purge_vmap_node(struct work_struct
> > *work) {
> > struct vmap_node *vn = container_of(work,
> > struct vmap_node, purge_work);
> > + unsigned long resched_threshold;
> > struct vmap_area *va, *n_va;
> > LIST_HEAD(local_list);
> >
> > vn->nr_purged = 0;
> > + resched_threshold = lazy_max_pages() << 1;
> >
> > list_for_each_entry_safe(va, n_va, &vn->purge_list, list) {
> > unsigned long nr = (va->va_end - va->va_start) >> PAGE_SHIFT; @@
> > -2210,6 +2212,9 @@ static void purge_vmap_node(struct work_struct *work)
> > atomic_long_sub(nr, &vmap_lazy_nr);
> > vn->nr_purged++;
> >
> > + if (atomic_long_read(&vmap_lazy_nr) < resched_threshold)
> > + cond_resched();
> > +
> > if (is_vn_id_valid(vn_id) && !vn->skip_populate)
> > if (node_pool_add_va(vn, va))
> > continue;
> > <snip>
>
> This patch can fix the issue. Feel free to add my tested-by.
> Tested-by: Adrian Huang <ahuang12@lenovo.com>
>
Thank you. I will add you tested-by!
--
Uladzislau Rezki
next prev parent reply other threads:[~2024-07-08 16:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 13:08 Adrian Huang
2024-07-05 15:36 ` Uladzislau Rezki
2024-07-08 13:39 ` [External] " Adrian Huang12
2024-07-08 16:06 ` Uladzislau Rezki [this message]
2024-07-19 11:40 ` Uladzislau Rezki
2024-07-22 11:50 ` Adrian Huang
2024-07-22 12:40 ` Uladzislau Rezki
2024-07-23 10:50 ` Uladzislau Rezki
2024-07-24 12:46 ` Adrian Huang
2024-07-24 14:32 ` Uladzislau Rezki
2024-07-24 15:09 ` Uladzislau Rezki
2024-07-24 19:27 ` Uladzislau Rezki
2024-07-24 20:34 ` Uladzislau Rezki
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=ZowOnkxaFbqxv6sW@pc636 \
--to=urezki@gmail.com \
--cc=adrianhuang0701@gmail.com \
--cc=ahuang12@lenovo.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sunjw10@lenovo.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