From: David Hildenbrand <david@redhat.com>
To: Roger Pau Monne <roger.pau@citrix.com>, linux-kernel@vger.kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
xen-devel@lists.xenproject.org, linux-mm@kvack.org
Subject: Re: [PATCH 3/3] memory: introduce an option to force onlining of hotplug memory
Date: Thu, 23 Jul 2020 13:52:02 +0200 [thread overview]
Message-ID: <18f3987f-d2ca-409b-951d-20381d96e3a8@redhat.com> (raw)
In-Reply-To: <21490d49-b2cf-a398-0609-8010bdb0b004@redhat.com>
On 23.07.20 13:37, David Hildenbrand wrote:
> On 23.07.20 10:45, Roger Pau Monne wrote:
>> Add an extra option to add_memory_resource that overrides the memory
>> hotplug online behavior in order to force onlining of memory from
>> add_memory_resource unconditionally.
>>
>> This is required for the Xen balloon driver, that must run the
>> online page callback in order to correctly process the newly added
>> memory region, note this is an unpopulated region that is used by Linux
>> to either hotplug RAM or to map foreign pages from other domains, and
>> hence memory hotplug when running on Xen can be used even without the
>> user explicitly requesting it, as part of the normal operations of the
>> OS when attempting to map memory from a different domain.
>>
>> Setting a different default value of memhp_default_online_type when
>> attaching the balloon driver is not a robust solution, as the user (or
>> distro init scripts) could still change it and thus break the Xen
>> balloon driver.
>
> I think we discussed this a couple of times before (even triggered by my
> request), and this is responsibility of user space to configure. Usually
> distros have udev rules to online memory automatically. Especially, user
> space should eb able to configure *how* to online memory.
>
> It's the admin/distro responsibility to configure this properly. In case
> this doesn't happen (or as you say, users change it), bad luck.
>
> E.g., virtio-mem takes care to not add more memory in case it is not
> getting onlined. I remember hyper-v has similar code to at least wait a
> bit for memory to get onlined.
>
> Nacked-by: David Hildenbrand <david@redhat.com>
>
Oh, BTW, I removed that "online" parameter in
commit f29d8e9c0191a2a02500945db505e5c89159c3f4
Author: David Hildenbrand <david@redhat.com>
Date: Fri Dec 28 00:35:36 2018 -0800
mm/memory_hotplug: drop "online" parameter from add_memory_resource()
Userspace should always be in charge of how to online memory and if memory
should be onlined automatically in the kernel. Let's drop the parameter
to overwrite this - XEN passes memhp_auto_online, just like add_memory(),
so we can directly use that instead internally.
Xen was passing "memhp_auto_online" since
commit 703fc13a3f6615e29ce3eb862275d7b58a5d03ba
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Tue Mar 15 14:56:52 2016 -0700
xen_balloon: support memory auto onlining policy
Add support for the newly added kernel memory auto onlining policy to
Xen ballon driver.
And before that I assume XEN was completely relying on udev rules to handle it. Parameter was introduced in
commit 31bc3858ea3ebcc3157b3f5f0e624c5962f5a7a6
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Tue Mar 15 14:56:48 2016 -0700
memory-hotplug: add automatic onlining policy for the newly added memory
Currently, all newly added memory blocks remain in 'offline' state
unless someone onlines them, some linux distributions carry special udev
rules like:
SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online"
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2020-07-23 11:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 8:45 [PATCH 0/3] xen/balloon: fixes for memory hotplug Roger Pau Monne
2020-07-23 8:45 ` [PATCH 1/3] xen/balloon: fix accounting in alloc_xenballooned_pages error path Roger Pau Monne
2020-07-23 8:45 ` [PATCH 2/3] xen/balloon: make the balloon wait interruptible Roger Pau Monne
2020-07-23 8:45 ` [PATCH 3/3] memory: introduce an option to force onlining of hotplug memory Roger Pau Monne
2020-07-23 11:37 ` David Hildenbrand
2020-07-23 11:52 ` David Hildenbrand [this message]
2020-07-23 12:23 ` Roger Pau Monné
2020-07-23 12:28 ` Jürgen Groß
2020-07-23 12:31 ` David Hildenbrand
2020-07-23 13:08 ` Roger Pau Monné
2020-07-23 13:14 ` David Hildenbrand
2020-07-23 13:25 ` Roger Pau Monné
2020-07-23 13:20 ` Jürgen Groß
2020-07-23 13:39 ` Roger Pau Monné
2020-07-23 13:49 ` Jürgen Groß
2020-07-23 13:22 ` David Hildenbrand
2020-07-23 13:47 ` David Hildenbrand
2020-07-23 13:53 ` Jürgen Groß
2020-07-23 13:59 ` Roger Pau Monné
2020-07-23 15:10 ` Jürgen Groß
2020-07-23 16:03 ` Andrew Cooper
2020-07-23 16:22 ` Roger Pau Monné
2020-07-23 17:39 ` David Hildenbrand
2020-07-24 7:28 ` Michal Hocko
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=18f3987f-d2ca-409b-951d-20381d96e3a8@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).