linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "nifan.cxl@gmail.com" <nifan.cxl@gmail.com>
Cc: "david@redhat.com" <david@redhat.com>,
	"Jonathan.Cameron@huawei.com" <Jonathan.Cameron@huawei.com>,
	"Jiang, Dave" <dave.jiang@intel.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"osalvador@suse.de" <osalvador@suse.de>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"Huang, Ying" <ying.huang@intel.com>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"aneesh.kumar@linux.ibm.com" <aneesh.kumar@linux.ibm.com>,
	"Hocko, Michal" <mhocko@suse.com>,
	"jmoyer@redhat.com" <jmoyer@redhat.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH v8 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks
Date: Fri, 3 Nov 2023 19:09:03 +0000	[thread overview]
Message-ID: <eca45ac5fc08572038bb5d842de6bf7d6dc3821b.camel@intel.com> (raw)
In-Reply-To: <ZUUjGgB40u_tmRg9@debian>

On Fri, 2023-11-03 at 09:43 -0700, fan wrote:
> On Wed, Nov 01, 2023 at 04:51:52PM -0600, Vishal Verma wrote:
> > 
[..]
> >  
> > +static void __ref remove_memory_blocks_and_altmaps(u64 start, u64 size)
> > +{
> > +       unsigned long memblock_size = memory_block_size_bytes();
> > +       u64 cur_start;
> > +
> > +       /*
> > +        * For memmap_on_memory, the altmaps were added on a per-memblock
> > +        * basis; we have to process each individual memory block.
> > +        */
> > +       for (cur_start = start; cur_start < start + size;
> > +            cur_start += memblock_size) {
> > +               struct vmem_altmap *altmap = NULL;
> > +               struct memory_block *mem;
> > +
> > +               mem = find_memory_block(pfn_to_section_nr(PFN_DOWN(cur_start)));
> > +               WARN_ON_ONCE(!mem);
> > +               if (!mem)
> > +                       continue;
> > +
> > +               altmap = mem->altmap;
> > +               mem->altmap = NULL;
> > +
> > +               remove_memory_block_devices(cur_start, memblock_size);
> 
> Is cur_start always aligned to memory_block_size_bytes? If not, the
> above function will return directly, is that a issue?
> 
Hi Fan,

Thanks for taking a look and the review (btw v9 is the latest revision
of these).

I think we're okay because the create side would've adding this memory
in the first place as it too does an alignment check for
memory_block_size_bytes.

Thanks
Vishal

  reply	other threads:[~2023-11-03 19:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01 22:51 [PATCH v8 0/3] mm: use memmap_on_memory semantics for dax/kmem Vishal Verma
2023-11-01 22:51 ` [PATCH v8 1/3] mm/memory_hotplug: replace an open-coded kmemdup() in add_memory_resource() Vishal Verma
2023-11-03 16:26   ` fan
2023-11-01 22:51 ` [PATCH v8 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks Vishal Verma
2023-11-02  1:16   ` Huang, Ying
2023-11-02  1:27     ` Verma, Vishal L
2023-11-02  8:54   ` David Hildenbrand
2023-11-03 16:43   ` fan
2023-11-03 19:09     ` Verma, Vishal L [this message]
2023-11-01 22:51 ` [PATCH v8 3/3] dax/kmem: allow kmem to add memory with memmap_on_memory Vishal Verma

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=eca45ac5fc08572038bb5d842de6bf7d6dc3821b.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=david@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=nifan.cxl@gmail.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=osalvador@suse.de \
    --cc=ying.huang@intel.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