From: Eric Ren <renzhengeek@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-mm@kvack.org
Subject: Question about virtio_mm: why plug/unplug with 4MB granularity?
Date: Thu, 25 Nov 2021 19:27:07 +0800 [thread overview]
Message-ID: <7299f769-3dc8-1f77-c4f2-1e3dc7427689@gmail.com> (raw)
Hi David,
As the subject, I'm wondering if we can make virtio_mm plug/unplug with
futher more fine granularity like
2MB?
I gave it try as below, and it works.
1. Revert this patch: aac65321ba69("mm/memory_hotplug: simplify page
onlining");
2. Tell mm hotplug core invoke online page callback with order 9 with
changes as below;
```
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 5873563a3518..22a9636402b1 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -622,7 +622,9 @@ static int online_pages_range(unsigned long
start_pfn, unsigned long nr_pages,
* them as being online/belonging to this zone ("present").
*/
for (pfn = start_pfn; pfn < end_pfn; pfn += 1ul << order) {
- order = min(MAX_ORDER - 1, get_order(PFN_PHYS(end_pfn -
pfn)));
+ /* 2MB callback */
+ order = min(MAX_ORDER - 2, get_order(PFN_PHYS(end_pfn -
pfn)));
/* __free_pages_core() wants pfns to be aligned to the
order */
```
3. in virtio_mem driver, change subblock size to 2MB.
Thought the hack testing works, I'm feeling not safe.
Could you please help give some insights on these questions?
1. Is 4M a hard limitation?
2. What troubles we can foresee if using 2MB as granularity?
Best regards,
Eric
next reply other threads:[~2021-11-25 11:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 11:27 Eric Ren [this message]
2021-11-25 11:37 ` David Hildenbrand
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=7299f769-3dc8-1f77-c4f2-1e3dc7427689@gmail.com \
--to=renzhengeek@gmail.com \
--cc=david@redhat.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