linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Huang12 <ahuang12@lenovo.com>
To: Uladzislau Rezki <urezki@gmail.com>,
	Adrian Huang <adrianhuang0701@gmail.com>
Cc: 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 13:39:57 +0000	[thread overview]
Message-ID: <TYZPR03MB619290520C6552B540870C32B3DA2@TYZPR03MB6192.apcprd03.prod.outlook.com> (raw)
In-Reply-To: <ZogS_04dP5LlRlXN@pc636>

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>

-- Adrian


  reply	other threads:[~2024-07-08 13:40 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   ` Adrian Huang12 [this message]
2024-07-08 16:06     ` [External] " Uladzislau Rezki
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=TYZPR03MB619290520C6552B540870C32B3DA2@TYZPR03MB6192.apcprd03.prod.outlook.com \
    --to=ahuang12@lenovo.com \
    --cc=adrianhuang0701@gmail.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 \
    --cc=urezki@gmail.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