Re: [PATCH v2 5/8] hv_balloon: don't check for memhp_auto_online manually

2020-03-17 Thread David Hildenbrand
> @@ -1707,6 +1701,7 @@ static int balloon_probe(struct hv_device *dev, > #ifdef CONFIG_MEMORY_HOTPLUG > set_online_page_callback(_online_page); > register_memory_notifier(_memory_nb); > + init_completion(_device.ol_waitevent); I'll move this one line up. > #endif > >

Re: [PATCH v2 5/8] hv_balloon: don't check for memhp_auto_online manually

2020-03-17 Thread David Hildenbrand
On 17.03.20 17:29, Vitaly Kuznetsov wrote: > David Hildenbrand writes: > >> We get the MEM_ONLINE notifier call if memory is added right from the >> kernel via add_memory() or later from user space. >> >> Let's get rid of the "ha_waiting" flag - the wait e

Re: [PATCH v2 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-17 Thread David Hildenbrand
On 17.03.20 11:49, David Hildenbrand wrote: > For now, distributions implement advanced udev rules to essentially > - Don't online any hotplugged memory (s390x) > - Online all memory to ZONE_NORMAL (e.g., most virt environments like > hyperv) > - Online all memory to ZONE_

Re: [PATCH v2 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-17 Thread David Hildenbrand
On 17.03.20 12:01, Michal Hocko wrote: > On Tue 17-03-20 11:49:42, David Hildenbrand wrote: >> For now, distributions implement advanced udev rules to essentially >> - Don't online any hotplugged memory (s390x) >> - Online all memory to ZONE_NORMAL (e.g., most virt environm

[PATCH v2 8/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-17 Thread David Hildenbrand
ck via /sys/devices/system/memory/memoryX/state Reviewed-by: Wei Yang Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 11 +---

[PATCH v2 7/8] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-17 Thread David Hildenbrand
... and rename it to memhp_default_online_type. This is a preparation for more detailed default online behavior. Reviewed-by: Wei Yang Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off

[PATCH v2 6/8] mm/memory_hotplug: unexport memhp_auto_online

2020-03-17 Thread David Hildenbrand
All in-tree users except the mm-core are gone. Let's drop the export. Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH v2 5/8] hv_balloon: don't check for memhp_auto_online manually

2020-03-17 Thread David Hildenbrand
;K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Cc: Vitaly Kuznetsov Cc: linux-hyp...@vger.kernel.org Signed-off-by: David

[PATCH v2 4/8] powernv/memtrace: always online added memory blocks

2020-03-17 Thread David Hildenbrand
" Cc: Baoquan He Cc: Wei Yang Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/powernv/memtrace.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platfor

[PATCH v2 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-17 Thread David Hildenbrand
c: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index e7e77cafef80..8a7f29c0bf97 100644 --- a/drivers/

[PATCH v2 2/8] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-17 Thread David Hildenbrand
ot;-1", which didn't use the enum value. This is a preparation to use the online_type as an array index. Reviewed-by: Wei Yang Acked-by: Michal Hocko Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang

[PATCH v2 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-17 Thread David Hildenbrand
: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 9 + include/linux/memory_hotplug.h | 6 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/base/memory.c

[PATCH v2 0/8] mm/memory_hotplug: allow to specify a default online_type

2020-03-17 Thread David Hildenbrand
; ACTION!="add", GOTO="memory_hotplug_end" +# memory hotplug behavior configured +PROGRAM=="grep online /sys/devices/system/memory/auto_online_blocks", GOTO="memory_hotplug_end" + PROGRAM="/bin/uname -p", RESULT=="s390*", GOTO=&q

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-16 Thread David Hildenbrand
On 16.03.20 16:31, Michal Hocko wrote: > On Wed 11-03-20 13:30:26, David Hildenbrand wrote: >> For now, distributions implement advanced udev rules to essentially >> - Don't online any hotplugged memory (s390x) >> - Online all memory to ZONE_NORMAL (e.g., most virt environm

Re: [PATCH v1 4/5] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-16 Thread David Hildenbrand
On 16.03.20 16:24, Michal Hocko wrote: > On Wed 11-03-20 13:30:25, David Hildenbrand wrote: > [...] >> diff --git a/arch/powerpc/platforms/powernv/memtrace.c >> b/arch/powerpc/platforms/powernv/memtrace.c >> index d6d64f8718e6..e15a600cfa4d 100644 >> --- a/

Re: [PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-16 Thread David Hildenbrand
On 16.03.20 16:12, Michal Hocko wrote: > On Wed 11-03-20 13:30:22, David Hildenbrand wrote: >> The name is misleading. Let's just name it like the online_type name we >> expose to user space ("online"). > > I would disagree the name is misleading. It just says tha

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
On 11.03.20 17:55, Vitaly Kuznetsov wrote: > David Hildenbrand writes: > >> For now, distributions implement advanced udev rules to essentially >> - Don't online any hotplugged memory (s390x) >> - Online all memory to ZONE_NORMAL (e.g., most virt environments like >

Re: [PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
On 11.03.20 15:26, Wei Yang wrote: > On Wed, Mar 11, 2020 at 01:30:26PM +0100, David Hildenbrand wrote: >> For now, distributions implement advanced udev rules to essentially >> - Don't online any hotplugged memory (s390x) >> - Online all memory to ZONE_NORMAL (e.g., most v

[PATCH v1 5/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
h-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 11 +-- include/linux/memory_hotplug.h | 2 ++ mm/memory_hotplug.c| 8 ++

[PATCH v1 4/5] mm/memory_hotplug: convert memhp_auto_online to store an online_type

2020-03-11 Thread David Hildenbrand
Mackerras Cc: Michael Ellerman Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-hyp...@vger.kernel.org Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/powernv/memtrace.c | 2 +- d

[PATCH v1 0/5] mm/memory_hotplug: allow to specify a default online_type

2020-03-11 Thread David Hildenbrand
havior configured +PROGRAM=="grep online /sys/devices/system/memory/auto_online_blocks", GOTO="memory_hotplug_end" + PROGRAM="/bin/uname -p", RESULT=="s390*", GOTO="memory_hotplug_end" ENV{.state}="online" === [1] https://github.co

[PATCH v1 2/5] drivers/base/memory: map MMOP_OFFLINE to 0

2020-03-11 Thread David Hildenbrand
as an array index. Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 11 --- include/linux/memory_hotplug.h | 2 +- 2 fil

[PATCH v1 3/5] drivers/base/memory: store mapping between MMOP_* and string in an array

2020-03-11 Thread David Hildenbrand
Let's use a simple array which we can reuse soon. While at it, move the string->mmop conversion out of the device hotplug lock. Cc: Greg Kroah-Hartman Cc: Andrew Morton Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Baoquan He Cc: Wei Yang Signed-off-by: Davi

[PATCH v1 1/5] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE

2020-03-11 Thread David Hildenbrand
Wei Yang Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 9 + include/linux/memory_hotplug.h | 6 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 6448c9ece2cb..8c5ce42c0fc3 100644 --- a/drivers

Re: [PATCH v3 6/7] mm/memory_hotplug: Add pgprot_t to mhp_params

2020-02-24 Thread David Hildenbrand
tures don't support ZONE_DEVICE. > > A check in __add_pages() is also added to ensure the pgprot parameter was > set for all arches. > > Cc: Dan Williams > Signed-off-by: Logan Gunthorpe > Acked-by: David Hildenbrand > Acked-by: Michal Hocko [...] > diff --git

Re: [PATCH v3 2/7] mm/memory_hotplug: Rename mhp_restrictions to mhp_params

2020-02-24 Thread David Hildenbrand
On 21.02.20 19:24, Logan Gunthorpe wrote: > The mhp_restrictions struct really doesn't specify anything resembling > a restriction anymore so rename it to be mhp_params as it is a list > of extended parameters. > > Signed-off-by: Logan Gunthorpe Reviewed-by: David Hildenbran

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-05 Thread David Hildenbrand
On 05.02.20 15:54, David Laight wrote: > From: Wei Yang >> Sent: 05 February 2020 09:59 > ... >> If it is me, I would like to take out these two similar logic out. >> >> For example: >> >> if () { >> } else if () { >> } else { >> goto out; >> } > > I'm pretty sure

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-05 Thread David Hildenbrand
Anyhow, that patch is already upstream and I don't consider this high priority. Thanks :) >>> >>> Yeah, noticed you told Wei the status in another patch thread, I am fine >>> with it, just leave it to you to decide. Thanks. >> >> I am fairly busy right now. Can you send a patch

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-05 Thread David Hildenbrand
On 05.02.20 14:34, Baoquan He wrote: > On 02/05/20 at 02:20pm, David Hildenbrand wrote: >> On 05.02.20 13:43, Baoquan He wrote: >>> On 02/04/20 at 03:42pm, David Hildenbrand wrote: >>>> On 04.02.20 15:25, Baoquan He wrote: >>>>> On 10/06/19 at 10:56a

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-05 Thread David Hildenbrand
On 05.02.20 14:18, David Hildenbrand wrote: >> I'm sorry to have to correct you again for some corner cases: >> >> ALIGN_UP(1, 4096) - 4096 = 0 >> >> Again, not as easy as it seems ... >> > > Eh, wait, I'm messing up things. Will double check :) > Y

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-05 Thread David Hildenbrand
On 05.02.20 13:43, Baoquan He wrote: > On 02/04/20 at 03:42pm, David Hildenbrand wrote: >> On 04.02.20 15:25, Baoquan He wrote: >>> On 10/06/19 at 10:56am, David Hildenbrand wrote: >>>> If we have holes, the holes will automatically get detected and removed >&

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-05 Thread David Hildenbrand
> I'm sorry to have to correct you again for some corner cases: > > ALIGN_UP(1, 4096) - 4096 = 0 > > Again, not as easy as it seems ... > Eh, wait, I'm messing up things. Will double check :) -- Thanks, David / dhildenb

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-05 Thread David Hildenbrand
On 05.02.20 13:51, Segher Boessenkool wrote: > On Tue, Feb 04, 2020 at 02:38:51PM +0100, David Hildenbrand wrote: >> On 04.02.20 14:13, Segher Boessenkool wrote: >>> On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote: >>>> It's a pattern commonly u

Re: [PATCH v6 07/10] mm/memory_hotplug: We always have a zone in find_(smallest|biggest)_section_pfn

2020-02-05 Thread David Hildenbrand
On 05.02.20 09:57, Wei Yang wrote: > On Sun, Oct 06, 2019 at 10:56:43AM +0200, David Hildenbrand wrote: >> With shrink_pgdat_span() out of the way, we now always have a valid >> zone. >> >> Cc: Andrew Morton >> Cc: Oscar Salvador >> Cc: David Hildenb

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 15:25, Baoquan He wrote: > On 10/06/19 at 10:56am, David Hildenbrand wrote: >> If we have holes, the holes will automatically get detected and removed >> once we remove the next bigger/smaller section. The extra checks can >> go. >> >> Cc: Andrew Mor

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread David Hildenbrand
On 04.02.20 14:13, Segher Boessenkool wrote: > On Tue, Feb 04, 2020 at 01:41:06PM +0100, David Hildenbrand wrote: >> On 04.02.20 10:46, Oscar Salvador wrote: >>> I have to confess that it took me while to wrap around my head >>> with the new min() change, but loo

Re: [PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:46, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote: >> Let's drop the basically unused section stuff and simplify. >> >> Also, let's use a shorter variant to calculate the number of pages to >> the next section

Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:26, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote: >> Get rid of the unnecessary local variables. >> >> Cc: Andrew Morton >> Cc: Oscar Salvador >> Cc: David Hildenbrand >> Cc: Michal Hocko >

Re: [PATCH v6 08/10] mm/memory_hotplug: Don't check for "all holes" in shrink_zone_span()

2020-02-04 Thread David Hildenbrand
On 04.02.20 10:13, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:44AM +0200, David Hildenbrand wrote: >> If we have holes, the holes will automatically get detected and removed >> once we remove the next bigger/smaller section. The extra checks can >> go. >>

Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2020-02-04 Thread David Hildenbrand
>> I can understand this is desirable (yet, I am >> not sure if this makes sense with the current take-and-not-give-back >> review mentality on this list). >> >> Although it will make upstreaming stuff *even harder* and *even slower*, >> maybe we should start to only queue patches that have an

Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2020-01-31 Thread David Hildenbrand
>>> The first patch has reviews, the remainder are unloved. >> >> Trying hard not to rant about the review mentality on this list, but I'm >> afraid I can't totally bite my tongue ... :) > > I am afraid this is less about mentality than the lack of man power. > This is not a new problem. We have

Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2020-01-31 Thread David Hildenbrand
On 31.01.20 05:40, Andrew Morton wrote: > On Tue, 3 Dec 2019 14:36:38 +0100 Oscar Salvador wrote: > >> On Mon, Dec 02, 2019 at 10:09:51AM +0100, David Hildenbrand wrote: >>> @Michal, @Oscar, can some of you at least have a patch #5 now so we can >>> proceed with tha

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 19:38, Michal Hocko wrote: > On Wed 22-01-20 19:15:47, David Hildenbrand wrote: >> On 22.01.20 17:46, Michal Hocko wrote: >>> On Wed 22-01-20 12:58:16, David Hildenbrand wrote: > [...] >>>> Especially interesting for IBM z Systems, whereby memory >

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 17:46, Michal Hocko wrote: > On Wed 22-01-20 12:58:16, David Hildenbrand wrote: >> On 22.01.20 11:54, David Hildenbrand wrote: >>> On 22.01.20 11:42, Michal Hocko wrote: >>>> On Wed 22-01-20 11:39:08, David Hildenbrand wrote: >>>>>>&g

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 11:54, David Hildenbrand wrote: > On 22.01.20 11:42, Michal Hocko wrote: >> On Wed 22-01-20 11:39:08, David Hildenbrand wrote: >>>>>> Really, the interface is flawed and should have never been merged in the >>>>>> first place. We cannot sim

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
On 22.01.20 11:42, Michal Hocko wrote: > On Wed 22-01-20 11:39:08, David Hildenbrand wrote: >>>>> Really, the interface is flawed and should have never been merged in the >>>>> first place. We cannot simply remove it altogether I am afraid so let's >>>>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-22 Thread David Hildenbrand
>>> Really, the interface is flawed and should have never been merged in the >>> first place. We cannot simply remove it altogether I am afraid so let's >>> at least remove the bogus code and pretend that the world is a better >>> place where everything is removable except the reality sucks... >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 10:14, David Hildenbrand wrote: > On 20.01.20 08:48, Michal Hocko wrote: >> On Fri 17-01-20 08:57:51, Dan Williams wrote: >> [...] >>> Unless the user is willing to hold the device_hotplug_lock over the >>> evaluation then the result is unr

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 08:48, Michal Hocko wrote: > On Fri 17-01-20 08:57:51, Dan Williams wrote: > [...] >> Unless the user is willing to hold the device_hotplug_lock over the >> evaluation then the result is unreliable. > > Do we want to hold the device_hotplug_lock from this user readable file > in the

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 16:54, Dan Williams wrote: > On Fri, Jan 17, 2020 at 7:30 AM Michal Hocko wrote: >> >> On Fri 17-01-20 15:58:26, David Hildenbrand wrote: >>> On 17.01.20 15:52, Michal Hocko wrote: >>>> On Fri 17-01-20 14:08:06, David Hildenbrand wrote: >>

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 15:52, Michal Hocko wrote: > On Fri 17-01-20 14:08:06, David Hildenbrand wrote: >> On 17.01.20 12:33, Michal Hocko wrote: >>> On Fri 17-01-20 11:57:59, David Hildenbrand wrote: >>>> Let's refactor that code. We want to check if we can offline memory &

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
On 17.01.20 12:33, Michal Hocko wrote: > On Fri 17-01-20 11:57:59, David Hildenbrand wrote: >> Let's refactor that code. We want to check if we can offline memory >> blocks. Add a new function is_mem_section_offlineable() for that and >> make it call is_mem_section_offlineable

[PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-17 Thread David Hildenbrand
Stephen Rothwell Cc: Anshuman Khandual Cc: lantianyu1...@gmail.com Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: David Hildenbrand --- .../platforms/pseries/hotplug-memory.c| 24 ++- drivers/base/memory.c | 37 ++ include/linux/memory.h

Re: [PATCH v2 2/8] mm/memory_hotplug: Rename mhp_restrictions to mhp_modifiers

2020-01-08 Thread David Hildenbrand
> Am 08.01.2020 um 20:00 schrieb Dan Williams : > > On Wed, Jan 8, 2020 at 9:17 AM Logan Gunthorpe wrote: >> >> >> >>> On 2020-01-08 5:28 a.m., David Hildenbrand wrote: >>> On 07.01.20 21:59, Logan Gunthorpe wrote: >>>> Th

Re: [PATCH v2 6/8] s390/mm: Thread pgprot_t through vmem_add_mapping()

2020-01-08 Thread David Hildenbrand
On 07.01.20 21:59, Logan Gunthorpe wrote: > In prepartion to support a pgprot_t argument for arch_add_memory(). > > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Signed-off-by: Logan Gunthorpe > --- > arch/s390/include/asm/pgtable.h | 3 ++- > arch/s390/mm/extmem.c

Re: [PATCH v2 7/8] mm/memory_hotplug: Add pgprot_t to mhp_modifiers

2020-01-08 Thread David Hildenbrand
plicitly "page table protection" ? > using _set_memory_prot() (seeing they are already mapped). For sh, reject > anything but PAGE_KERNEL settings -- this should be fine, for now, seeing > sh doesn't support ZONE_DEVICE anyway. > > Cc: Dan Williams > Cc: David Hilden

Re: [PATCH v2 2/8] mm/memory_hotplug: Rename mhp_restrictions to mhp_modifiers

2020-01-08 Thread David Hildenbrand
On 07.01.20 21:59, Logan Gunthorpe wrote: > The mhp_restrictions struct really doesn't specify anything resembling > a restriction anymore so rename it to be mhp_modifiers. I wonder if something like "mhp_params" would be even better. It's essentially just a way to avoid changing call chains

Re: [PATCH v2 1/8] mm/memory_hotplug: Drop the flags field from struct mhp_restrictions

2020-01-08 Thread David Hildenbrand
some time and we might actually realize it using the altmap instead (hopefully :) ). Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb

Re: [PATCH v6 05/10] mm/memory_hotplug: Shrink zones when offlining memory

2019-12-18 Thread David Hildenbrand
On 01.12.19 00:21, Andrew Morton wrote: > On Sun, 27 Oct 2019 23:45:52 +0100 David Hildenbrand wrote: > >> I think I just found an issue with try_offline_node(). >> try_offline_node() is pretty much broken already (touches garbage >> memmaps and will not considers mi

Re: [PATCH RFC v1 0/3] powerpc/memtrace: Don't offline memory blocks via offline_pages()

2019-12-17 Thread David Hildenbrand
On 17.12.19 13:38, David Hildenbrand wrote: > This RFC is based on linux-next and > - 2 patches from "PATCH RFC v4 00/13] virtio-mem: paravirtualized memory" > -> "mm: Allow to offline unmovable PageOffline() pages via > MEM_GOING_OFFLINE" [1]

[PATCH RFC v1 3/3] powerpc/memtrace: Don't offline memory blocks via offline_pages()

2019-12-17 Thread David Hildenbrand
I cannot test that. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: David Hildenbrand Cc: Allison Randal Cc: Jens Axboe Cc: Anshuman Khandual Cc: Thomas Gleixner Cc: Michal Hocko Cc: Oscar Salvador Cc: Balbir Singh Cc: Rashmica Gupta Cc:

[PATCH RFC v1 2/3] powerpc/memtrace: Factor out readding memory into memtrace_free_node()

2019-12-17 Thread David Hildenbrand
While at it, move it, we want to reuse it soon. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: David Hildenbrand Cc: Allison Randal Cc: Jens Axboe Cc: Anshuman Khandual Cc: Thomas Gleixner Cc: Balbir Singh Cc: Rashmica Gupta Cc: linuxppc-dev

[PATCH RFC v1 1/3] powerpc/memtrace: Enforce power of 2 for memory buffer size

2019-12-17 Thread David Hildenbrand
owers of 2 that are at least the size of memory blocks - the granularity we are using for alloc/offline/unplug. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: David Hildenbrand Cc: Allison Randal Cc: Anshuman Khandual Cc: Balbir Singh Cc: Rashmica

[PATCH v2] powerpc/pseries/cmm: fix managed page counts when migrating pages between zones

2019-12-16 Thread David Hildenbrand
nuxppc-dev@lists.ozlabs.org Signed-off-by: David Hildenbrand --- v1 -> v2: - Link virtio-balloon fix commit - Check if the zone changed - Move fixup further up, before enqueuing the new newpage (where we are guaranteed to hold a reference to both pages) --- arch/powerpc/platforms/pseri

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread David Hildenbrand
On 10.12.19 11:34, Michal Hocko wrote: > On Tue 10-12-19 11:09:46, David Hildenbrand wrote: >> On 10.12.19 11:04, Michal Hocko wrote: >>> On Mon 09-12-19 12:43:40, Dan Williams wrote: >>>> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe >>>> wrote: >&

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-10 Thread David Hildenbrand
On 10.12.19 11:04, Michal Hocko wrote: > On Mon 09-12-19 12:43:40, Dan Williams wrote: >> On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >>> >>> >>> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>>> On 09.

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread David Hildenbrand
> Am 09.12.2019 um 21:43 schrieb Dan Williams : > > On Mon, Dec 9, 2019 at 12:24 PM Logan Gunthorpe wrote: >> >> >> >>> On 2019-12-09 12:23 p.m., David Hildenbrand wrote: >>> On 09.12.19 20:13, Logan Gunthorpe wrote: >>>> devm_

Re: [PATCH 5/6] mm, memory_hotplug: Provide argument for the pgprot_t in arch_add_memory()

2019-12-09 Thread David Hildenbrand
sn't support ZONE_DEVICE anyway. > > Cc: Dan Williams > Cc: David Hildenbrand > Cc: Michal Hocko > Signed-off-by: Logan Gunthorpe > --- > arch/arm64/mm/mmu.c| 4 ++-- > arch/ia64/mm/init.c| 5 - > arch/powerpc/mm/mem.c | 4 ++-- > a

Re: [PATCH] powerpc/pseries/cmm: fix wrong managed page count when migrating between zones

2019-12-04 Thread David Hildenbrand
> Am 05.12.2019 um 03:59 schrieb Michael Ellerman : > > David Hildenbrand writes: >> Forgot to rename the subject to >> >> "powerpc/pseries/cmm: fix managed page counts when migrating pages >> between zones" >> >> If I don't have t

Re: [PATCH] powerpc/pseries/cmm: fix wrong managed page count when migrating between zones

2019-12-04 Thread David Hildenbrand
Forgot to rename the subject to "powerpc/pseries/cmm: fix managed page counts when migrating pages between zones" If I don't have to resend, would be great if that could be adjusted when applying. -- Thanks, David / dhildenb

[PATCH] powerpc/pseries/cmm: fix wrong managed page count when migrating between zones

2019-12-04 Thread David Hildenbrand
("powerpc/pseries/cmm: Implement balloon compaction") Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andrew Morton Cc: Richard Fontana Cc: Greg Kroah-Hartman Cc: Arun KS Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: David H

Re: [PATCH v6 05/10] mm/memory_hotplug: Shrink zones when offlining memory

2019-12-03 Thread David Hildenbrand
On 03.12.19 16:10, Oscar Salvador wrote: > On Sun, Oct 06, 2019 at 10:56:41AM +0200, David Hildenbrand wrote: >> Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug") >> Signed-off-by: David Hildenbrand > > I did not see anything wrong with the taken

Re: [PATCH v2 0/2] mm: remove the memory isolate notifier

2019-12-02 Thread David Hildenbrand
On 14.11.19 14:19, David Hildenbrand wrote: > This is the MM part of > https://lkml.org/lkml/2019/10/31/487 > > "We can get rid of the memory isolate notifier by switching to balloon > compaction in powerpc's CMM (Collaborative Memory Management). The memory > is

Re: [PATCH v6 00/10] mm/memory_hotplug: Shrink zones before removing memory

2019-12-02 Thread David Hildenbrand
On 06.10.19 10:56, David Hildenbrand wrote: > This series fixes the access of uninitialized memmaps when shrinking > zones/nodes and when removing memory. Also, it contains all fixes for > crashes that can be triggered when removing certain namespace using > memunmap_pages() -

Re: [PATCH v6 05/10] mm/memory_hotplug: Shrink zones when offlining memory

2019-11-30 Thread David Hildenbrand
> Am 01.12.2019 um 00:22 schrieb Andrew Morton : > > On Sun, 27 Oct 2019 23:45:52 +0100 David Hildenbrand > wrote: > >> I think I just found an issue with try_offline_node(). >> try_offline_node() is pretty much broken already (touches garbage >> memmaps

Re: [PATCH v1 01/12] powerpc/pseries: CMM: Implement release() function for sysfs device

2019-11-20 Thread David Hildenbrand
On 14.11.19 10:08, Michael Ellerman wrote: On Thu, 2019-10-31 at 14:29:22 UTC, David Hildenbrand wrote: When unloading the module, one gets [ 548.188594] [ cut here ] [ 548.188596] Device 'cmm0' does not have a release() function, it is brok= en and must be fixed. See

Re: [PATCH v6 04/10] mm/memory_hotplug: Don't access uninitialized memmaps in shrink_zone_span()

2019-11-19 Thread David Hildenbrand
On 14.10.19 21:17, Andrew Morton wrote: > On Mon, 14 Oct 2019 11:32:13 +0200 David Hildenbrand wrote: > >>> Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug") >> >> @Andrew, can you convert that to >> >> Fixes: f1dd2cd13c4

Re: [PATCH v2 0/2] mm: remove the memory isolate notifier

2019-11-15 Thread David Hildenbrand
On 14.11.19 14:19, David Hildenbrand wrote: > This is the MM part of > https://lkml.org/lkml/2019/10/31/487 > > "We can get rid of the memory isolate notifier by switching to balloon > compaction in powerpc's CMM (Collaborative Memory Management). The memory > is

[PATCH v2 2/2] mm: remove "count" parameter from has_unmovable_pages()

2019-11-14 Thread David Hildenbrand
: Vlastimil Babka Cc: Mel Gorman Cc: Mike Rapoport Cc: Wei Yang Cc: Alexander Duyck Cc: Alexander Potapenko Cc: Arun KS Cc: Michael Ellerman Signed-off-by: David Hildenbrand --- include/linux/page-isolation.h | 4 ++-- mm/memory_hotplug.c| 2 +- mm/page_alloc.c| 21

[PATCH v2 1/2] mm: remove the memory isolate notifier

2019-11-14 Thread David Hildenbrand
c: Pingfan Liu Cc: Michael Ellerman Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 19 --- include/linux/memory.h | 27 --- mm/page_isolation.c| 38 -- 3 files changed, 4 insertions(+), 80 deletion

[PATCH v2 0/2] mm: remove the memory isolate notifier

2019-11-14 Thread David Hildenbrand
ael's tree, to avoid collissions. Thoughts? v1 -> v2: (MM bits) - "mm: remove the memory isolate notifier" -- Remove another stale comment -- Minor code cleanup David Hildenbrand (2): mm: remove the memory isolate notifier mm: remove "count" parameter from ha

Re: [PATCH v1 01/12] powerpc/pseries: CMM: Implement release() function for sysfs device

2019-11-14 Thread David Hildenbrand
On 14.11.19 10:08, Michael Ellerman wrote: On Thu, 2019-10-31 at 14:29:22 UTC, David Hildenbrand wrote: When unloading the module, one gets [ 548.188594] [ cut here ] [ 548.188596] Device 'cmm0' does not have a release() function, it is brok= en and must be fixed. See

Re: [PATCH v1 08/12] powerpc/pseries: CMM: Implement balloon compaction

2019-11-12 Thread David Hildenbrand
On 12.11.19 11:46, Michael Ellerman wrote: David Hildenbrand writes: On 31.10.19 15:29, David Hildenbrand wrote: We can now get rid of the cmm_lock and completely rely on the balloon compaction internals, which now also manage the page list and the lock. ... + +static int cmm_migratepage

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-08 Thread David Hildenbrand
On 08.11.19 19:29, Dan Williams wrote: On Fri, Nov 8, 2019 at 2:22 AM David Hildenbrand wrote: On 08.11.19 08:14, David Hildenbrand wrote: On 08.11.19 06:09, Dan Williams wrote: On Thu, Nov 7, 2019 at 2:07 PM David Hildenbrand wrote: On 07.11.19 19:22, David Hildenbrand wrote: Am

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-08 Thread David Hildenbrand
On 08.11.19 08:14, David Hildenbrand wrote: On 08.11.19 06:09, Dan Williams wrote: On Thu, Nov 7, 2019 at 2:07 PM David Hildenbrand wrote: On 07.11.19 19:22, David Hildenbrand wrote: Am 07.11.2019 um 16:40 schrieb Dan Williams : On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand wrote

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-07 Thread David Hildenbrand
On 08.11.19 06:09, Dan Williams wrote: On Thu, Nov 7, 2019 at 2:07 PM David Hildenbrand wrote: On 07.11.19 19:22, David Hildenbrand wrote: Am 07.11.2019 um 16:40 schrieb Dan Williams : On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-07 Thread David Hildenbrand
On 07.11.19 19:22, David Hildenbrand wrote: Am 07.11.2019 um 16:40 schrieb Dan Williams : On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from

Re: [PATCH v1 04/10] vfio/type1: Prepare is_invalid_reserved_pfn() for PG_reserved changes

2019-11-07 Thread David Hildenbrand
> Am 07.11.2019 um 16:40 schrieb Dan Williams : > > On Thu, Oct 24, 2019 at 5:12 AM David Hildenbrand wrote: >> >> Right now, ZONE_DEVICE memory is always set PG_reserved. We want to >> change that. >> >> KVM has this weird use case that you can map a

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
, 2019 at 03:02:40PM -0800, Dan Williams wrote: On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand wrote: The scarier code (for me) is transparent_hugepage_adjust() and kvm_mmu_zap_collapsible_spte(), as I don't at all understand the interaction between THP and _PAGE_DEVMAP. The x86 KVM MMU code

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
I think I know what's going wrong: Pages that are pinned via gfn_to_pfn() and friends take a references, however are often released via kvm_release_pfn_clean()/kvm_release_pfn_dirty()/kvm_release_page_clean()... E.g., in arch/x86/kvm/x86.c:reexecute_instruction() ... pfn =

Re: [PATCH v1 02/10] KVM: x86/mmu: Prepare kvm_is_mmio_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
On 05.11.19 02:37, Dan Williams wrote: On Thu, Oct 24, 2019 at 5:10 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable

Re: [PATCH v1 09/10] mm/memory_hotplug: Don't mark pages PG_reserved when initializing the memmap

2019-11-05 Thread David Hildenbrand
On 04.11.19 23:44, Boris Ostrovsky wrote: On 10/24/19 8:09 AM, David Hildenbrand wrote: diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 4f2e78a5e4db..af69f057913a 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -374,6 +374,13 @@ static void xen_online_page

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
On 05.11.19 10:49, David Hildenbrand wrote: On 05.11.19 10:17, David Hildenbrand wrote: On 05.11.19 05:38, Dan Williams wrote: On Thu, Oct 24, 2019 at 5:11 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
On 05.11.19 10:17, David Hildenbrand wrote: On 05.11.19 05:38, Dan Williams wrote: On Thu, Oct 24, 2019 at 5:11 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem

Re: [PATCH v1 01/10] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes

2019-11-05 Thread David Hildenbrand
On 05.11.19 02:30, Dan Williams wrote: On Thu, Oct 24, 2019 at 5:10 AM David Hildenbrand wrote: Our onlining/offlining code is unnecessarily complicated. Only memory blocks added during boot can have holes (a range that is not IORESOURCE_SYSTEM_RAM). Hotplugged memory never has holes (e.g

Re: [PATCH v1 03/10] KVM: Prepare kvm_is_reserved_pfn() for PG_reserved changes

2019-11-05 Thread David Hildenbrand
On 05.11.19 05:38, Dan Williams wrote: On Thu, Oct 24, 2019 at 5:11 AM David Hildenbrand wrote: Right now, ZONE_DEVICE memory is always set PG_reserved. We want to change that. KVM has this weird use case that you can map anything from /dev/mem into the guest. pfn_valid() is not a reliable

Re: [PATCH v1 00/10] mm: Don't mark hotplugged pages PG_reserved (including ZONE_DEVICE)

2019-11-01 Thread David Hildenbrand
On 24.10.19 14:09, David Hildenbrand wrote: This is the result of a recent discussion with Michal ([1], [2]). Right now we set all pages PG_reserved when initializing hotplugged memmaps. This includes ZONE_DEVICE memory. In case of system memory, PG_reserved is cleared again when onlining

Re: [PATCH v1 08/12] powerpc/pseries: CMM: Implement balloon compaction

2019-10-31 Thread David Hildenbrand
On 31.10.19 15:29, David Hildenbrand wrote: We can now get rid of the cmm_lock and completely rely on the balloon compaction internals, which now also manage the page list and the lock. Inflated/"loaned" pages are now movable. Memory blocks that contain such apges can get offlined.

[PATCH v1 10/12] powerpc/pseries: CMM: Simulation mode

2019-10-31 Thread David Hildenbrand
oah-Hartman Cc: Thomas Gleixner Cc: Arun KS Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/pseries/cmm.c | 38 ++-- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c index a6e

[PATCH v1 12/12] mm: remove "count" parameter from has_unmovable_pages()

2019-10-31 Thread David Hildenbrand
: Vlastimil Babka Cc: Mel Gorman Cc: Mike Rapoport Cc: Wei Yang Cc: Alexander Duyck Cc: Alexander Potapenko Cc: Arun KS Signed-off-by: David Hildenbrand --- include/linux/page-isolation.h | 4 ++-- mm/memory_hotplug.c| 2 +- mm/page_alloc.c| 21

<    2   3   4   5   6   7   8   9   10   11   >