linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shivam Kalra <shivamkalra98@zohomail.in>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: Alice Ryhl <aliceryhl@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Danilo Krummrich <dakr@kernel.org>
Subject: Re: [PATCH v10 0/4] mm/vmalloc: free unused pages on vrealloc() shrink
Date: Fri, 17 Apr 2026 23:04:21 +0530	[thread overview]
Message-ID: <20d2e9f5-9b4a-477d-b3a0-5a268364d70f@zohomail.in> (raw)
In-Reply-To: <aeJs4jmco7BGCNHq@milan>

On 17/04/26 22:54, Uladzislau Rezki wrote:
> I have some questions to clarify.
> 
> Why should we use min()?
> Checking vm->nr_pages, can it be 0?
> 
> Can we just do:
> 
> if (vm)
>    /* Can not use get_vm_area_size() because of realloc(). */
>    size = vm->nr_pages << PAGE_SHIFT;
> else
>    size = va_size(va);
> 
> or i am missing something?
> 
> Thanks!
> 
> --
> Uladzislau Rezki
I honestly don't know much about the usage
of this function, so wanted to be cautious.

1. We can skip the usage of min though.
2. Do need (size_t) for overflow issue

I can include this simple version with size_t,
let me know your thoughts.


      reply	other threads:[~2026-04-17 17:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04  8:36 Shivam Kalra via B4 Relay
2026-04-04  8:36 ` [PATCH v10 1/4] mm/vmalloc: extract vm_area_free_pages() helper from vfree() Shivam Kalra via B4 Relay
2026-04-04  8:36 ` [PATCH v10 2/4] mm/vmalloc: use physical page count for vrealloc() grow-in-place check Shivam Kalra via B4 Relay
2026-04-04  8:36 ` [PATCH v10 3/4] mm/vmalloc: free unused pages on vrealloc() shrink Shivam Kalra via B4 Relay
2026-04-04  8:37 ` [PATCH v10 4/4] lib/test_vmalloc: add vrealloc test case Shivam Kalra via B4 Relay
2026-04-14  8:39 ` [PATCH v10 0/4] mm/vmalloc: free unused pages on vrealloc() shrink Shivam Kalra
2026-04-14 16:57   ` Alice Ryhl
2026-04-15 18:44     ` Uladzislau Rezki
2026-04-16  7:38       ` Shivam Kalra
2026-04-17 13:35       ` Shivam Kalra
2026-04-17 17:24         ` Uladzislau Rezki
2026-04-17 17:34           ` Shivam Kalra [this message]

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=20d2e9f5-9b4a-477d-b3a0-5a268364d70f@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