[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYZPR03MB619290520C6552B540870C32B3DA2@TYZPR03MB6192.apcprd03.prod.outlook.com>
Date: Mon, 8 Jul 2024 13:39:57 +0000
From: Adrian Huang12 <ahuang12@...ovo.com>
To: Uladzislau Rezki <urezki@...il.com>,
Adrian Huang
<adrianhuang0701@...il.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig
<hch@...radead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jiwei JW10 Sun
<sunjw10@...ovo.com>
Subject: RE: [External] Re: [PATCH 1/1] mm/vmalloc: Add preempt point in
purge_vmap_node() when enabling kasan
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@...ovo.com>
-- Adrian
Powered by blists - more mailing lists