linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shivam Kalra <shivamkalra98@zohomail.in>
To: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Danilo Krummrich <dakr@kernel.org>
Subject: Re: [PATCH v9 3/4] mm/vmalloc: free unused pages on vrealloc() shrink
Date: Thu, 2 Apr 2026 08:23:42 +0530	[thread overview]
Message-ID: <31bb8a8e-2ca0-486b-888a-328e9b748ac4@zohomail.in> (raw)
In-Reply-To: <7bc4bba9-24ed-4a69-b9bd-d45d647f48b7@zohomail.in>

On 02/04/26 07:31, Shivam Kalra wrote:
> On 02/04/26 02:49, Alice Ryhl wrote:
> Should we set nr_pages first? Right now, another thread may observe the
> range being unmapped but still see the old nr_pages value.

Or is this what you mean?
<snip>
struct vmap_node *vn = addr_to_node(addr);
/* Notify kmemleak of the reduced allocation size before unmapping. */
kmemleak_free_part(...);

spin_lock(&vn->busy.lock);
vm->nr_pages = new_nr_pages;
spin_unlock(&vn->busy.lock);

vunmap_range(...);
vm_area_free_pages(vm, new_nr_pages, old_nr_pages);

<snip>
If this is the case, then I agree this will be much cleaner.


  reply	other threads:[~2026-04-02  2:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01 17:16 [PATCH v9 0/4] " Shivam Kalra via B4 Relay
2026-04-01 17:16 ` [PATCH v9 1/4] mm/vmalloc: extract vm_area_free_pages() helper from vfree() Shivam Kalra via B4 Relay
2026-04-01 17:16 ` [PATCH v9 2/4] mm/vmalloc: use physical page count for vrealloc() grow-in-place check Shivam Kalra via B4 Relay
2026-04-01 17:16 ` [PATCH v9 3/4] mm/vmalloc: free unused pages on vrealloc() shrink Shivam Kalra via B4 Relay
2026-04-01 21:19   ` Alice Ryhl
2026-04-02  2:01     ` Shivam Kalra
2026-04-02  2:53       ` Shivam Kalra [this message]
2026-04-07  8:06         ` Alice Ryhl
2026-04-07 11:05           ` Shivam Kalra
2026-04-01 17:16 ` [PATCH v9 4/4] lib/test_vmalloc: add vrealloc test case Shivam Kalra via B4 Relay

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=31bb8a8e-2ca0-486b-888a-328e9b748ac4@zohomail.in \
    --to=shivamkalra98@zohomail.in \
    --cc=akpm@linux-foundation.org \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --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