public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Muchun Song <songmuchun@bytedance.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Muchun Song <muchun.song@linux.dev>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/sparse: Remove sparse buffer pre-allocation mechanism
Date: Mon, 13 Apr 2026 21:02:43 +0200	[thread overview]
Message-ID: <abf05960-87e7-4f2d-9a10-d6ec419eb2f6@kernel.org> (raw)
In-Reply-To: <20260410092419.2446420-1-songmuchun@bytedance.com>

> -
> -void * __meminit sparse_buffer_alloc(unsigned long size)
> -{
> -	void *ptr = NULL;
> -
> -	if (sparsemap_buf) {
> -		ptr = (void *) roundup((unsigned long)sparsemap_buf, size);
> -		if (ptr + size > sparsemap_buf_end)
> -			ptr = NULL;
> -		else {
> -			/* Free redundant aligned space */
> -			if ((unsigned long)(ptr - sparsemap_buf) > 0)
> -				sparse_buffer_free((unsigned long)(ptr - sparsemap_buf));
> -			sparsemap_buf = ptr + size;

This code implied, that we would usually get contiguous memory sections
(on the same node) to have contiguous PFNs in the SPARSE !VMEMMAP case.
That will no longer be the case (reliably).

The code must be prepared to handle that, so I guess that is fine. And
we don't care that much about SPARSE !VMEMMAP.

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

-- 
Cheers,

David


      parent reply	other threads:[~2026-04-13 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  9:24 [PATCH v2] mm/sparse: Remove sparse buffer pre-allocation mechanism Muchun Song
2026-04-12 16:26 ` Mike Rapoport
2026-04-13 19:02 ` David Hildenbrand (Arm) [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=abf05960-87e7-4f2d-9a10-d6ec419eb2f6@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=rppt@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /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