linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: "Björn Töpel" <bjorn@kernel.org>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"David Hildenbrand" <david@redhat.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	linux-riscv@lists.infradead.org,
	"Björn Töpel" <bjorn@rivosinc.com>,
	"Andrew Bresticker" <abrestic@rivosinc.com>,
	"Chethan Seshadri" <Chethan.Seshadri@catalinasystems.io>,
	"Lorenzo Stoakes" <lstoakes@gmail.com>,
	"Santosh Mamila" <santosh.mamila@catalinasystems.io>,
	"Sivakumar Munnangi" <siva.munnangi@catalinasystems.io>,
	"Sunil V L" <sunilvl@ventanamicro.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v3 5/9] riscv: mm: Add memory hotplugging support
Date: Tue, 21 May 2024 16:20:31 +0200	[thread overview]
Message-ID: <ZkytryG_cAhjLaQT@localhost.localdomain> (raw)
In-Reply-To: <CAHVXubi_yQ6L5g4dODoHMNvgO6kHy8i6YskRXSPoTU4N2P8rUA@mail.gmail.com>

On Tue, May 21, 2024 at 03:19:37PM +0200, Alexandre Ghiti wrote:
> On Tue, May 21, 2024 at 1:49 PM Björn Töpel <bjorn@kernel.org> wrote:
> > +       if (PageReserved(page)) {
> > +               __ClearPageReserved(page);
> 
> What's the difference between __ClearPageReserved() and
> ClearPageReserved()? Because it seems like free_reserved_page() calls
> the latter already, so why would you need to call
> __ClearPageReserved() on the first page?

__{Set,Clear}Page are the non-atomic version.
Usually used when you know that no one else can fiddle with the page, which
should be the case here since we are removing the memory.

As to why we have __ClearPageReserved and then having
free_reserved_page() call ClearPageReserved I do not really know.
Looking at the history, it has always been like this.

I remember I looked at this a few years ago but I cannot remember the outcome
of that.

Maybe David remembers better, but I think we could remove that
__ClearPageReserved.
Looking at powerpc implementation code, it does not do the
__ClearPageReserved and relies only on free_reserved_page().

I will have a look.

-- 
Oscar Salvador
SUSE Labs


  parent reply	other threads:[~2024-05-21 14:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 11:48 [PATCH v3 0/9] riscv: Memory Hot(Un)Plug support Björn Töpel
2024-05-21 11:48 ` [PATCH v3 1/9] riscv: mm: Properly forward vmemmap_populate() altmap parameter Björn Töpel
2024-05-21 12:22   ` Alexandre Ghiti
2024-05-21 11:48 ` [PATCH v3 2/9] riscv: mm: Pre-allocate vmemmap/direct map PGD entries Björn Töpel
2024-05-21 16:09   ` Björn Töpel
2024-05-21 11:48 ` [PATCH v3 3/9] riscv: mm: Change attribute from __init to __meminit for page functions Björn Töpel
2024-05-21 12:35   ` Alexandre Ghiti
2024-05-21 11:48 ` [PATCH v3 4/9] riscv: mm: Refactor create_linear_mapping_range() for memory hot add Björn Töpel
2024-05-21 11:48 ` [PATCH v3 5/9] riscv: mm: Add memory hotplugging support Björn Töpel
2024-05-21 13:19   ` Alexandre Ghiti
2024-05-21 14:18     ` Björn Töpel
2024-05-21 14:20     ` Oscar Salvador [this message]
2024-05-21 11:48 ` [PATCH v3 6/9] riscv: mm: Take memory hotplug read-lock during kernel page table dump Björn Töpel
2024-05-21 11:48 ` [PATCH v3 7/9] riscv: Enable memory hotplugging for RISC-V Björn Töpel
2024-05-21 13:23   ` Alexandre Ghiti
2024-05-21 11:48 ` [PATCH v3 8/9] virtio-mem: Enable virtio-mem " Björn Töpel
2024-05-21 11:48 ` [PATCH v3 9/9] riscv: mm: Add support for ZONE_DEVICE Björn Töpel
2024-05-21 13:41   ` Alexandre Ghiti
2024-05-21 14:13     ` Björn Töpel

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=ZkytryG_cAhjLaQT@localhost.localdomain \
    --to=osalvador@suse.de \
    --cc=Chethan.Seshadri@catalinasystems.io \
    --cc=abrestic@rivosinc.com \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bjorn@kernel.org \
    --cc=bjorn@rivosinc.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lstoakes@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=santosh.mamila@catalinasystems.io \
    --cc=siva.munnangi@catalinasystems.io \
    --cc=sunilvl@ventanamicro.com \
    --cc=virtualization@lists.linux-foundation.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