From: Andrew Morton <akpm@linux-foundation.org>
To: Jeongjun Park <aha310510@gmail.com>
Cc: urezki@gmail.com, edumazet@google.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mm/vmalloc: fix data race in show_numa_info()
Date: Wed, 7 May 2025 15:33:25 -0700 [thread overview]
Message-ID: <20250507153325.48726051dbbff4f3936a83ff@linux-foundation.org> (raw)
In-Reply-To: <20250507142552.9446-1-aha310510@gmail.com>
On Wed, 7 May 2025 23:25:52 +0900 Jeongjun Park <aha310510@gmail.com> wrote:
> The following data-race was found in show_numa_info():
>
> ...
>
>
> According to this report, there is a read/write data-race because m->private
> is accessible to multiple CPUs. To fix this, instead of allocating the heap
> in proc_vmalloc_init() and passing the heap address to m->private,
> show_numa_info() should allocate the heap.
>
> One thing to note is that show_numa_info() is called in a critical section
> of a spinlock, so it must be allocated on the heap with GFP_ATOMIC flag.
GFP_ATOMIC is unfortunate. Can vmalloc_info_show() allocate the
storage outside the lock and pass that pointer into show_numa_info()?
That way will be more efficient also, less allocating and freeing.
next prev parent reply other threads:[~2025-05-07 22:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 14:25 Jeongjun Park
2025-05-07 22:33 ` Andrew Morton [this message]
2025-05-08 4:47 ` Jeongjun Park
2025-05-08 7:56 ` Ozgur Kara
2025-05-07 22:50 ` Ozgur Kara
[not found] ` <01100196acf1ede5-ae116361-04f2-4e8f-b7a4-7079d6158ffb-000000@eu-north-1.amazonses.com>
2025-05-08 5:04 ` Jeongjun Park
2025-05-08 6:18 ` Jeongjun Park
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=20250507153325.48726051dbbff4f3936a83ff@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aha310510@gmail.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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