Re: [PATCH] mm/hugetlb: Use helper huge_page_order and pages_per_huge_page

2021-01-14 Thread David Hildenbrand
s, like CommitLimit going negative. >*/ > if (hstate_is_gigantic(h)) > - adjust_managed_page_count(page, 1 << h->order); > + adjust_managed_page_count(page, pages_per_huge_page(h)); > cond_resched(); > } > } > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH] mm/hugetlb: avoid unnecessary hugetlb_acct_memory() call

2021-01-15 Thread David Hildenbrand
On 15.01.21 03:04, Miaohe Lin wrote: > Hi: > > On 2021/1/15 3:16, Mike Kravetz wrote: >> On 1/14/21 4:32 AM, David Hildenbrand wrote: >>> On 14.01.21 12:31, Miaohe Lin wrote: >>>> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except hol

Re: [PATCH 0/1] mm: restore full accuracy in COW page reuse

2021-01-15 Thread David Hildenbrand
On 10.01.21 01:44, Andrea Arcangeli wrote: > Hello Andrew and everyone, > > Once we agree that COW page reuse requires full accuracy, the next > step is to re-apply 17839856fd588f4ab6b789f482ed3ffd7c403e1f and to > return going in that direction. After stumbling over the heated discussion around

Re: [PATCH 2/2] x86/setup: merge several reservations of start of the memory

2021-01-15 Thread David Hildenbrand
k_reserve(0, ALIGN(reserve_low, PAGE_SIZE)); > > early_reserve_initrd(); > > @@ -757,7 +751,6 @@ static void __init early_reserve_memory(void) > reserve_bios_regions(); > > trim_platform_memory_ranges(); > - trim_low_memory_range(); > } > > /* > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 1/2] x86/setup: consolidate early memory reservations

2021-01-15 Thread David Hildenbrand
On 15.01.21 09:32, Mike Rapoport wrote: > From: Mike Rapoport > > The early reservations of memory areas used by the firmware, bootloader, > kernel text and data are spread over setup_arch(). Moreover, some of them > happen *after* memblock allocations, e.g trim_platform_memory_ranges() and > tri

Re: [PATCH] mm/page_reporting: use list_entry_is_head() in page_reporting_cycle()

2020-12-29 Thread David Hildenbrand
pages to the head of the freelist */ > - if (&next->lru != list && !list_is_first(&next->lru, list)) > + if (!list_entry_is_head(next, list, lru) && !list_is_first(&next->lru, > list)) > list_rotate_to_front(&next->lru, list); > > spin_unlock_irq(&zone->lock); > LGTM Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 1/1] mm: mmap: Remove unnecessary local variable

2020-12-29 Thread David Hildenbrand
_struct *mm = current->mm; > struct vm_area_struct *next; > @@ -281,9 +280,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) > return brk; > > out: > - retval = origbrk; > mmap_write_unlock(mm); > - return retval; > + return origbrk; > } Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

[PATCH v1 0/3] drivers/char: remove /dev/kmem for good

2021-03-24 Thread David Hildenbrand
s://bugzilla.redhat.com/show_bug.cgi?id=154796 " RFC -> v1: - "drivers/char: remove /dev/kmem for good" -- Add more details to patch description regarding distributions - "mm/vmalloc: remove vwrite()" -- Also remove the nommu variant - Compile-tested on more archs/configs

[PATCH v1 1/3] drivers/char: remove /dev/kmem for good

2021-03-24 Thread David Hildenbrand
ts.infradead.org Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Cc: linux-hexa...@vger.kernel.org Cc: linux-i...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@lists.linux-m68k.org Cc: linux-m...@vger.kernel.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists

[PATCH v1 3/3] mm/vmalloc: remove vwrite()

2021-03-24 Thread David Hildenbrand
The last user (/dev/kmem) is gone. Let's drop it. Cc: Linus Torvalds Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Hillf Danton Cc: Michal Hocko Cc: Matthew Wilcox Cc: Oleksiy Avramchenko Cc: Steven Rostedt Cc: Minchan Kim Cc: huang ying Signed-off-by: David Hildenbrand --- in

[PATCH v1 2/3] mm: remove xlate_dev_kmem_ptr()

2021-03-24 Thread David Hildenbrand
-m...@vger.kernel.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux-a...@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/alpha/include/asm/io.h | 5 - arch/arm/incl

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-24 Thread David Hildenbrand
On 24.03.21 12:18, Oscar Salvador wrote: On Mon, Mar 22, 2021 at 05:01:58PM +0100, David Hildenbrand wrote: It used to be true that we can have busy system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., added via dax/kmem

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-24 Thread David Hildenbrand
On 24.03.21 13:10, Michal Hocko wrote: On Wed 24-03-21 13:03:29, Michal Hocko wrote: On Wed 24-03-21 11:12:59, Oscar Salvador wrote: [...] an additional remark - online_pages()->move_pfn_range_to_zone(): Accounts for node/zone's spanned pages - online_pages()->zone->present_pages += nr_page

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-24 Thread David Hildenbrand
On 24.03.21 13:37, Michal Hocko wrote: On Wed 24-03-21 13:23:47, David Hildenbrand wrote: On 24.03.21 13:10, Michal Hocko wrote: On Wed 24-03-21 13:03:29, Michal Hocko wrote: On Wed 24-03-21 11:12:59, Oscar Salvador wrote: [...] an additional remark - online_pages

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-24 Thread David Hildenbrand
On 24.03.21 14:40, Michal Hocko wrote: On Wed 24-03-21 14:13:31, David Hildenbrand wrote: On 24.03.21 13:37, Michal Hocko wrote: On Wed 24-03-21 13:23:47, David Hildenbrand wrote: On 24.03.21 13:10, Michal Hocko wrote: On Wed 24-03-21 13:03:29, Michal Hocko wrote: On Wed 24-03-21 11:12:59

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-24 Thread David Hildenbrand
On 24.03.21 15:42, Michal Hocko wrote: On Wed 24-03-21 13:03:29, Michal Hocko wrote: On Wed 24-03-21 11:12:59, Oscar Salvador wrote: [...] I kind of understand to be reluctant to use vmemmap_pages terminology here, but unfortunately we need to know about it. We could rename nr_vmemmap_pages to

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-24 Thread David Hildenbrand
On 24.03.21 17:04, Michal Hocko wrote: On Wed 24-03-21 15:52:38, David Hildenbrand wrote: On 24.03.21 15:42, Michal Hocko wrote: On Wed 24-03-21 13:03:29, Michal Hocko wrote: On Wed 24-03-21 11:12:59, Oscar Salvador wrote: [...] I kind of understand to be reluctant to use vmemmap_pages

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread David Hildenbrand
On 24.03.21 20:45, John Hubbard wrote: On 3/24/21 12:20 PM, Minchan Kim wrote: struct cma_stat's lifespan for cma_sysfs is different with struct cma because kobject for sysfs requires dynamic object while CMA is static object[1]. When CMA is initialized, it couldn't use slab to allocate cma_stat

Re: [PATCH 1/8] mm: cma: introduce cma_release_nowait()

2021-03-25 Thread David Hildenbrand
On 25.03.21 01:28, Mike Kravetz wrote: From: Roman Gushchin cma_release() has to lock the cma_lock mutex to clear the cma bitmap. It makes it a blocking function, which complicates its usage from non-blocking contexts. For instance, hugetlbfs code is temporarily dropping the hugetlb_lock spinlo

Re: [PATCH 1/8] mm: cma: introduce cma_release_nowait()

2021-03-25 Thread David Hildenbrand
On 25.03.21 11:11, Michal Hocko wrote: On Thu 25-03-21 10:45:19, Michal Hocko wrote: On Wed 24-03-21 17:28:28, Mike Kravetz wrote: [...] phys_addr_t cma_get_base(const struct cma *cma) { return PFN_PHYS(cma->base_pfn); @@ -146,6 +155,10 @@ static int __init cma_init_reserved_areas(v

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 11:55, Oscar Salvador wrote: On Thu, Mar 25, 2021 at 10:17:33AM +0100, Michal Hocko wrote: Why do you think it is wrong to initialize/account pages when they are used? Keep in mind that offline pages are not used until they are onlined. But vmemmap pages are used since the vmemmap is

[PATCH v2 0/3] kernel/resource: make walk_system_ram_res() and walk_mem_res() search the whole tree

2021-03-25 Thread David Hildenbrand
o be updated to consider this memory in the kexec_load() case when processing /proc/iomem. v1 -> v2: - Added fixes tags to patch #1 and #2 - Refined the patch descriptions - Added acks/rbs David Hildenbrand (3): kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM

[PATCH v2 2/3] kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources

2021-03-25 Thread David Hildenbrand
nvin" Cc: Tom Lendacky Cc: Brijesh Singh Cc: x...@kernel.org Cc: ke...@lists.infradead.org Signed-off-by: David Hildenbrand --- kernel/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/resource.c b/kernel/resource.c index 4efd6e912279..16e0c7e8ed24 100644 --- a/ker

[PATCH v2 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-25 Thread David Hildenbrand
omas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Tom Lendacky Cc: Brijesh Singh Cc: x...@kernel.org Cc: ke...@lists.infradead.org Signed-off-by: David Hildenbrand --- kernel/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v2 3/3] kernel/resource: remove first_lvl / siblings_only logic

2021-03-25 Thread David Hildenbrand
h Cc: Michal Hocko Cc: Qian Cai Cc: Oscar Salvador Cc: Eric Biederman Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Tom Lendacky Cc: Brijesh Singh Cc: x...@kernel.org Cc: ke...@lists.infradead.org Signed-off-by: David Hildenbrand --- kernel/

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 13:35, Michal Hocko wrote: On Thu 25-03-21 12:08:43, David Hildenbrand wrote: On 25.03.21 11:55, Oscar Salvador wrote: On Thu, Mar 25, 2021 at 10:17:33AM +0100, Michal Hocko wrote: Why do you think it is wrong to initialize/account pages when they are used? Keep in mind that

Re: [PATCH] mm/sparse: Add the missing sparse_buffer_fini() in error branch

2021-03-25 Thread David Hildenbrand
goto failed; } check_usemap_section_nr(nid, usage); Did you actually manage to reproduce this? I would have thought that __populate_section_memmap() barely fails during boot ... Anyhow, looks like the right think to do to me Reviewed-by: David Hildenbrand

Re: [PATCH 0/3] mm, pmem: Force unmap pmem on surprise remove

2021-03-25 Thread David Hildenbrand
On 18.03.21 05:08, Dan Williams wrote: Summary: A dax_dev can be unbound from its driver at any time. Unbind can not fail. The driver-core will always trigger ->remove() and the result from ->remove() is ignored. After ->remove() the driver-core proceeds to tear down context. The filesystem-dax

Re: [PATCH v3 1/5] mm/migrate.c: make putback_movable_page() static

2021-03-25 Thread David Hildenbrand
viewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 3/5] mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page()

2021-03-25 Thread David Hildenbrand
;vm_page_prot); Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 15:08, Michal Hocko wrote: On Thu 25-03-21 13:40:45, David Hildenbrand wrote: On 25.03.21 13:35, Michal Hocko wrote: On Thu 25-03-21 12:08:43, David Hildenbrand wrote: On 25.03.21 11:55, Oscar Salvador wrote: [...] - When moving the initialization/accounting to hot-add/hot

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 15:34, Michal Hocko wrote: On Thu 25-03-21 15:09:35, David Hildenbrand wrote: On 25.03.21 15:08, Michal Hocko wrote: On Thu 25-03-21 13:40:45, David Hildenbrand wrote: On 25.03.21 13:35, Michal Hocko wrote: On Thu 25-03-21 12:08:43, David Hildenbrand wrote: On 25.03.21 11:55

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 16:12, Michal Hocko wrote: On Thu 25-03-21 15:46:22, David Hildenbrand wrote: On 25.03.21 15:34, Michal Hocko wrote: On Thu 25-03-21 15:09:35, David Hildenbrand wrote: On 25.03.21 15:08, Michal Hocko wrote: On Thu 25-03-21 13:40:45, David Hildenbrand wrote: On 25.03.21 13:35

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 16:35, Michal Hocko wrote: On Thu 25-03-21 16:19:36, David Hildenbrand wrote: On 25.03.21 16:12, Michal Hocko wrote: On Thu 25-03-21 15:46:22, David Hildenbrand wrote: On 25.03.21 15:34, Michal Hocko wrote: On Thu 25-03-21 15:09:35, David Hildenbrand wrote: On 25.03.21 15:08

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 17:07, Michal Hocko wrote: On Thu 25-03-21 16:35:58, Michal Hocko wrote: [...] So there is indeed a difference. One way around that would be to mark vmemmap pages (e.g. PageReserved && magic value stored somewhere in the struct page - resembling bootmem vmemmaps) or mark section full

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 17:47, Michal Hocko wrote: On Thu 25-03-21 17:36:22, Michal Hocko wrote: If all it takes is to make pfn_to_online_page work (and my previous attempt is incorrect because it should consult block rather than section pfn range) This should work. diff --git a/drivers/base/memory.c b/d

Re: [PATCH 1/8] mm: cma: introduce cma_release_nowait()

2021-03-25 Thread David Hildenbrand
On 25.03.21 17:56, Mike Kravetz wrote: On 3/25/21 3:22 AM, Michal Hocko wrote: On Thu 25-03-21 10:56:38, David Hildenbrand wrote: On 25.03.21 01:28, Mike Kravetz wrote: From: Roman Gushchin cma_release() has to lock the cma_lock mutex to clear the cma bitmap. It makes it a blocking function

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-25 Thread David Hildenbrand
On 25.03.21 17:36, Michal Hocko wrote: On Thu 25-03-21 17:20:23, David Hildenbrand wrote: On 25.03.21 17:07, Michal Hocko wrote: On Thu 25-03-21 16:35:58, Michal Hocko wrote: [...] So there is indeed a difference. One way around that would be to mark vmemmap pages (e.g. PageReserved &&am

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-19 Thread David Hildenbrand
IS_ALIGNED(remaining_size, pageblock_nr_pages << PAGE_SHIFT); LGTM, thanks! (another pair of eyes certainly wouldn't hurt :) ) Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v5 1/5] mm,memory_hotplug: Allocate memmap from the added memory range

2021-03-19 Thread David Hildenbrand
Hopefully Andrew can amend these two nits? (another pair of eyes certainly wouldn't hurt :) ) definitely, but those are pricy as you may know :-D Even worse, they are even hard to find! :) -- Thanks, David / dhildenb

Re: [External] Re: [PATCH v19 7/8] mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap

2021-03-19 Thread David Hildenbrand
On 19.03.21 13:15, Muchun Song wrote: On Fri, Mar 19, 2021 at 4:59 PM Oscar Salvador wrote: On Mon, Mar 15, 2021 at 05:20:14PM +0800, Muchun Song wrote: --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #inc

Re: [External] Re: [PATCH v19 7/8] mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap

2021-03-19 Thread David Hildenbrand
On 19.03.21 13:36, David Hildenbrand wrote: On 19.03.21 13:15, Muchun Song wrote: On Fri, Mar 19, 2021 at 4:59 PM Oscar Salvador wrote: On Mon, Mar 15, 2021 at 05:20:14PM +0800, Muchun Song wrote: --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -34,6 +34,7 @@ #include

[PATCH RFC 0/3] drivers/char: remove /dev/kmem for good

2021-03-19 Thread David Hildenbrand
h for discussing the general topic (RFC). David Hildenbrand (3): drivers/char: remove /dev/kmem for good mm: remove xlate_dev_kmem_ptr() mm/vmalloc: remove vwrite() Documentation/admin-guide/devices.txt | 2 +- arch/alpha/include/asm/io.h | 5 - arch/arm/configs/dove_defc

[PATCH RFC 2/3] mm: remove xlate_dev_kmem_ptr()

2021-03-19 Thread David Hildenbrand
el Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Arnd Bergmann Cc: Andrew Morton Cc: David Hildenbrand Cc: Krzysztof Kozlowski Cc: Mik

[PATCH RFC 1/3] drivers/char: remove /dev/kmem for good

2021-03-19 Thread David Hildenbrand
Cc: linux-hexa...@vger.kernel.org Cc: linux-m...@lists.linux-m68k.org Cc: openr...@lists.librecores.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux-xte...@linux-xtensa.org Cc: linux-fsde...@vger.kernel.org Cc: Linux API Signed-off-by: David Hildenbrand --- Documentation

[PATCH RFC 3/3] mm/vmalloc: remove vwrite()

2021-03-19 Thread David Hildenbrand
The last user (/dev/kmem) is gone. Let's drop it. Cc: Andrew Morton Cc: Hillf Danton Cc: Michal Hocko Cc: Matthew Wilcox Cc: Oleksiy Avramchenko Cc: Steven Rostedt Cc: Minchan Kim Cc: huang ying Signed-off-by: David Hildenbrand --- include/linux/vmalloc.h | 1 - mm/vmal

Re: [PATCH RFC 0/3] drivers/char: remove /dev/kmem for good

2021-03-19 Thread David Hildenbrand
On 19.03.21 15:34, David Hildenbrand wrote: Let's start a discussion if /dev/kmem is worth keeping around and fixing/maintaining or if we should just remove it now for good. More details / findings in patch #1. Patch #2 and #3 perform minor cleanups based on removed /dev/kmem support. As

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread David Hildenbrand
On 22.03.21 17:01, David Hildenbrand wrote: It used to be true that we can have busy system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., added via dax/kmem and virtio-mem), which gets added on lower levels. We have two

Re: [PATCH 2/5] mm/migrate.c: remove unnecessary rc != MIGRATEPAGE_SUCCESS check in 'else' case

2021-03-23 Thread David Hildenbrand
_hugepage(hpage); - else if (rc != -EAGAIN && rc != MIGRATEPAGE_SUCCESS) + else if (rc != -EAGAIN) list_move_tail(&hpage->lru, ret); /* Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 3/5] mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page()

2021-03-23 Thread David Hildenbrand
On 20.03.21 10:36, Miaohe Lin wrote: If the zone device page does not belong to un-addressable device memory, the variable entry will be uninitialized and lead to indeterminate pte entry ultimately. Fix this unexpectant case and warn about it. s/unexpectant/unexpected/ Fixes: df6ad69838fc ("

Re: [PATCH 4/5] mm/migrate.c: use helper migrate_vma_collect_skip() in migrate_vma_collect_hole()

2021-03-23 Thread David Hildenbrand
tart; addr < end; addr += PAGE_SIZE) { + migrate->src[migrate->npages] = MIGRATE_PFN_MIGRATE; migrate->dst[migrate->npages] = 0; - migrate->src[migrate->npages++] = 0; + migrate->npages++; + migrate->cp

Re: [PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-23 Thread David Hildenbrand
page, scb_s->ipb >> 20) & mask; + src = _kvm_s390_real_to_abs(prefix, src) + mso; rc_dest = kvm_s390_shadow_fault(vcpu, vsie_page->gmap, dest, &pei_dest); rc_src = kvm_s390_shadow_fault(vcpu, vsie_page->gmap, src, &pei_src); mso is always confusing, but I think this should be correct. Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v1 3/3] kernel/resource: remove first_lvl / siblings_only logic

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:11, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:02:00PM +0100, David Hildenbrand wrote: All IORESOURCE_SYSTEM_RAM and IORESOURCE_MEM now properly consider the whole resource tree, not just the first level. Let's drop the unused first_lvl / siblings_only logic.

Re: [PATCH v1 1/3] kernel/resource: make walk_system_ram_res() find all busy IORESOURCE_SYSTEM_RAM resources

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:06, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:01:58PM +0100, David Hildenbrand wrote: It used to be true that we can have busy system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., added via dax/kmem

Re: [PATCH v1 2/3] kernel/resource: make walk_mem_res() find all busy IORESOURCE_MEM resources

2021-03-23 Thread David Hildenbrand
On 23.03.21 12:08, Andy Shevchenko wrote: On Mon, Mar 22, 2021 at 05:01:59PM +0100, David Hildenbrand wrote: It used to be true that we can have system RAM only on the first level in the resourc tree. However, this is no longer holds for driver-managed system RAM (i.e., dax/kmem and virtio-mem

Re: [PATCH RFC 0/3] drivers/char: remove /dev/kmem for good

2021-03-23 Thread David Hildenbrand
On 23.03.21 14:16, Greg Kroah-Hartman wrote: On Fri, Mar 19, 2021 at 03:34:49PM +0100, David Hildenbrand wrote: Let's start a discussion if /dev/kmem is worth keeping around and fixing/maintaining or if we should just remove it now for good. More details / findings in patch #1. Patch #2 a

Re: [PATCH v2 1/5] mm/migrate.c: remove unnecessary VM_BUG_ON_PAGE on putback_movable_page()

2021-03-23 Thread David Hildenbrand
); Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-23 Thread David Hildenbrand
On 23.03.21 16:07, Christian Borntraeger wrote: On 22.03.21 15:05, Claudio Imbrenda wrote: Prefixing needs to be applied to the guest real address to translate it into a guest absolute address. The value of MSO needs to be added to a guest-absolute address in order to obtain the host-virtual.

Re: [PATCH v2 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-23 Thread David Hildenbrand
On 23.03.21 16:16, Christian Borntraeger wrote: On 23.03.21 16:11, David Hildenbrand wrote: On 23.03.21 16:07, Christian Borntraeger wrote: On 22.03.21 15:05, Claudio Imbrenda wrote: Prefixing needs to be applied to the guest real address to translate it into a guest absolute address

Re: [PATCH v3 1/2] mm: Make alloc_contig_range handle free hugetlb pages

2021-03-04 Thread David Hildenbrand
I think we should not swallo such return values in isolate_or_dissolve_huge_page() and instead properly report esp. -ENOMEM properly up this callchain now. Otherwise we'll end up retrying / reporting -EBUSY, which is misleading. I am not sure I follow you here. So, atm, alloc_and_dissolve_huge_p

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread David Hildenbrand
On 04.03.21 17:01, Minchan Kim wrote: On Tue, Mar 02, 2021 at 09:23:49AM -0800, Minchan Kim wrote: On Fri, Feb 19, 2021 at 10:28:12AM +0100, Michal Hocko wrote: On Thu 18-02-21 08:19:50, Minchan Kim wrote: On Thu, Feb 18, 2021 at 10:43:21AM +0100, David Hildenbrand wrote: On 18.02.21 10:35

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread David Hildenbrand
On 04.03.21 17:23, Minchan Kim wrote: On Thu, Mar 04, 2021 at 05:10:52PM +0100, David Hildenbrand wrote: On 04.03.21 17:01, Minchan Kim wrote: On Tue, Mar 02, 2021 at 09:23:49AM -0800, Minchan Kim wrote: On Fri, Feb 19, 2021 at 10:28:12AM +0100, Michal Hocko wrote: On Thu 18-02-21 08:19:50

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread David Hildenbrand
You want to debug something, so you try triggering it and capturing debug data. There are not that many alloc_contig_range() users such that this would really be an issue to isolate ... cma_alloc uses alloc_contig_range and cma_alloc has lots of users. Even, it is expoerted by dmabuf so any user

Re: [PATCH] mm/hugetlb: suppress wrong warning info when alloc gigantic page

2021-03-04 Thread David Hildenbrand
On 04.03.21 18:20, Mike Kravetz wrote: On 3/4/21 1:35 AM, David Hildenbrand wrote: On 19.02.21 20:14, Mike Kravetz wrote: On 2/19/21 4:39 AM, Chen Wandun wrote: If hugetlb_cma is enabled, it will skip boot time allocation when allocating gigantic page, that doesn't means allocation fa

Re: [PATCH 1/1] ACPI: fix acpi table use after free

2021-03-05 Thread David Hildenbrand
The ibft table, for example, is mapped in via acpi_map() and kmap(). The page for the ibft table is not reserved, so it can end up on the freelist. You appear to be saying that it is not sufficient to kmap() a page in order to use it safely. It is also necessary to reserve it upfront, for examp

Re: [PATCH v3 4/5] x86/Kconfig: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-03-05 Thread David Hildenbrand
_HOTPLUG would also best be part of the generic MHP_MEMMAP_ON_MEMORY. Apart from that Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 5/5] arm64/Kconfig: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-03-05 Thread David Hildenbrand
MEMORY_HOTPLUG Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 3/5] mm,memory_hotplug: Add kernel boot option to enable memmap_on_memory

2021-03-05 Thread David Hildenbrand
mory __ro_after_init; +module_param(memmap_on_memory, bool, 0444); +MODULE_PARM_DESC(memmap_on_memory, "Enable memmap on memory for memory hotplug"); Wondering if this makes sense getting wrapped in #ifdef CONFIG MHP_MEMMAP_ON_MEMORY just a thought. LGTM Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 2/2] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-05 Thread David Hildenbrand
On 22.02.21 14:51, Oscar Salvador wrote: alloc_contig_range() will fail if it finds a HugeTLB page within the range, without a chance to handle them. Since HugeTLB pages can be migrated as any LRU or Movable page, it does not make sense to bail out without trying. Enable the interface to recogniz

Re: [PATCH v4] mm: cma: support sysfs

2021-03-05 Thread David Hildenbrand
On 04.03.21 17:17, Minchan Kim wrote: Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experience. This patch introduces sysfs statistics for CMA, in order to provide some basic monitoring of the CM

Re: [PATCH v3 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-03-05 Thread David Hildenbrand
On 04.03.21 01:03, Shakeel Butt wrote: On Wed, Mar 3, 2021 at 3:34 PM Suren Baghdasaryan wrote: On Wed, Mar 3, 2021 at 3:17 PM Shakeel Butt wrote: On Wed, Mar 3, 2021 at 10:58 AM Suren Baghdasaryan wrote: process_madvise currently requires ptrace attach capability. PTRACE_MODE_ATTACH giv

Re: [PATCH v3 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-03-05 Thread David Hildenbrand
On 05.03.21 18:45, Shakeel Butt wrote: On Fri, Mar 5, 2021 at 9:37 AM David Hildenbrand wrote: On 04.03.21 01:03, Shakeel Butt wrote: On Wed, Mar 3, 2021 at 3:34 PM Suren Baghdasaryan wrote: On Wed, Mar 3, 2021 at 3:17 PM Shakeel Butt wrote: On Wed, Mar 3, 2021 at 10:58 AM Suren

Re: [PATCH v3 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-03-05 Thread David Hildenbrand
On 05.03.21 19:08, Suren Baghdasaryan wrote: On Fri, Mar 5, 2021 at 9:52 AM David Hildenbrand wrote: On 05.03.21 18:45, Shakeel Butt wrote: On Fri, Mar 5, 2021 at 9:37 AM David Hildenbrand wrote: On 04.03.21 01:03, Shakeel Butt wrote: On Wed, Mar 3, 2021 at 3:34 PM Suren Baghdasaryan

Re: [PATCH V3 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-05 Thread David Hildenbrand
: David Hildenbrand Fixes: 73b20c84d42d ("arm64: mm: implement pte_devmap support") Signed-off-by: Anshuman Khandual --- arch/arm64/mm/init.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 0ace5e68efba..5920c5278

Re: [PATCH v4 3/3] x86/vmemmap: Handle unpopulated sub-pmd ranges

2021-03-05 Thread David Hildenbrand
On 04.03.21 18:08, Dave Hansen wrote: On 3/4/21 9:02 AM, Dave Hansen wrote: +#define PAGE_UNUSED 0xFD +/* + * The unused vmemmap range, which was not yet memset(PAGE_UNUSED) ranges + * from unused_pmd_start to next PMD_SIZE boundary. + */ +static unsigned long unused_pmd_start __meminitdata; Th

Re: [PATCH v3 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-03-05 Thread David Hildenbrand
> Am 05.03.2021 um 19:36 schrieb Suren Baghdasaryan : > > On Fri, Mar 5, 2021 at 10:23 AM David Hildenbrand wrote: >> >>> On 05.03.21 19:08, Suren Baghdasaryan wrote: >>> On Fri, Mar 5, 2021 at 9:52 AM David Hildenbrand wrote: >>>> >>>

Re: [PATCH v1 0/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

2021-03-30 Thread David Hildenbrand
On 17.03.21 12:06, David Hildenbrand wrote: Excessive details on MADV_POPULATE_(READ|WRITE) can be found in patch #2. Now accompanied by minor adjustments and selftests/vm tests. RFCv2 -> v1 - "mm: fix variable name in declaration of populate_vma_page_range()" -- Added - "mm/

Re: [PATCH v2] kernel/resource: Fix locking in request_free_mem_region

2021-03-30 Thread David Hildenbrand
On 29.03.21 03:37, Alistair Popple wrote: On Friday, 26 March 2021 7:57:51 PM AEDT David Hildenbrand wrote: On 26.03.21 02:20, Alistair Popple wrote: request_free_mem_region() is used to find an empty range of physical addresses for hotplugging ZONE_DEVICE memory. It does this by iterating

Re: [PATCH] mm/ksm: remove unused parameter from remove_trailing_rmap_items()

2021-03-30 Thread David Hildenbrand
re were no VM_MERGEABLE vmas with such addresses. */ - remove_trailing_rmap_items(slot, ksm_scan.rmap_list); + remove_trailing_rmap_items(ksm_scan.rmap_list); spin_lock(&ksm_mmlist_lock); ksm_scan.mm_slot = list_entry(slot->mm_list.next, Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v1 2/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

2021-03-30 Thread David Hildenbrand
[...] Let's introduce MADV_POPULATE_READ and MADV_POPULATE_WRITE with the following semantics: 1. MADV_POPULATE_READ can be used to preallocate backend memory and prefault page tables just like manually reading each individual page. This will not break any COW mappings -- e.g., it will

Re: [PATCH] mm: change size_t to unsigned int for cma_alloc

2021-03-30 Thread David Hildenbrand
On 30.03.21 17:00, Minchan Kim wrote: On Tue, Mar 30, 2021 at 09:58:37AM +0200, David Hildenbrand wrote: On 29.03.21 22:12, Minchan Kim wrote: On Mon, Mar 29, 2021 at 07:44:31PM +0100, Matthew Wilcox wrote: On Mon, Mar 29, 2021 at 11:25:53AM -0700, Minchan Kim wrote: size_t in cma_alloc is

Re: [PATCH v1 2/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

2021-03-30 Thread David Hildenbrand
On 30.03.21 18:21, Jann Horn wrote: On Tue, Mar 30, 2021 at 5:01 PM David Hildenbrand wrote: +long faultin_vma_page_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end, bool write, int *locked) +{ + struct mm_struct *mm = vma->vm

Re: [PATCH v1 2/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

2021-03-30 Thread David Hildenbrand
On 30.03.21 18:30, David Hildenbrand wrote: On 30.03.21 18:21, Jann Horn wrote: On Tue, Mar 30, 2021 at 5:01 PM David Hildenbrand wrote: +long faultin_vma_page_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end, bool write, int *locked

Re: [PATCH v2] kernel/resource: Fix locking in request_free_mem_region

2021-03-30 Thread David Hildenbrand
On 31.03.21 08:19, Alistair Popple wrote: On Tuesday, 30 March 2021 8:13:32 PM AEDT David Hildenbrand wrote: External email: Use caution opening links or attachments On 29.03.21 03:37, Alistair Popple wrote: On Friday, 26 March 2021 7:57:51 PM AEDT David Hildenbrand wrote: On 26.03.21 02:20

Re: [PATCH v5] mm/gup: check page hwposion status for coredump.

2021-03-30 Thread David Hildenbrand
On 31.03.21 06:32, HORIGUCHI NAOYA(堀口 直也) wrote: On Wed, Mar 31, 2021 at 10:43:36AM +0800, Aili Yao wrote: On Wed, 31 Mar 2021 01:52:59 + HORIGUCHI NAOYA(堀口 直也) wrote: On Fri, Mar 26, 2021 at 03:22:49PM +0100, David Hildenbrand wrote: On 26.03.21 15:09, David Hildenbrand wrote: On

Re: [PATCH v1 0/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

2021-03-30 Thread David Hildenbrand
On 31.03.21 06:58, Andrew Morton wrote: On Tue, 30 Mar 2021 10:58:43 +0200 David Hildenbrand wrote: MAINTAINERS| 1 + arch/alpha/include/uapi/asm/mman.h | 3 + arch/mips/include/uapi/asm/mman.h | 3 + arch/parisc/include/uapi

Re: [PATCH v5] mm/gup: check page hwposion status for coredump.

2021-03-31 Thread David Hildenbrand
On 31.03.21 08:53, HORIGUCHI NAOYA(堀口 直也) wrote: On Wed, Mar 31, 2021 at 07:07:39AM +0100, Matthew Wilcox wrote: On Wed, Mar 31, 2021 at 01:52:59AM +, HORIGUCHI NAOYA(堀口 直也) wrote: If we successfully unmapped but failed in truncate_error_page() for example, the processes mapping the page wo

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-31 Thread David Hildenbrand
On 30.03.21 12:30, Catalin Marinas wrote: On Mon, Mar 29, 2021 at 05:06:51PM +0100, Steven Price wrote: On 28/03/2021 13:21, Catalin Marinas wrote: On Sat, Mar 27, 2021 at 03:23:24PM +, Catalin Marinas wrote: On Fri, Mar 12, 2021 at 03:18:58PM +, Steven Price wrote: diff --git a/arch/

Re: [PATCH v3 1/8] mm/cma: change cma mutex to irq safe spinlock

2021-03-31 Thread David Hildenbrand
atic int cma_maxchunk_get(void *data, u64 *val) end = find_next_bit(cma->bitmap, bitmap_maxno, start); maxchunk = max(end - start, maxchunk); } - mutex_unlock(&cma->lock); + spin_unlock_irq(&cma->lock); *val = (u64)maxchunk << cma->order_per_bit; return 0; Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-31 Thread David Hildenbrand
On 31.03.21 11:21, Catalin Marinas wrote: On Wed, Mar 31, 2021 at 09:34:44AM +0200, David Hildenbrand wrote: On 30.03.21 12:30, Catalin Marinas wrote: On Mon, Mar 29, 2021 at 05:06:51PM +0100, Steven Price wrote: On 28/03/2021 13:21, Catalin Marinas wrote: On Sat, Mar 27, 2021 at 03:23:24PM

Re: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned

2021-03-31 Thread David Hildenbrand
On 31.03.21 12:56, Aili Yao wrote: On Thu, 25 Feb 2021 12:39:30 +0100 Oscar Salvador wrote: On Thu, Feb 25, 2021 at 11:28:18AM +, HORIGUCHI NAOYA(堀口 直也) wrote: Hi Aili, I agree that this set_mce_nospec() is not expected to be called for "already hwpoisoned" page because in the reported c

Re: [PATCH v10 2/6] arm64: kvm: Introduce MTE VM feature

2021-03-31 Thread David Hildenbrand
On 31.03.21 12:41, Steven Price wrote: On 31/03/2021 10:32, David Hildenbrand wrote: On 31.03.21 11:21, Catalin Marinas wrote: On Wed, Mar 31, 2021 at 09:34:44AM +0200, David Hildenbrand wrote: On 30.03.21 12:30, Catalin Marinas wrote: On Mon, Mar 29, 2021 at 05:06:51PM +0100, Steven Price

Re: [PATCH] memfd_secret: use unsigned int rather than long as syscall flags type

2021-03-31 Thread David Hildenbrand
On 31.03.21 16:23, Mike Rapoport wrote: From: Mike Rapoport Yuri Norov says: If parameter size is the same for native and compat ABIs, we may wire a syscall made by compat client to native handler. This is true for unsigned int, but not true for unsigned long or pointer. That's wh

Re: [PATCH] mm: use proper type for cma_[alloc|release]

2021-03-31 Thread David Hildenbrand
also respect it. [1] 67a2e213e7e9, mm: cma: fix incorrect type conversion for size during dma allocation Link: https://lore.kernel.org/linux-mm/20210324043434.gp1719...@casper.infradead.org/ Cc: Matthew Wilcox Cc: David Hildenbrand Signed-off-by: Minchan Kim --- include/linux/cma.h

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-03 Thread David Hildenbrand
On 03.03.21 20:04, Catalin Marinas wrote: On Thu, Feb 11, 2021 at 01:35:56PM +0100, David Hildenbrand wrote: On 11.02.21 13:10, Anshuman Khandual wrote: On 2/11/21 5:23 PM, Will Deacon wrote: ... and dropped. These patches appear to be responsible for a boot regression reported by CKI: Ahh

Re: [PATCH 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-04 Thread David Hildenbrand
On 03.03.21 21:23, Minchan Kim wrote: On Wed, Mar 03, 2021 at 01:49:36PM +0100, Michal Hocko wrote: On Tue 02-03-21 13:09:48, Minchan Kim wrote: LRU pagevec holds refcount of pages until the pagevec are drained. It could prevent migration since the refcount of the page is greater than the expec

Re: [PATCH V2 1/2] arm64/mm: Fix pfn_valid() for ZONE_DEVICE based memory

2021-03-04 Thread David Hildenbrand
On 04.03.21 04:31, Anshuman Khandual wrote: On 3/4/21 2:54 AM, Will Deacon wrote: On Wed, Mar 03, 2021 at 07:04:33PM +, Catalin Marinas wrote: On Thu, Feb 11, 2021 at 01:35:56PM +0100, David Hildenbrand wrote: On 11.02.21 13:10, Anshuman Khandual wrote: On 2/11/21 5:23 PM, Will Deacon

Re: [PATCH] mm/hugetlb: suppress wrong warning info when alloc gigantic page

2021-03-04 Thread David Hildenbrand
On 19.02.21 20:14, Mike Kravetz wrote: On 2/19/21 4:39 AM, Chen Wandun wrote: If hugetlb_cma is enabled, it will skip boot time allocation when allocating gigantic page, that doesn't means allocation failure, so suppress this warning info. Normally the addition of warning messages is discoura

Re: [PATCH v1 1/2] s390/kvm: split kvm_s390_real_to_abs

2021-03-22 Thread David Hildenbrand
, -unsigned long gra) +static inline unsigned long _kvm_s390_real_to_abs(u32 prefix, unsigned long gra) Just a matter of taste, but maybe this could be named differently? kvm_s390_real2abs_prefix() ? kvm_s390_prefix_real_to_abs()? +1, I also dislike these "_.*" style functions here. Reviewed

Re: [PATCH v1 2/2] s390/kvm: VSIE: fix MVPG handling for prefixing and MSO

2021-03-22 Thread David Hildenbrand
On 19.03.21 20:33, Claudio Imbrenda wrote: Prefixing needs to be applied to the guest real address to translate it into a guest absolute address. The value of MSO needs to be added to a guest-absolute address in order to obtain the host-virtual. Fixes: 223ea46de9e79 ("s390/kvm: VSIE: correctly

<    5   6   7   8   9   10   11   12   13   14   >