[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPcyv4iqwh6k40DUy-Pwi2h5pJm9vu7+JU1ghELy=3MGM1naNg@mail.gmail.com>
Date: Sat, 2 May 2020 11:03:01 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: David Hildenbrand <david@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>, virtio-dev@...ts.oasis-open.org,
virtualization@...ts.linux-foundation.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Linux ACPI <linux-acpi@...r.kernel.org>,
linux-nvdimm <linux-nvdimm@...ts.01.org>,
linux-hyperv@...r.kernel.org,
linux-s390 <linux-s390@...r.kernel.org>,
xen-devel <xen-devel@...ts.xenproject.org>,
Michal Hocko <mhocko@...nel.org>,
"Michael S . Tsirkin" <mst@...hat.com>,
Michal Hocko <mhocko@...e.com>,
Pankaj Gupta <pankaj.gupta.linux@...il.com>,
Wei Yang <richard.weiyang@...il.com>,
Baoquan He <bhe@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH v2 2/3] mm/memory_hotplug: Introduce MHP_NO_FIRMWARE_MEMMAP
On Sat, May 2, 2020 at 2:27 AM David Hildenbrand <david@...hat.com> wrote:
>
> >> Now, let's clarify what I want regarding virtio-mem:
> >>
> >> 1. kexec should not add virtio-mem memory to the initial firmware
> >> memmap. The driver has to be in charge as discussed.
> >> 2. kexec should not place kexec images onto virtio-mem memory. That
> >> would end badly.
> >> 3. kexec should still dump virtio-mem memory via kdump.
> >
> > Ok, but then seems to say to me that dax/kmem is a different type of
> > (driver managed) than virtio-mem and it's confusing to try to apply
> > the same meaning. Why not just call your type for the distinct type it
> > is "System RAM (virtio-mem)" and let any other driver managed memory
> > follow the same "System RAM ($driver)" format if it wants?
>
> I had the same idea but discarded it because it seemed to uglify the
> add_memory() interface (passing yet another parameter only relevant for
> driver managed memory). Maybe we really want a new one, because I like
> that idea:
>
> /*
> * Add special, driver-managed memory to the system as system ram.
> * The resource_name is expected to have the name format "System RAM
> * ($DRIVER)", so user space (esp. kexec-tools)" can special-case it.
> *
> * For this memory, no entries in /sys/firmware/memmap are created,
> * as this memory won't be part of the raw firmware-provided memory map
> * e.g., after a reboot. Also, the created memory resource is flagged
> * with IORESOURCE_MEM_DRIVER_MANAGED, so in-kernel users can special-
> * case this memory (e.g., not place kexec images onto it).
> */
> int add_memory_driver_managed(int nid, u64 start, u64 size,
> const char *resource_name);
>
>
> If we'd ever have to special case it even more in the kernel, we could
> allow to specify further resource flags. While passing the driver name
> instead of the resource_name would be an option, this way we don't have
> to hand craft new resource strings for added memory resources.
>
> Thoughts?
Looks useful to me and simplifies walking /proc/iomem. I personally
like the safety of the string just being the $driver component of the
name, but I won't lose sleep if the interface stays freeform like you
propose.
Powered by blists - more mailing lists