Re: [PATCH STABLE 4.9] mm: Avoid calling build_all_zonelists_init under hotplug context

2020-08-18 Thread David Hildenbrand
On 18.08.20 13:00, Oscar Salvador wrote: > Recently a customer of ours experienced a crash when booting the > system while enabling memory-hotplug. > > The problem is that Normal zones on different nodes don't get their private > zone->pageset allocated, and keep sharing the initial boot_pageset.

Re: [PATCH v2 1/2] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags

2020-08-19 Thread David Hildenbrand
On 19.08.20 09:55, Anshuman Khandual wrote: > > > On 08/19/2020 11:17 AM, Alex Shi wrote: >> pageblock_flags is used as long, since every pageblock_flags is just 4 >> bits, 'long' size will include 8(32bit machine) or 16 pageblocks' flags, >> that flag setting has to sync in cmpxchg with 7 or 15

Re: [PATCH v2 2/2] mm/pageblock: remove false sharing in pageblock_flags

2020-08-19 Thread David Hildenbrand
On 19.08.20 10:09, Alex Shi wrote: > > > 在 2020/8/19 下午3:57, Anshuman Khandual 写道: >> >> >> On 08/19/2020 11:17 AM, Alex Shi wrote: >>> Current pageblock_flags is only 4 bits, so it has to share a char size >>> in cmpxchg when get set, the false sharing cause perf drop. >>> >>> If we incrase the

[PATCH v1 01/11] mm/memory_hotplug: inline __offline_pages() into offline_pages()

2020-08-19 Thread David Hildenbrand
There is only a single user, offline_pages(). Let's inline, to make it look more similar to online_pages(). Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 16 +-

[PATCH v1 11/11] mm/memory_hotplug: mark pageblocks MIGRATE_ISOLATE while onlining memory

2020-08-19 Thread David Hildenbrand
He Cc: Pankaj Gupta Cc: Oscar Salvador Cc: Charan Teja Reddy Signed-off-by: David Hildenbrand --- mm/Kconfig | 2 +- mm/memory_hotplug.c | 32 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 6c974888f8

[PATCH v1 02/11] mm/memory_hotplug: enforce section granularity when onlining/offlining

2020-08-19 Thread David Hildenbrand
restriction now. Current users (core and powernv/memtrace) respect these restrictions. Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 10 ++ 1 file changed, 10 insertions

[PATCH v1 10/11] mm: pass migratetype into memmap_init_zone() and move_pfn_range_to_zone()

2020-08-19 Thread David Hildenbrand
nghua Yu Cc: Logan Gunthorpe Cc: Dan Williams Cc: Mike Rapoport Cc: "Matthew Wilcox (Oracle)" Cc: Michel Lespinasse Cc: linux-i...@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/ia64/mm/init.c| 4 ++-- include/linux/memory_hotplug.h | 3 ++- inc

[PATCH v1 05/11] mm/page_alloc: simplify __offline_isolated_pages()

2020-08-19 Thread David Hildenbrand
Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 4 ++-- mm/page_alloc.c| 27 --- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/include/linux/memory_hotplug.h b

[PATCH v1 06/11] mm/memory_hotplug: drop nr_isolate_pageblock in offline_pages()

2020-08-19 Thread David Hildenbrand
pageblocks from nr_pages. Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/memory_hotplug.c b/mm

[PATCH v1 03/11] mm/memory_hotplug: simplify checking if all pages are isolated in offline_pages()

2020-08-19 Thread David Hildenbrand
-by: David Hildenbrand --- mm/memory_hotplug.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 6856702af68d9..f64478349148d 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1384,17 +1384,6

[PATCH v1 08/11] mm/memory_hotplug: simplify page onlining

2020-08-19 Thread David Hildenbrand
e Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 38 ++ 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0011a1115381c..3aba0d956f9b1 100644 ---

[PATCH v1 09/11] mm/page_alloc: drop stale pageblock comment in memmap_init_zone*()

2020-08-19 Thread David Hildenbrand
c: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Cc: Mel Gorman Signed-off-by: David Hildenbrand --- mm/page_alloc.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 848664352dfe2..5db0b

[PATCH v1 07/11] mm/page_isolation: simplify return value of start_isolate_page_range()

2020-08-19 Thread David Hildenbrand
Callers no longer need the number of isolated pageblocks. Let's simplify. Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 2 +- mm/page_alloc.c | 2 +- mm/page_isolation.

[PATCH v1 04/11] mm/memory_hotplug: simplify offlining of pages in offline_pages()

2020-08-19 Thread David Hildenbrand
: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index f64478349148d..50aa5df696e9d

[PATCH v1 00/11] mm/memory_hotplug: online_pages()/offline_pages() cleanups

2020-08-19 Thread David Hildenbrand
done, the pageblocks are set to MIGRATE_MOVABLE, such that allocations are possible. I played with DIMMs and virtio-mem on x86-64 and didn't spot any surprises. I verified that the numer of isolated pageblocks is correctly handled when onlining/offlining. David Hildenbrand (11): mm/memory_

Re: [PATCH v4 0/6] mm: introduce memfd_secret system call to create "secret" memory areas

2020-08-19 Thread David Hildenbrand
On 18.08.20 16:15, Mike Rapoport wrote: > From: Mike Rapoport > > Hi, > > This is an implementation of "secret" mappings backed by a file descriptor. > > v4 changes: > * rebase on v5.9-rc1 > * Do not redefine PMD_PAGE_ORDER in fs/dax.c, thanks Kirill > * Make secret mappings exclusive by defau

Re: [PATCH v4 6/6] mm: secretmem: add ability to reserve memory at boot

2020-08-19 Thread David Hildenbrand
On 18.08.20 16:15, Mike Rapoport wrote: > From: Mike Rapoport > > Taking pages out from the direct map and bringing them back may create > undesired fragmentation and usage of the smaller pages in the direct > mapping of the physical memory. > > This can be avoided if a significantly large area

Re: [PATCH v4 0/6] mm: introduce memfd_secret system call to create "secret" memory areas

2020-08-19 Thread David Hildenbrand
On 19.08.20 13:42, Mike Rapoport wrote: > On Wed, Aug 19, 2020 at 12:47:54PM +0200, David Hildenbrand wrote: >> On 18.08.20 16:15, Mike Rapoport wrote: >>> From: Mike Rapoport >>> >>> Hi, >>> >>> This is an implementation of "secret

Re: [PATCH v4 6/6] mm: secretmem: add ability to reserve memory at boot

2020-08-19 Thread David Hildenbrand
On 19.08.20 13:53, Mike Rapoport wrote: > On Wed, Aug 19, 2020 at 12:49:05PM +0200, David Hildenbrand wrote: >> On 18.08.20 16:15, Mike Rapoport wrote: >>> From: Mike Rapoport >>> >>> Taking pages out from the direct map and bringing them back may create >

Re: [PATCH v1 02/11] mm/memory_hotplug: enforce section granularity when onlining/offlining

2020-08-19 Thread David Hildenbrand
On 19.08.20 14:37, Michal Hocko wrote: > On Wed 19-08-20 12:11:48, David Hildenbrand wrote: >> Already two people (including me) tried to offline subsections, because >> the function looks like it can deal with it. But we really can only >> online/offline full sections (e.g.,

Re: [PATCH v1 04/11] mm/memory_hotplug: simplify offlining of pages in offline_pages()

2020-08-19 Thread David Hildenbrand
On 19.08.20 14:40, Michal Hocko wrote: > On Wed 19-08-20 12:11:50, David Hildenbrand wrote: >> We make sure that we cannot have any memory holes right at the beginning >> of offline_pages(). We no longer need walk_system_ram_range() and can >> call __offline_isol

Re: [PATCH v1 11/11] mm/memory_hotplug: mark pageblocks MIGRATE_ISOLATE while onlining memory

2020-08-19 Thread David Hildenbrand
On 19.08.20 15:16, Michal Hocko wrote: > On Wed 19-08-20 12:11:57, David Hildenbrand wrote: >> Currently, it can happen that pages are allocated (and freed) via the buddy >> before we finished basic memory onlining. >> >> For example, pages are exposed to the buddy

Re: [PATCH v4 6/6] mm: secretmem: add ability to reserve memory at boot

2020-08-19 Thread David Hildenbrand
On 19.08.20 19:33, Mike Rapoport wrote: > On Wed, Aug 19, 2020 at 02:10:43PM +0200, David Hildenbrand wrote: >> On 19.08.20 13:53, Mike Rapoport wrote: >>> On Wed, Aug 19, 2020 at 12:49:05PM +0200, David Hildenbrand wrote: >>>> On 18.08.20 16:15, Mike Rapoport wr

[PATCH v2 02/10] mm/memory_hotplug: enforce section granularity when onlining/offlining

2020-08-19 Thread David Hildenbrand
to document the restriction now. Current users (core and powernv/memtrace) respect these restrictions. Acked-by: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 10

[PATCH v2 01/10] mm/memory_hotplug: inline __offline_pages() into offline_pages()

2020-08-19 Thread David Hildenbrand
There is only a single user, offline_pages(). Let's inline, to make it look more similar to online_pages(). Acked-by: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotp

[PATCH v2 00/10] mm/memory_hotplug: online_pages()/offline_pages() cleanups

2020-08-19 Thread David Hildenbrand
isolated in offline_pages()", resulting in "mm/memory_hotplug: simplify page offlining" - Added ACKs David Hildenbrand (10): mm/memory_hotplug: inline __offline_pages() into offline_pages() mm/memory_hotplug: enforce section granularity when onlining/offlining mm/memory_

[PATCH v2 04/10] mm/page_alloc: simplify __offline_isolated_pages()

2020-08-19 Thread David Hildenbrand
: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- include/linux/memory_hotplug.h | 4 ++-- mm/page_alloc.c| 27 --- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/include

[PATCH v2 05/10] mm/memory_hotplug: drop nr_isolate_pageblock in offline_pages()

2020-08-19 Thread David Hildenbrand
pageblocks from nr_pages. Acked-by: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm

[PATCH v2 06/10] mm/page_isolation: simplify return value of start_isolate_page_range()

2020-08-19 Thread David Hildenbrand
Callers no longer need the number of isolated pageblocks. Let's simplify. Acked-by: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 2 +- mm/page_alloc.c

[PATCH v2 03/10] mm/memory_hotplug: simplify page offlining

2020-08-19 Thread David Hildenbrand
: Michal Hocko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 46 ++--- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/mm

[PATCH v2 07/10] mm/memory_hotplug: simplify page onlining

2020-08-19 Thread David Hildenbrand
Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 38 ++ 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0011a1115381c..3aba0d95

[PATCH v2 09/10] mm: pass migratetype into memmap_init_zone() and move_pfn_range_to_zone()

2020-08-19 Thread David Hildenbrand
vador Cc: Tony Luck Cc: Fenghua Yu Cc: Logan Gunthorpe Cc: Dan Williams Cc: Mike Rapoport Cc: "Matthew Wilcox (Oracle)" Cc: Michel Lespinasse Cc: linux-i...@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/ia64/mm/init.c| 4 ++-- include/linux/memory

[PATCH v2 08/10] mm/page_alloc: drop stale pageblock comment in memmap_init_zone*()

2020-08-19 Thread David Hildenbrand
cko Cc: Andrew Morton Cc: Michal Hocko Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Cc: Mel Gorman Signed-off-by: David Hildenbrand --- mm/page_alloc.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/mm/page_alloc.c b/mm/pag

[PATCH v2 10/10] mm/memory_hotplug: mark pageblocks MIGRATE_ISOLATE while onlining memory

2020-08-19 Thread David Hildenbrand
Cc: Wei Yang Cc: Baoquan He Cc: Pankaj Gupta Cc: Oscar Salvador Cc: Charan Teja Reddy Signed-off-by: David Hildenbrand --- mm/Kconfig | 2 +- mm/memory_hotplug.c | 32 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/mm/Kconfig b

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-11 Thread David Hildenbrand
On 11.01.21 05:17, Anshuman Khandual wrote: > > > On 1/8/21 9:00 PM, David Hildenbrand wrote: >>> To summarize, the section size bits for each base page size config >>> should always >>> >>> a. Avoid (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_

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

2021-01-11 Thread David Hildenbrand
On 04.01.21 07:18, Anshuman Khandual wrote: > > On 12/22/20 2:41 PM, David Hildenbrand wrote: >> On 22.12.20 08:12, Anshuman Khandual wrote: >>> pfn_valid() validates a pfn but basically it checks for a valid struct page >>> backing for that pfn. It should always ret

Re: [PATCH V2 3/3] s390/mm: Define arch_get_mappable_range()

2021-01-11 Thread David Hildenbrand
) check that would ensure that memhp_range_allowed() has already > been called on the hotplug path. > > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: David Hildenbrand > Cc: linux-s...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Acked-by: Heiko Carstens

Re: [PATCH V2 1/3] mm/hotplug: Prevalidate the address range being added with platform

2021-01-11 Thread David Hildenbrand
otplug/ Everywhere in this patch: Use "true/false" for boolean values. > Cc: David Hildenbrand > Cc: Andrew Morton > Cc: linux...@kvack.org > Cc: linux-kernel@vger.kernel.org > Suggested-by: David Hildenbrand > Signed-off-by: Anshuman Khandual

[PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug

2021-01-11 Thread David Hildenbrand
: Jonathan Cameron Cc: h...@linux.ibm.com Cc: Vasily Gorbik Cc: Will Deacon Cc: Ard Biesheuvel Cc: Mark Rutland Cc: Heiko Carstens Cc: Michal Hocko Signed-off-by: David Hildenbrand --- This is an example how virito-mem intends to use an interface like memhp_get_pluggable_range() once around. See

Re: [PATCH] mm/compaction: Remove duplicated VM_BUG_ON_PAGE !PageLocked

2021-01-11 Thread David Hildenbrand
e); > VM_BUG_ON_PAGE(!PageMovable(page), page); > /* >* Clear registered address_space val with keeping PAGE_MAPPING_MOVABLE > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 1/5] mm: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-01-11 Thread David Hildenbrand
On 17.12.20 14:07, Oscar Salvador wrote: > In order to use self-hosted memmap array, the platform needs to have > support for CONFIG_SPARSEMEM_VMEMMAP and altmap. > Currently, only arm64, PPC and x86_64 have the support, so enable those > platforms with ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE. "In the fi

Re: [PATCH 3/5] acpi,memhotplug: Enable MHP_MEMMAP_ON_MEMORY when supported

2021-01-11 Thread David Hildenbrand
result = __add_memory(node, info->start_addr, info->length, > - MHP_NONE); > + mhp_flags); > > /* >* If the memory block has been used by the kernel, add_memory() > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH 4/5] powerpc/memhotplug: Enable MHP_MEMMAP_ON_MEMORY when supported

2021-01-11 Thread David Hildenbrand
On 17.12.20 14:07, Oscar Salvador wrote: > Let the caller check whether it can pass MHP_MEMMAP_ON_MEMORY by > checking mhp_supports_memmap_on_memory(). > MHP_MEMMAP_ON_MEMORY can only be set in case > ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE is enabled, the architecture supports > altmap, and the range to

Re: [PATCH 2/2] resource: Make it possible to reserve memory on 64bit platform

2021-01-11 Thread David Hildenbrand
On 11.01.21 17:33, Wesley Zhao wrote: > From: "Wesley.Zhao" > > For now "reserve=" is limitied to 32bit,not available on 64bit > platform,so we change the get_option() to get_option_ull(added in > patch: commit 4b6bfe96265e ("lib/cmdline: add new function > get_option_ull()")) Curious, what's th

Re: [PATCH] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread David Hildenbrand
On 12.01.21 10:18, Dan Williams wrote: > On Thu, Jan 7, 2021 at 1:16 AM David Hildenbrand wrote: >> >> [...] >> >>>>> Well, I would love to have no surprises either. So far there was not >>>>> actual argument why the pmem reserved space cannot be

Re: [PATCH v2 1/5] mm: Move pfn_to_online_page() out of line

2021-01-12 Thread David Hildenbrand
On 12.01.21 10:34, Dan Williams wrote: > pfn_to_online_page() is already too large to be a macro or an inline > function. In anticipation of further logic changes / growth, move it out > of line. > > No functional change, just code movement. > > Cc: David Hildenbrand > R

Re: [PATCH v2 2/5] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-12 Thread David Hildenbrand
sing > pfn_valid_within(), just use pfn_section_valid(). This loses the > valid_section() check that pfn_valid_within() was performing, but that > was already redundant with the online check. > > Fixes: b13bc35193d9 ("mm/hotplug: invalid PFNs from pfn_to_online_page()&quo

Re: [PATCH v2 3/5] mm: Teach pfn_to_online_page() about ZONE_DEVICE section collisions

2021-01-12 Thread David Hildenbrand
ase is rare, and for simplicity, the > SECTION_TAINT_ZONE_DEVICE flag is never cleared once set. > > Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") > Cc: Andrew Morton > Reported-by: Michal Hocko > Reported-by: David Hildenbrand > Signed-off-by: D

Re: [PATCH V2 1/3] mm/hotplug: Prevalidate the address range being added with platform

2021-01-12 Thread David Hildenbrand
On 12.01.21 04:51, Anshuman Khandual wrote: > > > On 1/11/21 7:13 PM, Oscar Salvador wrote: >> On Mon, Jan 11, 2021 at 11:51:47AM +0100, David Hildenbrand wrote: >>> AFAIKs, all memhp_get_pluggable_range() users pass "1". >>> >>> What about the

Re: [PATCH 1/5] mm: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-01-12 Thread David Hildenbrand
On 12.01.21 08:26, Oscar Salvador wrote: > On Mon, Jan 11, 2021 at 05:52:19PM +0100, David Hildenbrand wrote: >> On 17.12.20 14:07, Oscar Salvador wrote: >>> In order to use self-hosted memmap array, the platform needs to have >>> support for CONFIG_SPARSEMEM_VMEMMA

Re: [PATCH v2 4/5] mm: Fix page reference leak in soft_offline_page()

2021-01-12 Thread David Hildenbrand
; > !pfn_to_online_page() pfn the kernel hangs at dax-device shutdown due to > a leaked reference. > > Fixes: feec24a6139d ("mm, soft-offline: convert parameter to pfn") > Cc: Andrew Morton > Cc: Naoya Horiguchi > Cc: David Hildenbrand > Cc: Michal Hocko &

Re: [RFC PATCH 0/3] create hugetlb flags to consolidate state

2021-01-12 Thread David Hildenbrand
On 11.01.21 22:01, Mike Kravetz wrote: > While discussing a series of hugetlb fixes in [1], it became evident > that the hugetlb specific page state information is stored in a somewhat > haphazard manner. Code dealing with state information would be easier > to read, understand and maintain if thi

Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 10.01.21 13:40, Muchun Song wrote: > If the refcount is one when it is migrated, it means that the page > was freed from under us. So we are done and do not need to migrate. > > This optimization is consistent with the regular pages, just like > unmap_and_move() does. > > Signed-off-by: Muchun

Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 12.01.21 12:00, David Hildenbrand wrote: > On 10.01.21 13:40, Muchun Song wrote: >> If the refcount is one when it is migrated, it means that the page >> was freed from under us. So we are done and do not need to migrate. >> >> This optimization is consistent with t

Re: [PATCH 1/5] mm: Introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE

2021-01-12 Thread David Hildenbrand
On 12.01.21 12:17, Oscar Salvador wrote: > On Tue, Jan 12, 2021 at 11:12:30AM +0100, David Hildenbrand wrote: >> On 12.01.21 08:26, Oscar Salvador wrote: >>> You mean introducing only mm/Kconfig change in this patch, and then >>> arch/*/Kconfig changes in separate patch

Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 12.01.21 12:27, Michal Hocko wrote: > On Tue 12-01-21 12:11:21, David Hildenbrand wrote: >> On 12.01.21 12:00, David Hildenbrand wrote: >>> On 10.01.21 13:40, Muchun Song wrote: >>>> If the refcount is one when it is migrated, it means that the page >>>&g

Re: [PATCH v8 06/12] mm/hugetlb: Allocate the vmemmap pages associated with each HugeTLB page

2020-12-11 Thread David Hildenbrand
> Am 11.12.2020 um 10:35 schrieb Oscar Salvador : > > On Thu, Dec 10, 2020 at 11:55:20AM +0800, Muchun Song wrote: >> When we free a HugeTLB page to the buddy allocator, we should allocate the >> vmemmap pages associated with it. We can do that in the __free_hugepage() > "vmemmap pages that des

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread David Hildenbrand
> Am 11.12.2020 um 22:09 schrieb Pavel Tatashin : > > On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: >> >>> On Fri, Dec 11, 2020 at 03:40:57PM -0500, Pavel Tatashin wrote: >>> On Fri, Dec 11, 2020 at 3:23 PM Jason Gunthorpe wrote: On Fri, Dec 11, 2020 at 03:21:39PM -0500,

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-11 Thread David Hildenbrand
> Am 11.12.2020 um 22:36 schrieb Pavel Tatashin : > > On Fri, Dec 11, 2020 at 4:29 PM David Hildenbrand wrote: >> >> >>>> Am 11.12.2020 um 22:09 schrieb Pavel Tatashin : >>> >>> On Fri, Dec 11, 2020 at 3:46 PM Jason Gunthorpe wrote: &

Re: [PATCH v3 5/6] mm/gup: migrate pinned pages out of movable zone

2020-12-12 Thread David Hildenbrand
> Am 12.12.2020 um 00:50 schrieb Jason Gunthorpe : > > On Fri, Dec 11, 2020 at 10:53:00PM +0100, David Hildenbrand wrote: > >>> When check_and_migrate_movable_pages() is called, the pages are >>> already pinned. If some of those pages are in movable zone, and we

Re: [RFC PATCH 2/3] virtio-balloon: add support for providing free huge page reports to host

2020-12-22 Thread David Hildenbrand
On 22.12.20 08:48, Liang Li wrote: > Free page reporting only supports buddy pages, it can't report the > free pages reserved for hugetlbfs case. On the other hand, hugetlbfs The virtio-balloon free page reporting interface accepts a generic sg, so it isn't glue to buddy pages. There is no need fo

Re: [RFC PATCH 3/3] mm: support free hugepage pre zero out

2020-12-22 Thread David Hildenbrand
On 22.12.20 08:49, Liang Li wrote: > This patch add support of pre zero out free hugepage, we can use > this feature to speed up page population and page fault handing. > > Cc: Alexander Duyck > Cc: Mel Gorman > Cc: Andrea Arcangeli > Cc: Dan Williams > Cc:

Re: [RFC v2 PATCH 0/4] speed up page allocation for __GFP_ZERO

2020-12-22 Thread David Hildenbrand
On 21.12.20 17:25, Liang Li wrote: > The first version can be found at: https://lkml.org/lkml/2020/4/12/42 > > Zero out the page content usually happens when allocating pages with > the flag of __GFP_ZERO, this is a time consuming operation, it makes > the population of a large vma area very slowl

Re: [RFC PATCH 3/3] mm: support free hugepage pre zero out

2020-12-22 Thread David Hildenbrand
On 22.12.20 09:31, David Hildenbrand wrote: > On 22.12.20 08:49, Liang Li wrote: >> This patch add support of pre zero out free hugepage, we can use >> this feature to speed up page population and page fault handing. >> >> Cc: Alexander Duyck >> Cc: Mel Gorman &g

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

2020-12-22 Thread David Hildenbrand
On 22.12.20 08:12, Anshuman Khandual wrote: > pfn_valid() validates a pfn but basically it checks for a valid struct page > backing for that pfn. It should always return positive for memory ranges > backed with struct page mapping. But currently pfn_valid() fails for all > ZONE_DEVICE based memory

Re: [RFC v2 PATCH 0/4] speed up page allocation for __GFP_ZERO

2020-12-22 Thread David Hildenbrand
> >>> >>> Virtulization >>> = >>> Speed up VM creation and shorten guest boot time, especially for PCI >>> SR-IOV device passthrough scenario. Compared with some of the para >>> vitalization solutions, it is easy to deploy because it’s transparent >>> to guest and can handle DMA proper

Re: [RFC v2 PATCH 0/4] speed up page allocation for __GFP_ZERO

2020-12-23 Thread David Hildenbrand
[...] >> I was rather saying that for security it's of little use IMHO. >> Application/VM start up time might be improved by using huge pages (and >> pre-zeroing these). Free page reporting might be improved by using >> MADV_FREE instead of MADV_DONTNEED in the hypervisor. >> >>> this feature, abo

Re: [RFC V2 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-07 Thread David Hildenbrand
On 07.12.20 05:38, Anshuman Khandual wrote: > > > On 12/3/20 5:31 PM, David Hildenbrand wrote: >> On 03.12.20 12:51, Heiko Carstens wrote: >>> On Thu, Dec 03, 2020 at 06:03:00AM +0530, Anshuman Khandual wrote: >>>>>> diff --git a/arch/s390/mm/ext

Re: 5.10 RC 7: grub2 out of memory

2020-12-07 Thread David Hildenbrand
On 07.12.20 10:16, Elias Carter wrote: > I just compiled and installed 5.10 RC 7 and got a message from grub2: > "out of memory, press any key to continue" shortly followed by a > kernel panic (see attached screenshot). > > The 5.4.0-56-generic kernel from Ubuntu works on my machine fine. > > Thi

Re: [PATCH v3] mm/page_alloc: speeding up the iteration of max_order

2020-12-07 Thread David Hildenbrand
mal pageblock. Without this, pageblock > @@ -1062,7 +1062,7 @@ static inline void __free_one_page(struct page *page, > is_migrate_isolate(buddy_mt))) > goto done_merging; > } > - max_order++; > + max_order = order + 1; > goto continue_merging; > } > > LGTM Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [RFC V2 00/37] Enhance memory utilization with DMEMFS

2020-12-07 Thread David Hildenbrand
On 07.12.20 12:30, yulei.ker...@gmail.com wrote: > From: Yulei Zhang > > In current system each physical memory page is assocaited with > a page structure which is used to track the usage of this page. > But due to the memory usage rapidly growing in cloud environment, > we find the resource cons

Re: [PATCH v7 01/15] mm/memory_hotplug: Move bootmem info registration API to bootmem_info.c

2020-12-07 Thread David Hildenbrand
+++ > mm/memory_hotplug.c| 91 +- > 6 files changed, 129 insertions(+), 113 deletions(-) > create mode 100644 include/linux/bootmem_info.h > create mode 100644 mm/bootmem_info.c > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v7 02/15] mm/memory_hotplug: Move {get,put}_page_bootmem() to bootmem_info.c

2020-12-07 Thread David Hildenbrand
On 30.11.20 16:18, Muchun Song wrote: > In the later patch, we will use {get,put}_page_bootmem() to initialize > the page for vmemmap or free vmemmap page to buddy. So move them out of > CONFIG_MEMORY_HOTPLUG_SPARSE. This is just code movement without any > functional change. > > Signed-off-by: Mu

Re: [PATCH v7 03/15] mm/hugetlb: Introduce a new config HUGETLB_PAGE_FREE_VMEMMAP

2020-12-07 Thread David Hildenbrand
On 30.11.20 16:18, Muchun Song wrote: > The purpose of introducing HUGETLB_PAGE_FREE_VMEMMAP is to configure > whether to enable the feature of freeing unused vmemmap associated > with HugeTLB pages. And this is just for dependency check. Now only > support x86. x86 - i386 and x86-64? (I assume th

Re: [PATCH v7 04/15] mm/hugetlb: Introduce nr_free_vmemmap_pages in the struct hstate

2020-12-07 Thread David Hildenbrand
On 30.11.20 16:18, Muchun Song wrote: > Every HugeTLB has more than one struct page structure. The 2M HugeTLB > has 512 struct page structure and 1G HugeTLB has 4096 struct page > structures. We __know__ that we only use the first 4(HUGETLB_CGROUP_MIN_ORDER) > struct page structures to store metada

Re: [PATCH v7 05/15] mm/bootmem_info: Introduce {free,prepare}_vmemmap_page()

2020-12-07 Thread David Hildenbrand
On 30.11.20 16:18, Muchun Song wrote: > In the later patch, we can use the free_vmemmap_page() to free the > unused vmemmap pages and initialize a page for vmemmap page using > via prepare_vmemmap_page(). > > Signed-off-by: Muchun Song > --- > include/linux/bootmem_info.h | 24 ++

Re: [External] Re: [PATCH v7 03/15] mm/hugetlb: Introduce a new config HUGETLB_PAGE_FREE_VMEMMAP

2020-12-07 Thread David Hildenbrand
On 07.12.20 13:42, Muchun Song wrote: > On Mon, Dec 7, 2020 at 8:19 PM David Hildenbrand wrote: >> >> On 30.11.20 16:18, Muchun Song wrote: >>> The purpose of introducing HUGETLB_PAGE_FREE_VMEMMAP is to configure >>> whether to enable the feature of freeing u

Re: [RFC V2 3/3] s390/mm: Define arch_get_mappable_range()

2020-12-08 Thread David Hildenbrand
>> >> Both changes only make sense with an in-tree user. I'm planning on using >> this functionality in virtio-mem code. I can pickup your patches, drop >> the superfluous checks, and use it from virtio-mem code. Makese sense >> (BTW, looks like we'll see aarch64 support for virtio-mem soon)? > >

Re: [External] Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 12.01.21 14:40, Muchun Song wrote: > On Tue, Jan 12, 2021 at 7:11 PM David Hildenbrand wrote: >> >> On 12.01.21 12:00, David Hildenbrand wrote: >>> On 10.01.21 13:40, Muchun Song wrote: >>>> If the refcount is one when it is migrated, it means that the page

Re: [External] Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 12.01.21 15:17, Muchun Song wrote: > On Tue, Jan 12, 2021 at 9:51 PM David Hildenbrand wrote: >> >> On 12.01.21 14:40, Muchun Song wrote: >>> On Tue, Jan 12, 2021 at 7:11 PM David Hildenbrand wrote: >>>> >>>> On 12.01.21 12:00, David Hildenb

Re: [PATCH v3 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-12 Thread David Hildenbrand
On 12.01.21 15:23, Michal Hocko wrote: > On Tue 12-01-21 13:16:45, Michal Hocko wrote: > [...] >> Well, currently pool pages are not migrateable but you are right that >> this is likely something that we will need to look into in the future >> and this optimization would stand in the way. > > Afte

Re: [PATCH v3 2/6] mm: Teach pfn_to_online_page() to consider subsection validity

2021-01-13 Thread David Hildenbrand
g: invalid PFNs from pfn_to_online_page()") > Cc: Qian Cai > Cc: Michal Hocko > Cc: Oscar Salvador > Reported-by: David Hildenbrand > Signed-off-by: Dan Williams > --- > mm/memory_hotplug.c | 24 > 1 file changed, 20 insertions(+), 4 deleti

Re: [PATCH v3 5/6] mm: Fix memory_failure() handling of dax-namespace metadata

2021-01-13 Thread David Hildenbrand
helper for other code paths via pgmap_pfn_valid(). > > Other usage of get_dev_pagemap() are not a concern because those are > operating on known data pfns having been looking up by get_user_pages(). > I.e. metadata pfns are never user mapped. > > Cc: Naoya Horiguchi > Cc: Andr

Re: [PATCH v3 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range

2021-01-13 Thread David Hildenbrand
On 13.01.21 02:21, Minchan Kim wrote: > Contiguous memory allocation can be stalled due to waiting > on page writeback and/or page lock which causes unpredictable > delay. It's a unavoidable cost for the requestor to get *big* > contiguous memory but it's expensive for *small* contiguous > memory(e

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

2021-01-13 Thread David Hildenbrand
On 13.01.21 04:31, Linus Torvalds wrote: > On Tue, Jan 12, 2021 at 6:16 PM Matthew Wilcox wrote: >> >> The thing about the speculative page cache references is that they can >> temporarily bump a refcount on a page which _used_ to be in the page >> cache and has now been reallocated as some other

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

2021-01-13 Thread David Hildenbrand
On 13.01.21 09:52, David Hildenbrand wrote: > On 13.01.21 04:31, Linus Torvalds wrote: >> On Tue, Jan 12, 2021 at 6:16 PM Matthew Wilcox wrote: >>> >>> The thing about the speculative page cache references is that they can >>> temporarily bump a refcount on a

Re: [PATCH v4 1/6] mm: migrate: do not migrate HugeTLB page whose refcount is one

2021-01-13 Thread David Hildenbrand
epage(hpage); > + return MIGRATEPAGE_SUCCESS; > + } > + > new_hpage = get_new_page(hpage, private); > if (!new_hpage) > return -ENOMEM; > Happy to say that I now know understand what's going on here Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v3 1/2] x86/setup: don't remove E820_TYPE_RAM for pfn 0

2021-01-13 Thread David Hildenbrand
On 11.01.21 20:40, Mike Rapoport wrote: > From: Mike Rapoport > > The first 4Kb of memory is a BIOS owned area and to avoid its allocation > for the kernel it was not listed in e820 tables as memory. As the result, > pfn 0 was never recognised by the generic memory management and it is not a > pa

Re: [PATCH] hugetlbfs: Use helper macro default_hstate in init_hugetlbfs_fs

2021-01-18 Thread David Hildenbrand
R(mnt)) { > error = PTR_ERR(mnt); > goto out_unreg; > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH] hugetlbfs: remove meaningless variable avoid_reserve

2021-01-18 Thread David Hildenbrand
e = alloc_huge_page(&pseudo_vma, addr, 0); > hugetlb_drop_vma_policy(&pseudo_vma); > if (IS_ERR(page)) { > mutex_unlock(&hugetlb_fault_mutex_table[hash]); > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH V3 1/3] mm/memory_hotplug: Prevalidate the address range being added with platform

2021-01-19 Thread David Hildenbrand
On 18.01.21 14:12, Anshuman Khandual wrote: > This introduces memhp_range_allowed() which can be called in various memory > hotplug paths to prevalidate the address range which is being added, with > the platform. Then memhp_range_allowed() calls memhp_get_pluggable_range() > which provides applica

Re: [PATCH V3 2/3] arm64/mm: Define arch_get_mappable_range()

2021-01-19 Thread David Hildenbrand
a VM_BUG_ON() check that would ensure that memhp_range_allowed() > has already been called. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Ard Biesheuvel > Cc: Mark Rutland > Cc: David Hildenbrand > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-kernel@vg

Re: [PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug

2021-01-19 Thread David Hildenbrand
On 18.01.21 14:21, Anshuman Khandual wrote: > > > On 1/18/21 6:43 PM, Anshuman Khandual wrote: >> From: David Hildenbrand >> >> Right now, we only check against MAX_PHYSMEM_BITS - but turns out there >> are more restrictions of which memory we can actually h

Re: [PATCH V3 3/3] s390/mm: Define arch_get_mappable_range()

2021-01-19 Thread David Hildenbrand
) check that would ensure that memhp_range_allowed() has already > been called on the hotplug path. > > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: David Hildenbrand > Cc: linux-s...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Acked-by: Heiko Carstens

Re: [PATCH V3 0/3] mm/memory_hotplug: Pre-validate the address range with platform

2021-01-19 Thread David Hildenbrand
hotplug call chain, which inevitably fails the hotplug itself. > > This mechanism was suggested by David Hildenbrand during another discussion > with respect to a memory hotplug fix on arm64 platform. > > https://lore.kernel.org/linux-arm-kernel/1600332402-30123-1-git-send-emai

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

2021-01-19 Thread David Hildenbrand
On 17.12.20 14:07, Oscar Salvador wrote: > Physical memory hotadd has to allocate a memmap (struct page array) for > the newly added memory section. Currently, alloc_pages_node() is used > for those allocations. > > This has some disadvantages: > a) an existing memory is consumed for that purpose

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-07 Thread David Hildenbrand
On 06.01.21 07:11, Anshuman Khandual wrote: > Hi Sudershan, > > This patch (and the cover letter) does not copy LAKML even though the > entire change here is arm64 specific. Please do copy all applicable > mailing lists for a given patch. > > On 1/6/21 6:58 AM, Sudarshan Rajagopalan wrote: >> Cur

Re: [PATCH 1/1] arm64: make section size configurable for memory hotplug

2021-01-08 Thread David Hildenbrand
> To summarize, the section size bits for each base page size config > should always > > a. Avoid (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS Pageblocks must also always fall completely into a section. > > b. Provide minimum possible section size for a given base page config to >have i

Re: [PATCH] mm: memblock: remove return value of memblock_free_all()

2021-01-14 Thread David Hildenbrand
+2084,6 @@ unsigned long __init memblock_free_all(void) > > pages = free_low_memory_core_early(); > totalram_pages_add(pages); > - > - return pages; > } > > #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK) > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

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

2021-01-14 Thread David Hildenbrand
On 14.01.21 12:31, Miaohe Lin wrote: > When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding > and releasing hugetlb_lock. So, what's the deal then? Adding more code? If this is a performance improvement, we should spell it out. Otherwise I don't see a real benefit of this p

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