linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Ranjan, Vikash" <Vikash.Ranjan@harman.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: memory_block_size reduction in memory hot plug, can we reduced it to 1GB,currently it is 4GB
Date: Thu, 6 Jan 2022 07:04:16 +0000	[thread overview]
Message-ID: <14101f99fda548dc960e2041a6807536@HIBDWSMB03.ad.harman.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 564 bytes --]

  Hello Kernel Memory Team,


We are trying to enable memory hot plug for our device's based on arm64, is it possible to reduce memory_block_size to 1 GB or lesser as currently it is 4GB.

If you have any info on updated patch or any other way we can do this, please let us know.
 After applying attached test patch (for reduction of memory_block_size to 1 GB),we are getting below error. Probe is working fine in case of 4GB.
 root@sys:/sys/devices/system/memory# echo 0x980000000  > /sys/devices/system/memory/probe
echo: write error

Thanks,
Vikash

[-- Attachment #1.2: Type: text/html, Size: 2733 bytes --]

[-- Attachment #2: hotplug.patch --]
[-- Type: application/octet-stream, Size: 1729 bytes --]

diff --git a/arch/arm64/configs/exynosauto9_linux_vm_defconfig b/arch/arm64/configs/exynosauto9_linux_vm_defconfig
index 2567f5bc24f1..54bf4618c9ca 100644
--- a/arch/arm64/configs/exynosauto9_linux_vm_defconfig
+++ b/arch/arm64/configs/exynosauto9_linux_vm_defconfig

+CONFIG_SPARSEMEM=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_ARCH_MEMORY_PROBE=y
+CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 5a8c430fb8ff..3d2988b4bfed 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -469,7 +469,7 @@ static DEVICE_ATTR_RW(auto_online_blocks);
  * as well as ppc64 will do all of their discovery in userspace
  * and will require this interface.
  */
-#ifdef CONFIG_ARCH_MEMORY_PROBE
+//#ifdef CONFIG_ARCH_MEMORY_PROBE
 static ssize_t probe_store(struct device *dev, struct device_attribute *attr,
                           const char *buf, size_t count)
 {
@@ -490,7 +490,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr,

        nid = memory_add_physaddr_to_nid(phys_addr);
        ret = __add_memory(nid, phys_addr,
-                          MIN_MEMORY_BLOCK_SIZE * sections_per_block);
+                          (MIN_MEMORY_BLOCK_SIZE/4) * sections_per_block);

        if (ret)
                goto out;
@@ -502,7 +502,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr,
 }

 static DEVICE_ATTR_WO(probe);
-#endif
+//#endif

 #ifdef CONFIG_MEMORY_FAILURE
 /*
@@ -756,9 +756,9 @@ bool is_memblock_offlined(struct memory_block *mem)
 }

 static struct attribute *memory_root_attrs[] = {
-#ifdef CONFIG_ARCH_MEMORY_PROBE
+//#ifdef CONFIG_ARCH_MEMORY_PROBE
        &dev_attr_probe.attr,
-#endif
+//#endif

             reply	other threads:[~2022-01-06  7:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06  7:04 Ranjan, Vikash [this message]
2022-01-09 12:25 ` David Hildenbrand
2022-01-10 16:07   ` [EXTERNAL] Re: memory_block_size reduction in memory hot plug, can we reduced it to 1GB, currently " Ranjan, Vikash
2022-01-10 16:22     ` David Hildenbrand
2022-01-11  3:53       ` Ranjan, Vikash

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=14101f99fda548dc960e2041a6807536@HIBDWSMB03.ad.harman.com \
    --to=vikash.ranjan@harman.com \
    --cc=linux-mm@kvack.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