Re: [PATCH v2] virtio_balloon: add param to skip adjusting pages

2021-11-19 Thread David Hildenbrand
On 19.11.21 14:36, David Hildenbrand wrote: > On 19.11.21 08:22, David Stevens wrote: >> On Thu, Nov 18, 2021 at 8:17 PM David Hildenbrand wrote: >>> >>> On 18.11.21 10:11, David Stevens wrote: >>>> From: David Stevens >>> >>> Hi David

Re: [PATCH v2] virtio_balloon: add param to skip adjusting pages

2021-11-19 Thread David Hildenbrand
On 19.11.21 08:22, David Stevens wrote: > On Thu, Nov 18, 2021 at 8:17 PM David Hildenbrand wrote: >> >> On 18.11.21 10:11, David Stevens wrote: >>> From: David Stevens >> >> Hi David, >> >>> >>> Add a module parameters to virtio_ball

Re: [PATCH v2] virtio_balloon: add param to skip adjusting pages

2021-11-18 Thread David Hildenbrand
On 18.11.21 10:11, David Stevens wrote: > From: David Stevens Hi David, > > Add a module parameters to virtio_balloon to allow specifying whether or > not the driver should call adjust_managed_page_count. If the parameter > is set, it overrides the default behavior inferred from the deflate on

Re: [RFC PATCH 0/3] Use pageblock_order for cma and alloc_contig_range alignment.

2021-11-16 Thread David Hildenbrand
On 15.11.21 20:37, Zi Yan wrote: > From: Zi Yan > > Hi David, Hi, thanks for looking into this. > > You suggested to make alloc_contig_range() deal with pageblock_order instead > of > MAX_ORDER - 1 and get rid of MAX_ORDER - 1 dependency in virtio_mem[1]. This > patchset is my attempt to

Re: [GIT PULL] virtio-mem changes for v5.16

2021-11-13 Thread David Hildenbrand
On 10.11.21 17:37, David Hildenbrand wrote: > Hi Linus, > > usually this would have went via the vhost tree, but as this patch depends > on some patches that just went in via Andrews tree and MST doesn't have > any other patches for this merge window, I'm sending it my

Re: update_balloon_size_func blocked for more than 120 seconds

2021-11-12 Thread David Hildenbrand
On Thu, Nov 11, 2021 at 11:49 PM Luis Chamberlain wrote: > > I get the following splats with a kvm guest in idle, after a few seconds > it starts: > > [ 242.412806] INFO: task kworker/6:2:271 blockedfor more than 120 seconds. > [ 242.415790] Tainted: GE

[GIT PULL] virtio-mem changes for v5.16

2021-11-10 Thread David Hildenbrand
quired by some hypervisors implementing virtio-mem in the near future, so let's support it now that we safely can. Signed-off-by: David Hildenbrand -------- David Hildenbrand (1): virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE d

Re: [PATCH RFC] virtio: wrap config->reset calls

2021-10-13 Thread David Hildenbrand
On 13.10.21 14:17, Michael S. Tsirkin wrote: > On Wed, Oct 13, 2021 at 01:03:46PM +0200, David Hildenbrand wrote: >> On 13.10.21 12:55, Michael S. Tsirkin wrote: >>> This will enable cleanups down the road. >>> The idea is to disable cbs, then add "flush_queued_

Re: [PATCH RFC] virtio: wrap config->reset calls

2021-10-13 Thread David Hildenbrand
On 13.10.21 12:55, Michael S. Tsirkin wrote: This will enable cleanups down the road. The idea is to disable cbs, then add "flush_queued_cbs" callback as a parameter, this way drivers can flush any work queued after callbacks have been disabled. Signed-off-by: Michael S. Tsirkin ---

Re: [PATCH v1 6/6] x86: remove memory hotplug support on X86_32

2021-10-07 Thread David Hildenbrand
On 07.10.21 11:15, Oscar Salvador wrote: On Wed, Sep 29, 2021 at 04:36:00PM +0200, David Hildenbrand wrote: CONFIG_MEMORY_HOTPLUG was marked BROKEN over one year and we just restricted it to 64 bit. Let's remove the unused x86 32bit implementation and simplify the Kconfig. Signed-off-by: David

[PATCH v2] virtio-mem: support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

2021-10-06 Thread David Hildenbrand
c: Cornelia Huck Cc: Marek Kedzierski Cc: Hui Zhu Cc: Sebastien Boeuf Cc: Pankaj Gupta Cc: Wei Yang Signed-off-by: David Hildenbrand --- Michael, I want this patch in v5.16 if the following two series that are already queued by Andrew via the -MM tree go into v5.16 (which I I assume but we never

[PATCH v2 9/9] virtio-mem: kdump mode to sanitize /proc/vmcore access

2021-10-05 Thread David Hildenbrand
" when creating the vmcore header) and a recent dracut version (including the virtio_mem module in the kdump initrd). [1] https://lkml.kernel.org/r/20210526093041.8800-1-da...@redhat.com [2] https://github.com/dracutdevs/dracut/pull/1157 Signed-off-by: David Hildenbrand --- drivers/virti

[PATCH v2 8/9] virtio-mem: factor out hotplug specifics from virtio_mem_remove() into virtio_mem_deinit_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git

[PATCH v2 7/9] virtio-mem: factor out hotplug specifics from virtio_mem_probe() into virtio_mem_init_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 87 +++-- 1 file changed, 45 insertions(+), 42

[PATCH v2 6/9] virtio-mem: factor out hotplug specifics from virtio_mem_init() into virtio_mem_init_hotplug()

2021-10-05 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 81 - 1 file changed, 44 insertions(+), 37

[PATCH v2 5/9] proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks

2021-10-05 Thread David Hildenbrand
a callback after the vmcore has already been opened (warn and essentially read only zeroes from that point on). Signed-off-by: David Hildenbrand --- arch/x86/kernel/aperture_64.c | 13 - arch/x86/xen/mmu_hvm.c| 11 ++-- fs/proc/vmcore.c | 99

[PATCH v2 4/9] proc/vmcore: let pfn_is_ram() return a bool

2021-10-05 Thread David Hildenbrand
The callback should deal with errors internally, it doesn't make sense to expose these via pfn_is_ram(). We'll rework the callbacks next. Right now we consider errors as if "it's RAM"; no functional change. Signed-off-by: David Hildenbrand --- fs/proc/vmcore.c | 8 1 file

[PATCH v2 3/9] x86/xen: print a warning when HVMOP_get_mem_type fails

2021-10-05 Thread David Hildenbrand
Ostrovsky Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index d1b38c77352b..6ba8826dcdcc 100644 --- a/arch/x86/xen/mmu_hvm.c +++ b/arch/x86/xen/mmu_hvm.c @@ -22,8 +22,10

[PATCH v2 2/9] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-10-05 Thread David Hildenbrand
Let's simplify return handling. Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index b242d1f4b426..d1b38c77352b 100644 --- a/arch/x86/xen/mmu_hvm.c

[PATCH v2 1/9] x86/xen: update xen_oldmem_pfn_is_ram() documentation

2021-10-05 Thread David Hildenbrand
The callback is only used for the vmcore nowadays. Reviewed-by: Boris Ostrovsky Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index 57409373750f

[PATCH v2 0/9] proc/vmcore: sanitize access to virtio-mem memory

2021-10-05 Thread David Hildenbrand
c: Vivek Goyal Cc: Michal Hocko Cc: Oscar Salvador Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: x...@kernel.org Cc: xen-de...@lists.xenproject.org Cc: virtualization@lists.linux-foundation.org Cc: ke...@lists.infradead.org Cc: linux-fsde...@vger.kernel.org Cc: linux

Re: [PATCH v1 2/8] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-09-29 Thread David Hildenbrand
On 29.09.21 16:22, Boris Ostrovsky wrote: On 9/29/21 5:03 AM, David Hildenbrand wrote: On 29.09.21 10:45, David Hildenbrand wrote: Can we go one step further and do @@ -20,24 +20,11 @@ static int xen_oldmem_pfn_is_ram(unsigned long pfn)   struct xen_hvm_get_mem_type

[PATCH v1 6/6] x86: remove memory hotplug support on X86_32

2021-09-29 Thread David Hildenbrand
CONFIG_MEMORY_HOTPLUG was marked BROKEN over one year and we just restricted it to 64 bit. Let's remove the unused x86 32bit implementation and simplify the Kconfig. Signed-off-by: David Hildenbrand --- arch/x86/Kconfig | 6 +++--- arch/x86/mm/init_32.c | 31

[PATCH v1 5/6] mm/memory_hotplug: remove stale function declarations

2021-09-29 Thread David Hildenbrand
These functions no longer exist. Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index e5a867c950b2..be48e003a518 100644 --- a/include/linux/memory_hotplug.h

[PATCH v1 4/6] mm/memory_hotplug: remove HIGHMEM leftovers

2021-09-29 Thread David Hildenbrand
We don't support CONFIG_MEMORY_HOTPLUG on 32 bit and consequently not HIGHMEM. Let's remove any leftover code -- including the unused "status_change_nid_high" field part of the memory notifier. Signed-off-by: David Hildenbrand --- Documentation/core-api/memory-hotplug.rst | 3 --

[PATCH v1 3/6] mm/memory_hotplug: restrict CONFIG_MEMORY_HOTPLUG to 64 bit

2021-09-29 Thread David Hildenbrand
me HIGHMEM leftovers from memory hotplug code to clean up. Signed-off-by: David Hildenbrand --- mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index ea8762cd8e1e..88273dd5c6d6 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -125,7 +125,7 @@ c

[PATCH v1 2/6] mm/memory_hotplug: remove CONFIG_MEMORY_HOTPLUG_SPARSE

2021-09-29 Thread David Hildenbrand
CONFIG_MEMORY_HOTPLUG depends on CONFIG_SPARSEMEM, so there is no need for CONFIG_MEMORY_HOTPLUG_SPARSE anymore; adjust all instances to use CONFIG_MEMORY_HOTPLUG and remove CONFIG_MEMORY_HOTPLUG_SPARSE. Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/machdep.h| 2

[PATCH v1 1/6] mm/memory_hotplug: remove CONFIG_X86_64_ACPI_NUMA dependency from CONFIG_MEMORY_HOTPLUG

2021-09-29 Thread David Hildenbrand
def_bool y depends on X86_64 && NUMA && ACPI && PCI Let's just remove the CONFIG_X86_64_ACPI_NUMA dependency, as it does no longer make sense. Signed-off-by: David Hildenbrand --- mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v1 0/6] mm/memory_hotplug: Kconfig and 32 bit cleanups

2021-09-29 Thread David Hildenbrand
chal Hocko Cc: Oscar Salvador Cc: Mike Rapoport Cc: x...@kernel.org Cc: linux...@kvack.org Cc: linux-kselft...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: virtualization@lists.linux-foundation.org David Hildenbrand (6): mm/memory_hotplug: remove CONFIG_X8

Re: [PATCH v1 2/8] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-09-29 Thread David Hildenbrand
On 29.09.21 10:45, David Hildenbrand wrote: How about     return a.mem_type != HVMMEM_mmio_dm; Ha, how could I have missed that :) Result should be promoted to int and this has added benefit of not requiring changes in patch 4. Can we go one step further and do @@ -20,24 +20,11

Re: [PATCH v1 2/8] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-09-29 Thread David Hildenbrand
How about     return a.mem_type != HVMMEM_mmio_dm; Ha, how could I have missed that :) Result should be promoted to int and this has added benefit of not requiring changes in patch 4. Can we go one step further and do @@ -20,24 +20,11 @@ static int xen_oldmem_pfn_is_ram(unsigned

Re: [PATCH v1 8/8] virtio-mem: kdump mode to sanitize /proc/vmcore access

2021-09-29 Thread David Hildenbrand
[...] + +static bool virtio_mem_vmcore_pfn_is_ram(struct vmcore_cb *cb, +unsigned long pfn) +{ + struct virtio_mem *vm = container_of(cb, struct virtio_mem, +vmcore_cb); + uint64_t addr =

[PATCH v1 8/8] virtio-mem: kdump mode to sanitize /proc/vmcore access

2021-09-28 Thread David Hildenbrand
" when creating the vmcore header) and a recent dracut version (including the virtio_mem module in the kdump initrd). [1] https://lkml.kernel.org/r/20210526093041.8800-1-da...@redhat.com [2] https://github.com/dracutdevs/dracut/pull/1157 Signed-off-by: David Hildenbrand --- drivers/virti

[PATCH v1 7/8] virtio-mem: factor out hotplug specifics from virtio_mem_remove() into virtio_mem_deinit_hotplug()

2021-09-28 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git

[PATCH v1 6/8] virtio-mem: factor out hotplug specifics from virtio_mem_probe() into virtio_mem_init_hotplug()

2021-09-28 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 87 +++-- 1 file changed, 45 insertions(+), 42

[PATCH v1 5/8] virtio-mem: factor out hotplug specifics from virtio_mem_init() into virtio_mem_init_hotplug()

2021-09-28 Thread David Hildenbrand
Let's prepare for a new virtio-mem kdump mode in which we don't actually hot(un)plug any memory but only observe the state of device blocks. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 81 - 1 file changed, 44 insertions(+), 37

[PATCH v1 4/8] proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks

2021-09-28 Thread David Hildenbrand
a callback after the vmcore has already been opened (warn and essentially read only zeroes from that point on). Signed-off-by: David Hildenbrand --- arch/x86/kernel/aperture_64.c | 13 - arch/x86/xen/mmu_hvm.c| 15 +++--- fs/proc/vmcore.c | 99

[PATCH v1 3/8] proc/vmcore: let pfn_is_ram() return a bool

2021-09-28 Thread David Hildenbrand
The callback should deal with errors internally, it doesn't make sense to expose these via pfn_is_ram(). We'll rework the callbacks next. Right now we consider errors as if "it's RAM"; no functional change. Signed-off-by: David Hildenbrand --- fs/proc/vmcore.c | 8 1 file

[PATCH v1 2/8] x86/xen: simplify xen_oldmem_pfn_is_ram()

2021-09-28 Thread David Hildenbrand
Let's simplify return handling. Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index b242d1f4b426..eb61622df75b 100644 --- a/arch/x86/xen/mmu_hvm.c +++ b

[PATCH v1 1/8] x86/xen: update xen_oldmem_pfn_is_ram() documentation

2021-09-28 Thread David Hildenbrand
The callback is only used for the vmcore nowadays. Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index 57409373750f..b242d1f4b426 100644 --- a/arch/x86/xen

[PATCH v1 0/8] proc/vmcore: sanitize access to virtio-mem memory

2021-09-28 Thread David Hildenbrand
ang Cc: Dave Young Cc: Baoquan He Cc: Vivek Goyal Cc: Michal Hocko Cc: Oscar Salvador Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: x...@kernel.org Cc: xen-de...@lists.xenproject.org Cc: virtualization@lists.linux-foundation.org Cc: ke...@lists.infradead.org Cc: linux-fsde...@

[PATCH v5 3/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-20 Thread David Hildenbrand
cannot be restricticted -- if we have CONFIG_DEVMEM=y but CONFIG_STRICT_DEVMEM is not set. Reviewed-by: Dan Williams Acked-by: Michael S. Tsirkin Signed-off-by: David Hildenbrand --- drivers/virtio/Kconfig | 1 + drivers/virtio/virtio_mem.c | 4 +++- 2 files changed, 4 insertions(+), 1

[PATCH v5 1/3] kernel/resource: clean up and optimize iomem_is_exclusive()

2021-09-20 Thread David Hildenbrand
ly because the parent range is not of interest. Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- kernel/resource.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index ca9f5198a01f..2999f57da

[PATCH v5 2/3] kernel/resource: disallow access to exclusive system RAM regions

2021-09-20 Thread David Hildenbrand
no applicable ranges and we'll modify virtio-mem next to properly set IORESOURCE_EXCLUSIVE on the parent resource container it creates to contain all actual busy system RAM added via add_memory_driver_managed(). Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- kernel/resource.c | 29

[PATCH v5 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-20 Thread David Hildenbrand
Cc: Andrew Morton Cc: Dan Williams Cc: Hanjun Guo Cc: Andy Shevchenko Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org David Hildenbrand (3): kernel/resource: clean up and optimize iomem_is_exclusive() kernel/resource: disallow access to exclusive system RAM regions

Re: [PATCH v4 3/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-14 Thread David Hildenbrand
On 14.09.21 13:52, Michael S. Tsirkin wrote: On Tue, Sep 14, 2021 at 11:45:25AM +0200, David Hildenbrand wrote: On 03.09.21 09:02, Michael S. Tsirkin wrote: On Thu, Sep 02, 2021 at 06:09:19PM +0200, David Hildenbrand wrote: We don't want user space to be able to map virtio-mem device memory

Re: [PATCH v4 3/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-14 Thread David Hildenbrand
On 03.09.21 09:02, Michael S. Tsirkin wrote: On Thu, Sep 02, 2021 at 06:09:19PM +0200, David Hildenbrand wrote: We don't want user space to be able to map virtio-mem device memory directly (e.g., via /dev/mem) in order to have guarantees that in a sane setup we'll never accidentially access

[PATCH v4 3/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-02 Thread David Hildenbrand
cannot be restricticted -- if we have CONFIG_DEVMEM=y but CONFIG_STRICT_DEVMEM is not set. Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- drivers/virtio/Kconfig | 1 + drivers/virtio/virtio_mem.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v4 2/3] kernel/resource: disallow access to exclusive system RAM regions

2021-09-02 Thread David Hildenbrand
e container it creates to contain all actual busy system RAM added via add_memory_driver_managed(). Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- kernel/resource.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/kernel/resource.c b/

[PATCH v4 1/3] kernel/resource: clean up and optimize iomem_is_exclusive()

2021-09-02 Thread David Hildenbrand
We end up traversing subtrees of ranges we are not interested in; let's optimize this case, skipping such subtrees, cleaning up the function a bit. Reviewed-by: Dan Williams Signed-off-by: David Hildenbrand --- kernel/resource.c | 25 - 1 file changed, 20 insertions

[PATCH v4 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-09-02 Thread David Hildenbrand
h-Hartman Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Dan Williams Cc: Hanjun Guo Cc: Andy Shevchenko Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org David Hildenbrand (3): kernel/resource: clean up and

[PATCH v3 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-31 Thread David Hildenbrand
ocki" Cc: Andrew Morton Cc: Dan Williams Cc: Hanjun Guo Cc: Andy Shevchenko Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org David Hildenbrand (3): kernel/resource: clean up and optimize iomem_is_exclusive() kernel/resource: disallow access to exclusive system RAM

Re: [GIT PULL] virtio: a last minute fix

2021-08-31 Thread David Hildenbrand
On 29.08.21 20:11, Linus Torvalds wrote: On Sun, Aug 29, 2021 at 8:53 AM Michael S. Tsirkin wrote: Donnu if it's too late - was on vacation and this only arrived Wednesday. Seems to be necessary to avoid introducing a regression in virtio-mem. Heh. Not too late for 5.14, but too late in the

Re: [PATCH v2 1/3] /dev/mem: disallow access to explicitly excluded system RAM regions

2021-08-25 Thread David Hildenbrand
On 25.08.21 19:07, Dan Williams wrote: On Wed, Aug 25, 2021 at 12:23 AM David Hildenbrand wrote: On 25.08.21 02:58, Dan Williams wrote: On Mon, Aug 16, 2021 at 7:25 AM David Hildenbrand wrote: virtio-mem dynamically exposes memory inside a device memory region as system RAM to Linux

[PATCH v1] virtio-mem: fix sleeping in RCU read side section in virtio_mem_online_page_cb()

2021-08-25 Thread David Hildenbrand
() Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Andrew Morton Cc: Linus Torvalds Cc: virtualization@lists.linux-foundation.org Signed-off-by: David Hildenbrand --- The problematic commit is in v5.14-rc1 .. v5.14-rc7, but it suspect might be too late for v5.14. The original commit we

Re: [bug report] virtio-mem: use page_offline_(start|end) when setting PageOffline()

2021-08-25 Thread David Hildenbrand
On 25.08.21 11:40, Dan Carpenter wrote: Hello David Hildenbrand, The patch 6cc26d77613a: "virtio-mem: use page_offline_(start|end) when setting PageOffline()" from Jun 30, 2021, leads to the following Smatch static checker warning: drivers/virtio/virtio_

Re: [PATCH v2 1/3] /dev/mem: disallow access to explicitly excluded system RAM regions

2021-08-25 Thread David Hildenbrand
On 25.08.21 02:58, Dan Williams wrote: On Mon, Aug 16, 2021 at 7:25 AM David Hildenbrand wrote: virtio-mem dynamically exposes memory inside a device memory region as system RAM to Linux, coordinating with the hypervisor which parts are actually "plugged" and consequently usable/

Re: [PATCH v2 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-23 Thread David Hildenbrand
On 16.08.21 16:25, David Hildenbrand wrote: Let's add the basic infrastructure to exclude some physical memory regions completely from /dev/mem access, on any architecture and under any system configuration (independent of CONFIG_STRICT_DEVMEM and independent of "iomem="). Use it for

[PATCH v2 3/3] kernel/resource: cleanup and optimize iomem_is_exclusive()

2021-08-16 Thread David Hildenbrand
Let's clean it up a bit, reusing for_each_resource() and avoiding traversing subtrees we are not interested in. Signed-off-by: David Hildenbrand --- kernel/resource.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index

[PATCH v2 2/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-16 Thread David Hildenbrand
against someone that just wants to do nasty things. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 09ed55de07d7..c8f914700a42 100644

[PATCH v2 1/3] /dev/mem: disallow access to explicitly excluded system RAM regions

2021-08-16 Thread David Hildenbrand
t's add and use next_range_skip_children() and for_each_resource(), to optimize that case, avoding having to traverse subtrees that are not of interest. Signed-off-by: David Hildenbrand --- drivers/char/mem.c | 22 include/linux/ioport.h | 1 + kernel/resource.c | 47 +++

[PATCH v2 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-16 Thread David Hildenbrand
Cc: Andy Shevchenko Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org David Hildenbrand (3): /dev/mem: disallow access to explicitly excluded system RAM regions virtio-mem: disallow mapping virtio-mem memory via /dev/mem kernel/resource: cleanup and optimize io

Re: [PATCH v1 3/3] kernel/resource: cleanup and optimize iomem_is_exclusive()

2021-08-12 Thread David Hildenbrand
On 12.08.21 09:14, Andy Shevchenko wrote: On Thursday, August 12, 2021, David Hildenbrand <mailto:da...@redhat.com>> wrote: On 11.08.21 22:47, Andy Shevchenko wrote: On Wednesday, August 11, 2021, David Hildenbrand mailto:da...@redhat.com>

Re: [PATCH v1 3/3] kernel/resource: cleanup and optimize iomem_is_exclusive()

2021-08-12 Thread David Hildenbrand
On 11.08.21 22:47, Andy Shevchenko wrote: On Wednesday, August 11, 2021, David Hildenbrand <mailto:da...@redhat.com>> wrote: Let's clean it up a bit, removing the unnecessary usage of r_next() by next_resource(), and use next_range_resource() in case we are not i

[PATCH v1 3/3] kernel/resource: cleanup and optimize iomem_is_exclusive()

2021-08-11 Thread David Hildenbrand
Let's clean it up a bit, removing the unnecessary usage of r_next() by next_resource(), and use next_range_resource() in case we are not interested in a certain subtree. Signed-off-by: David Hildenbrand --- kernel/resource.c | 19 +++ 1 file changed, 11 insertions(+), 8

[PATCH v1 1/3] /dev/mem: disallow access to explicitly excluded system RAM regions

2021-08-11 Thread David Hildenbrand
e next_range_skip_children() to optimize that case, avoding having to traverse subtrees that are not of interest. Signed-off-by: David Hildenbrand --- drivers/char/mem.c | 22 +- include/linux/ioport.h | 1 + kernel/resource.c | 42 +++

[PATCH v1 2/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-11 Thread David Hildenbrand
against someone that just wants to do nasty things. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 09ed55de07d7..c8f914700a42 100644

[PATCH v1 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

2021-08-11 Thread David Hildenbrand
linux-foundation.org Cc: linux...@kvack.org David Hildenbrand (3): /dev/mem: disallow access to explicitly excluded system RAM regions virtio-mem: disallow mapping virtio-mem memory via /dev/mem kernel/resource: cleanup and optimize iomem_is_exclusive() drivers/char/mem.c | 22 ++--

Re: [RFC PATCH 10/15] virtio: virtio_balloon: use PAGES_PER_SECTION instead of MAX_ORDER_NR_PAGES.

2021-08-09 Thread David Hildenbrand
On 05.08.21 21:02, Zi Yan wrote: From: Zi Yan It keeps the existing behavior when MAX_ORDER grows beyond a section. ... but it breaks/changes existing behavior if MAX_ORDER is smaller than a section? Signed-off-by: Zi Yan Cc: "Michael S. Tsirkin" Cc: David Hildenbrand Cc:

Re: [RFC PATCH 09/15] virtio: virtio_mem: use PAGES_PER_SECTION instead of MAX_ORDER_NR_PAGES

2021-08-09 Thread David Hildenbrand
On 05.08.21 21:02, Zi Yan wrote: From: Zi Yan It keeps the existing behavior when MAX_ORDER grows beyond a section size. Signed-off-by: Zi Yan Cc: David Hildenbrand Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org Cc:

[PATCH v3 9/9] mm/memory_hotplug: improved dynamic memory group aware "auto-movable" online policy

2021-08-06 Thread David Hildenbrand
all number of NUMA nodes. Note: for now, there seems to be no compelling reason to make this behavior configurable. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 30 + include/linux/memory.h | 3 +++ mm/memory_hotplug.c| 60 +++

[PATCH v3 8/9] mm/memory_hotplug: memory group aware "auto-movable" online policy

2021-08-06 Thread David Hildenbrand
ihin a 512 MiB unit will either be MOVABLE or not, not a mixture. We have to pass the memory group to zone_for_pfn_range() to take the memory group into account. Note: for now, there seems to be no compelling reason to make this behavior configurable. Signed-off-by: David Hildenbrand --- dr

[PATCH v3 7/9] virtio-mem: use a single dynamic memory group for a single virtio-mem device

2021-08-06 Thread David Hildenbrand
Let's use a single dynamic memory group. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 774986695dc4..8945f248ce69 100644

[PATCH v3 6/9] dax/kmem: use a single static memory group for a single probed unit

2021-08-06 Thread David Hildenbrand
memory device. Signed-off-by: David Hildenbrand --- drivers/dax/kmem.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index 99e0f60c4c26..a37622060fff 100644 --- a/drivers/dax/kmem.c +++ b/drivers

[PATCH v3 5/9] ACPI: memhotplug: use a single static memory group for a single memory device

2021-08-06 Thread David Hildenbrand
fail acpi_memory_enable_device(). Acked-by: Rafael J. Wysocki Signed-off-by: David Hildenbrand --- drivers/acpi/acpi_memhotplug.c | 35 +- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi

[PATCH v3 4/9] mm/memory_hotplug: track present pages in memory groups

2021-08-06 Thread David Hildenbrand
smart auto-online decision for individual memory blocks within a memory group based on group statistics. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 10 +- include/linux/memory.h | 6 ++ include/linux/memory_hotplug.h | 13 + mm

[PATCH v3 3/9] drivers/base/memory: introduce "memory groups" to logically group memory blocks

2021-08-06 Thread David Hildenbrand
We want a single unit to be of the same type. For now, memory groups are an internal concept that is not exposed to user space; we might want to change that in the future, though. add_memory() users can specify a mgid instead of a nid when passing the MHP_NID_IS_MGID flag. Signed-off-by: David

[PATCH v3 2/9] mm/memory_hotplug: introduce "auto-movable" online policy

2021-08-06 Thread David Hildenbrand
en enabling the new "auto-movable" policy, though. * memory_hotplug.auto_movable_numa_aware considers numa node stats in addition to global stats, and defaults to "true". Note: just like the old policy, the new policy won't take things like unmovable huge pages or memo

[PATCH v3 1/9] mm: track present early pages per zone

2021-08-06 Thread David Hildenbrand
only online/offline complete (individual) memory blocks. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 14 +++--- include/linux/memory_hotplug.h | 2 +- include/linux/mmzone.h | 7 +++ mm/memory_hotplug.c| 14 +++--- mm/page_alloc.c

[PATCH v3 0/9] mm/memory_hotplug: "auto-movable" online policy and memory groups

2021-08-06 Thread David Hildenbrand
foundation.org Cc: linux...@kvack.org Cc: linux-a...@vger.kernel.org [1] https://lkml.kernel.org/r/20210707073205.3835-1-da...@redhat.com [2] https://lkml.kernel.org/r/20210712124052.26491-1-da...@redhat.com David Hildenbrand (9): mm: track present early pages per zone mm/memory_hotplug: introdu

Re: [PATCH v2 3/9] drivers/base/memory: introduce "memory groups" to logically group memory blocks

2021-07-28 Thread David Hildenbrand
Hi Greg, static void unregister_memory(struct memory_block *memory) @@ -681,6 +692,11 @@ static void unregister_memory(struct memory_block *memory) WARN_ON(xa_erase(_blocks, memory->dev.id) == NULL); + if (memory->group) { + refcount_dec(>group->refcount); +

Re: [PATCH v2 2/9] mm/memory_hotplug: introduce "auto-movable" online policy

2021-07-26 Thread David Hildenbrand
+struct auto_movable_stats { + unsigned long kernel_early_pages; + unsigned long movable_pages; +}; + +static void auto_movable_stats_account_zone(struct auto_movable_stats *stats, + struct zone *zone) +{ + if (zone_idx(zone) ==

[PATCH v2 9/9] mm/memory_hotplug: improved dynamic memory group aware "auto-movable" online policy

2021-07-23 Thread David Hildenbrand
all number of NUMA nodes. Note: for now, there seems to be no compelling reason to make this behavior configurable. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 25 ++ include/linux/memory.h | 3 +++ mm/memory_hotplug.c| 60 +++

[PATCH v2 8/9] mm/memory_hotplug: memory group aware "auto-movable" online policy

2021-07-23 Thread David Hildenbrand
ihin a 512 MiB unit will either be MOVABLE or not, not a mixture. We have to pass the memory group to zone_for_pfn_range() to take the memory group into account. Note: for now, there seems to be no compelling reason to make this behavior configurable. Signed-off-by: David Hildenbrand --- dr

[PATCH v2 7/9] virtio-mem: use a single dynamic memory group for a single virtio-mem device

2021-07-23 Thread David Hildenbrand
Let's use a single dynamic memory group. Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 774986695dc4..19036922f7ef 100644

[PATCH v2 6/9] dax/kmem: use a single static memory group for a single probed unit

2021-07-23 Thread David Hildenbrand
memory device. Signed-off-by: David Hildenbrand --- drivers/dax/kmem.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index 99e0f60c4c26..b528f85de845 100644 --- a/drivers/dax/kmem.c +++ b/drivers

[PATCH v2 5/9] ACPI: memhotplug: use a single static memory group for a single memory device

2021-07-23 Thread David Hildenbrand
fail acpi_memory_enable_device(). Acked-by: Rafael J. Wysocki Signed-off-by: David Hildenbrand --- drivers/acpi/acpi_memhotplug.c | 35 +- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi

[PATCH v2 4/9] mm/memory_hotplug: track present pages in memory groups

2021-07-23 Thread David Hildenbrand
smart auto-online decision for individual memory blocks within a memory group based on group statistics. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 10 +- include/linux/memory.h | 4 include/linux/memory_hotplug.h | 13 + mm

[PATCH v2 3/9] drivers/base/memory: introduce "memory groups" to logically group memory blocks

2021-07-23 Thread David Hildenbrand
We want a single unit to be of the same type. For now, memory groups are an internal concept that is not exposed to user space; we might want to change that in the future, though. add_memory() users can specify a mgid instead of a nid when passing the MHP_NID_IS_MGID flag. Signed-off-by: David

[PATCH v2 2/9] mm/memory_hotplug: introduce "auto-movable" online policy

2021-07-23 Thread David Hildenbrand
en enabling the new "auto-movable" policy, though. * memory_hotplug.auto_movable_numa_aware considers numa node stats in addition to global stats, and defaults to "true". Note: just like the old policy, the new policy won't take things like unmovable huge pages or memo

[PATCH v2 1/9] mm: track present early pages per zone

2021-07-23 Thread David Hildenbrand
only online/offline complete (individual) memory blocks. Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 14 +++--- include/linux/memory_hotplug.h | 2 +- include/linux/mmzone.h | 7 +++ mm/memory_hotplug.c| 14 +++--- mm/page_alloc.c

[PATCH v2 0/9] mm/memory_hotplug: "auto-movable" online policy and memory groups

2021-07-23 Thread David Hildenbrand
dual Cc: Dave Hansen Cc: Vlastimil Babka Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Tatashin Cc: Greg Kroah-Hartman Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org Cc: linux-a...@vger.kernel.org [1] https://lkml.kernel.org/r/20210707073

Re: [PATCH] virtio-balloon: Use virtio_find_vqs() helper

2021-07-16 Thread David Hildenbrand
On 16.07.21 14:53, David Hildenbrand wrote: On 16.07.21 14:46, tianxianting wrote: Do you interest in this patch? just little improvment:) I am, especially when I'm cc'ed and aware of it ;) Sorry, just found it in my gmail spam folder ... WTH. Why does the original one get filtered

Re: [PATCH] virtio-balloon: Use virtio_find_vqs() helper

2021-07-16 Thread David Hildenbrand
On 16.07.21 14:46, tianxianting wrote: Do you interest in this patch? just little improvment:) I am, especially when I'm cc'ed and aware of it ;) Reviewed-by: David Hildenbrand One nit below 在 2021/7/13 下午11:38, Xianting Tian 写道: From: Xianting Tian Use the helper virtio_find_vqs

Re: [PATCH v1 1/4] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()

2021-07-15 Thread David Hildenbrand
On 14.07.21 22:13, Heiko Carstens wrote: On Mon, Jul 12, 2021 at 02:40:49PM +0200, David Hildenbrand wrote: Checkpatch complained on a follow-up patch that we are using "unsigned" here, which defaults to "unsigned int" and checkpatch is correct. Use "unsigned lon

[PATCH v1 4/4] ACPI: memhotplug: memory resources cannot be enabled yet

2021-07-12 Thread David Hildenbrand
We allocate + initialize everything from scratch. In case enabling the device fails, we free all memory resourcs. Acked-by: Rafael J. Wysocki Cc: Len Brown Cc: linux-a...@vger.kernel.org Signed-off-by: David Hildenbrand --- drivers/acpi/acpi_memhotplug.c | 4 1 file changed, 4 deletions

[PATCH v1 3/4] mm/memory_hotplug: remove nid parameter from remove_memory() and friends

2021-07-12 Thread David Hildenbrand
shal Verma Cc: Dave Jiang Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Andrew Morton Cc: Nathan Lynch Cc: Laurent Dufour Cc: "Aneesh Kumar K.V" Cc: Scott Cheloha Cc: Anton Blanchard Cc: linuxppc-...@lists.ozlabs.org Cc: linux-a...@vger.kernel.org Cc: nvd...@lists.li

[PATCH v1 2/4] mm/memory_hotplug: remove nid parameter from arch_remove_memory()

2021-07-12 Thread David Hildenbrand
sts.infradead.org Cc: linux-i...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/arm64/mm/mmu.c| 3 +-- arch/ia64/mm/init.c| 3 +-- arch/powerpc/mm/mem.c | 3 +--

[PATCH v1 1/4] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()

2021-07-12 Thread David Hildenbrand
es in the range of multiple TB. Fixes: e5e689302633 ("mm, memory_hotplug: display allowed zones in the preferred ordering") Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 4 ++-- mm/memory_hotplug.c| 4 ++-- 2 files changed, 4 insertions(+), 4

mm/memory_hotplug: preparatory patches for new online policy and memory

2021-07-12 Thread David Hildenbrand
ansen Cc: Vlastimil Babka Cc: Mike Rapoport Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Tatashin Cc: Heiko Carstens Cc: Michael Ellerman Cc: Catalin Marinas Cc: virtualization@lists.linux-foundation.org Cc: linux...@kvack.org Cc: linux-a...@vger.kernel.org David Hildenbrand

<    1   2   3   4   5   6   7   8   9   >