Re: [RFC PATCH 08/29] memblock: replace alloc_bootmem_align with memblock_alloc

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:23, Mike Rapoport wrote: > The functions are equivalent, just the later does not require nobootmem > translation layer. > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > arch/x86/xen/p2m.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [RFC PATCH 09/29] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:24, Mike Rapoport wrote: > The functions are equivalent, just the later does not require nobootmem > translation layer. > > Signed-off-by: Mike Rapoport modulo @memblock_alloc_low@@memblock_virt_alloc_low@ Acked-by: Michal Hocko > --- > arch/x86/k

Re: [RFC PATCH 10/29] memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic

2018-09-06 Thread Michal Hocko
ode if the given one doesn't have a proper range. So good. Lack of proper documentation didn't really help. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > arch/x86/kernel/setup_percpu.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) >

Re: [RFC PATCH 11/29] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic

2018-09-06 Thread Michal Hocko
deep down the callpath to see they are doing the same thing essentially. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > drivers/usb/early/xhci-dbc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/early/xhci-dbc.c b/d

Re: [RFC PATCH 12/29] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:27, Mike Rapoport wrote: > The alloc_bootmem_low(size) allocates low memory with default alignement > and can be replcaed by memblock_alloc_low(size, 0) > > Signed-off-by: Mike Rapoport Again _virt renaming thing... Acked-by: Michal Hocko > --- >

Re: [RFC PATCH 13/29] memblock: replace __alloc_bootmem_nopanic with memblock_alloc_from_nopanic

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:28, Mike Rapoport wrote: > Signed-off-by: Mike Rapoport The translation is simpler here but still a word or two would be nice. Empty changelogs suck. To the change Acked-by: Michal Hocko > --- > arch/arc/kernel/unwind.c | 4 ++-- > arch/x86/kernel/se

Re: [RFC PATCH 14/29] memblock: add align parameter to memblock_alloc_node()

2018-09-06 Thread Michal Hocko
vailable()) > section = kzalloc_node(array_size, GFP_KERNEL, nid); > else > - section = memblock_alloc_node(array_size, nid); > + section = memblock_alloc_node(array_size, 0, nid); > > return section; > } > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [RFC PATCH 15/29] memblock: replace alloc_bootmem_pages_node with memblock_alloc_node

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:30, Mike Rapoport wrote: > Signed-off-by: Mike Rapoport again a short work of wisdom please. The change itself looks good. Acked-by: Michal Hocko > --- > arch/ia64/mm/init.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --

Re: [RFC PATCH 04/29] mm: remove bootmem allocator implementation.

2018-09-06 Thread Michal Hocko
On Thu 06-09-18 09:30:23, Michal Hocko wrote: > Is there any reason to keep > > ifdef CONFIG_NO_BOOTMEM > obj-y += nobootmem.o > else > obj-y += bootmem.o > endif > > behind? I can see you have done so in an earlier patch. I have mi

Re: [RFC PATCH 16/29] memblock: replace __alloc_bootmem_node with appropriate memblock_ API

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:31, Mike Rapoport wrote: > Use memblock_alloc_try_nid whenever goal (i.e. mininal address is > specified) and memblock_alloc_node otherwise. I suspect you wanted to say (i.e. minimal address) is specified > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko

Re: [RFC PATCH 17/29] memblock: replace alloc_bootmem_node with memblock_alloc_node

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:32, Mike Rapoport wrote: > Signed-off-by: Mike Rapoport ENOCHAGELOG again The conversion itself looks good to me Acked-by: Michal Hocko > --- > arch/alpha/kernel/pci_iommu.c | 4 ++-- > arch/ia64/sn/kernel/io_common.c | 7 ++- > arch/ia64/sn/kernel/

Re: [RFC PATCH 18/29] memblock: replace alloc_bootmem_low_pages with memblock_alloc_low

2018-09-06 Thread Michal Hocko
do the right thing and from a quick glance it looks sane (modulo _virt naming) Acked-by: Michal Hocko > --- > arch/arc/mm/highmem.c| 2 +- > arch/m68k/atari/stram.c | 3 ++- > arch/m68k/mm/motorola.c | 5 +++-- > arch/mips/cavium-o

Re: [RFC PATCH 19/29] memblock: replace alloc_bootmem_pages with memblock_alloc

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:34, Mike Rapoport wrote: > The conversion is done using the following semantic patch: > > @@ > expression e; > @@ > - alloc_bootmem_pages(e) > + memblock_alloc(e, PAGE_SIZE) > > Signed-off-by: Mike Rapoport Same as the previous pa

Re: [RFC PATCH 20/29] memblock: replace __alloc_bootmem with memblock_alloc_from

2018-09-06 Thread Michal Hocko
MP_CACHE_BYTES, 0UL); > + ctx_list_pool = memblock_alloc_from(size, SMP_CACHE_BYTES, 0UL); > > for (ctx = 0; ctx < numctx; ctx++) { > struct ctx_list *clist; > diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h > index 3896af2..c97c105 100644 > --- a/include/linux/bootmem.h > +++ b/include/linux/bootmem.h > @@ -122,6 +122,14 @@ static inline void * __init memblock_alloc_raw( > NUMA_NO_NODE); > } > > +static inline void * __init memblock_alloc_from( > + phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) > +{ > + return memblock_alloc_try_nid(size, align, min_addr, > + BOOTMEM_ALLOC_ACCESSIBLE, > + NUMA_NO_NODE); > +} > + > static inline void * __init memblock_alloc_nopanic( > phys_addr_t size, phys_addr_t align) > { > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [RFC PATCH 21/29] memblock: replace alloc_bootmem with memblock_alloc

2018-09-06 Thread Michal Hocko
0); > int i; > > cmdline[0] = 0; > diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c > index e8ae2e5..332fcca 100644 > --- a/drivers/macintosh/smu.c > +++ b/drivers/macintosh/smu.c > @@ -493,7 +493,7 @@ int __init smu_init (void) > goto fail_np; > } > > - smu = alloc_bootmem(sizeof(struct smu_device)); > + smu = memblock_alloc(sizeof(struct smu_device), 0); > > spin_lock_init(&smu->lock); > INIT_LIST_HEAD(&smu->cmd_list); > diff --git a/init/main.c b/init/main.c > index d0b92bd..99a9e99 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -768,8 +768,8 @@ static int __init initcall_blacklist(char *str) > str_entry = strsep(&str, ","); > if (str_entry) { > pr_debug("blacklisting initcall %s\n", str_entry); > - entry = alloc_bootmem(sizeof(*entry)); > - entry->buf = alloc_bootmem(strlen(str_entry) + 1); > + entry = memblock_alloc(sizeof(*entry), 0); > + entry->buf = memblock_alloc(strlen(str_entry) + 1, 0); > strcpy(entry->buf, str_entry); > list_add(&entry->next, &blacklisted_initcalls); > } > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [RFC PATCH 22/29] mm: nobootmem: remove bootmem allocation APIs

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:37, Mike Rapoport wrote: > The bootmem compatibility APIs are not used and can be removed. > > Signed-off-by: Mike Rapoport I am happy to see this finally go Acked-by: Michal Hocko > --- > include/linux/bootmem.h | 47 -- > mm/nobootme

Re: [RFC PATCH 23/29] memblock: replace free_bootmem{_node} with memblock_free

2018-09-06 Thread Michal Hocko
> - free_bootmem(e1, e2) > + memblock_free(e1, e2) > | > - free_bootmem_node(e1, e2, e3) > + memblock_free(e2, e3) > ) > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > arch/alpha/kernel/core_irongate.c | 3 +-- > arch/arm64/mm/init.c | 2 +- >

Re: [RFC PATCH 24/29] memblock: replace free_bootmem_late with memblock_free_late

2018-09-06 Thread Michal Hocko
bootmem variant. > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > arch/sparc/kernel/mdesc.c | 3 ++- > arch/x86/platform/efi/quirks.c | 6 +++--- > drivers/firmware/efi/apple-properties.c | 2 +- > include/linux/bootmem.h

Re: [RFC PATCH 25/29] memblock: rename free_all_bootmem to memblock_free_all

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:40, Mike Rapoport wrote: > The conversion is done using > > sed -i 's@free_all_bootmem@memblock_free_all@' \ > $(git grep -l free_all_bootmem) > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [RFC PATCH 26/29] memblock: rename __free_pages_bootmem to memblock_free_pages

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:41, Mike Rapoport wrote: > The conversion is done using > > sed -i 's@__free_pages_bootmem@memblock_free_pages@' \ > $(git grep -l __free_pages_bootmem) > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > mm/internal

Re: [RFC PATCH 27/29] mm: remove nobootmem

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:42, Mike Rapoport wrote: > Move a few remaining functions from nobootmem.c to memblock.c and remove > nobootmem > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > mm/Makefile| 1 - >

Re: [RFC PATCH 28/29] memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants

2018-09-06 Thread Michal Hocko
On Wed 05-09-18 18:59:43, Mike Rapoport wrote: > Drop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of > identical MEMBLOCK definitions. > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > arch/ia64/mm/discontig.c | 2 +- > arch/powerpc/

Re: [RFC PATCH 00/29] mm: remove bootmem allocator

2018-09-06 Thread Michal Hocko
this. I wish we could simplify the memblock API as well. There are just too many public functions with subtly different semantic and barely any useful documentation. But even this is a great step forward! -- Michal Hocko SUSE Labs

Re: [RFC PATCH V2 1/4] mm: Export alloc_migrate_huge_page

2018-09-06 Thread Michal Hocko
use? -- Michal Hocko SUSE Labs

Re: [RFC PATCH V2 1/4] mm: Export alloc_migrate_huge_page

2018-09-06 Thread Michal Hocko
On Thu 06-09-18 14:31:11, Michal Hocko wrote: > On Thu 06-09-18 11:13:39, Aneesh Kumar K.V wrote: > > We want to use this to support customized huge page migration. > > Please be much more specific. Ideally including the user. Btw. why do > you want to skip the hugetlb poo

Re: [RFC PATCH V2 2/4] mm: Add get_user_pages_cma_migrate

2018-09-06 Thread Michal Hocko
tter describe why you are bypassing hugetlb pools. I assume that the reason is to guarantee a forward progress because those might be sitting in the CMA pools already, right? -- Michal Hocko SUSE Labs

Re: [RFC PATCH V2 4/4] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_get

2018-09-06 Thread Michal Hocko
MA/ZONE_MOVABLE pages. Pinned pages are not reclaimable as well so there is a risk of OOMs if there are too many of them. We have discussed approaches that would allow to force pin invalidation/revocation at LSF/MM. Isn't that a more appropriate solution to the problem you are seeing? -- Michal Hocko SUSE Labs

Re: [RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-06 Thread Michal Hocko
On Thu 06-09-18 15:43:21, Mike Rapoport wrote: > On Thu, Sep 06, 2018 at 09:28:00AM +0200, Michal Hocko wrote: > > On Wed 05-09-18 20:20:18, Mike Rapoport wrote: > > > On Wed, Sep 05, 2018 at 12:04:36PM -0500, Rob Herring wrote: > > > > On Wed, Sep 5, 2018 at 11:00 AM

Re: [RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-06 Thread Michal Hocko
On Thu 06-09-18 16:39:58, Mike Rapoport wrote: > On Thu, Sep 06, 2018 at 03:01:02PM +0200, Michal Hocko wrote: > > On Thu 06-09-18 15:43:21, Mike Rapoport wrote: > > > On Thu, Sep 06, 2018 at 09:28:00AM +0200, Michal Hocko wrote: > > > > On Wed 05-09-18 20:20:18, Mik

Re: [RFC PATCH 07/29] memblock: remove _virt from APIs returning virtual address

2018-09-07 Thread Michal Hocko
On Fri 07-09-18 11:42:12, Mike Rapoport wrote: > On Thu, Sep 06, 2018 at 03:46:27PM +0200, Michal Hocko wrote: > > On Thu 06-09-18 16:39:58, Mike Rapoport wrote: > > > On Thu, Sep 06, 2018 at 03:01:02PM +0200, Michal Hocko wrote: > > > > On Thu 06-09-18 15:43:21, Mik

Re: [RFC PATCH V2 4/4] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_get

2018-09-07 Thread Michal Hocko
On Thu 06-09-18 19:00:43, Aneesh Kumar K.V wrote: > On 09/06/2018 06:23 PM, Michal Hocko wrote: > > On Thu 06-09-18 11:13:42, Aneesh Kumar K.V wrote: > > > Current code doesn't do page migration if the page allocated is a > > > compound page. > > > With

Re: [RFC PATCH V2 4/4] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_get

2018-09-07 Thread Michal Hocko
On Fri 07-09-18 16:45:09, Aneesh Kumar K.V wrote: > On 09/07/2018 02:33 PM, Michal Hocko wrote: > > On Thu 06-09-18 19:00:43, Aneesh Kumar K.V wrote: > > > On 09/06/2018 06:23 PM, Michal Hocko wrote: > > > > On Thu 06-09-18 11:13:42, Aneesh Kumar K.V wrote: > >

Re: [PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM

2018-09-26 Thread Michal Hocko
g that I've seen a patch to address that. It would be great to have it folded to this one. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-26 Thread Michal Hocko
Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [PATCH 05/30] mm: nobootmem: remove dead code

2018-09-26 Thread Michal Hocko
On Fri 14-09-18 15:10:20, Mike Rapoport wrote: > Several bootmem functions and macros are not used. Remove them. > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [PATCH 07/30] memblock: remove _virt from APIs returning virtual address

2018-09-26 Thread Michal Hocko
by this change. It is unnecessary churn. So if nothing else just add a note _why_ you think this is better. -- Michal Hocko SUSE Labs

Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()

2018-09-26 Thread Michal Hocko
if (slab_is_available()) > section = kzalloc_node(array_size, GFP_KERNEL, nid); > else > - section = memblock_alloc_node(array_size, nid); > + section = memblock_alloc_node(array_size, 0, nid); > > return section; > } > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()

2018-09-26 Thread Michal Hocko
On Wed 26-09-18 11:31:27, Michal Hocko wrote: > On Fri 14-09-18 15:10:29, Mike Rapoport wrote: > > With the align parameter memblock_alloc_node() can be used as drop in > > replacement for alloc_bootmem_pages_node() and __alloc_bootmem_node(), > > which is done in the follow

Re: [PATCH 16/30] memblock: replace __alloc_bootmem_node with appropriate memblock_ API

2018-09-26 Thread Michal Hocko
On Fri 14-09-18 15:10:31, Mike Rapoport wrote: > Use memblock_alloc_try_nid whenever goal (i.e. minimal address is > specified) and memblock_alloc_node otherwise. > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [PATCH 21/30] memblock: replace alloc_bootmem with memblock_alloc

2018-09-26 Thread Michal Hocko
f (new == NULL) { > pr_err("Alloc_bootmem failed\n"); > return 1; > diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c > index e8ae2e5..332fcca 100644 > --- a/drivers/macintosh/smu.c > +++ b/drivers/macintosh/smu.c > @@ -493,7 +493,7 @@ int __init smu_init (void) > goto fail_np; > } > > - smu = alloc_bootmem(sizeof(struct smu_device)); > + smu = memblock_alloc(sizeof(struct smu_device), 0); > > spin_lock_init(&smu->lock); > INIT_LIST_HEAD(&smu->cmd_list); > diff --git a/init/main.c b/init/main.c > index d0b92bd..99a9e99 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -768,8 +768,8 @@ static int __init initcall_blacklist(char *str) > str_entry = strsep(&str, ","); > if (str_entry) { > pr_debug("blacklisting initcall %s\n", str_entry); > - entry = alloc_bootmem(sizeof(*entry)); > - entry->buf = alloc_bootmem(strlen(str_entry) + 1); > + entry = memblock_alloc(sizeof(*entry), 0); > + entry->buf = memblock_alloc(strlen(str_entry) + 1, 0); > strcpy(entry->buf, str_entry); > list_add(&entry->next, &blacklisted_initcalls); > } > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [PATCH 29/30] mm: remove include/linux/bootmem.h

2018-09-26 Thread Michal Hocko
l of duplicated '#include > > @@ > @@ > - #include > + #include > > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko -- Michal Hocko SUSE Labs

Re: [PATCH 00/30] mm: remove bootmem allocator

2018-09-26 Thread Michal Hocko
cks from the previous iteration and there are only minor comments. This looks good overall. Nice work Mike! -- Michal Hocko SUSE Labs

Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()

2018-09-26 Thread Michal Hocko
On Wed 26-09-18 16:43:35, Mike Rapoport wrote: > On Wed, Sep 26, 2018 at 11:36:48AM +0200, Michal Hocko wrote: > > On Wed 26-09-18 11:31:27, Michal Hocko wrote: > > > On Fri 14-09-18 15:10:29, Mike Rapoport wrote: > > > > With the align parameter memblock_alloc

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-01 Thread Michal Hocko
purpose. You said that distributions have hard time to distinguish different types of onlinining policies but isn't this something that is inherently usecase specific? -- Michal Hocko SUSE Labs

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Michal Hocko
ove_memory simply backs off silently. Why don't we have to care about memblock resp dlpar_remove_device_tree_lmb parts? In other words how come the physical memory range is valid while the node association is not? -- Michal Hocko SUSE Labs

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-02 Thread Michal Hocko
On Mon 01-10-18 11:34:25, David Hildenbrand wrote: > On 01/10/2018 10:40, Michal Hocko wrote: > > On Fri 28-09-18 17:03:57, David Hildenbrand wrote: > > [...] > > > > I haven't read the patch itself but I just wanted to note one thing > > about this part &g

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-02 Thread Michal Hocko
tion of LMBs, but it is not there > yet, and won't be present in earlier kernels without backporting a > significant number of changes. Then the patch you have proposed here just papers over a real issue, no? IIUC then you simply do not remove the memory if you lose the race. -- Michal Hocko SUSE Labs

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-02 Thread Michal Hocko
On Tue 02-10-18 10:14:49, Michael Bringmann wrote: > On 10/02/2018 09:59 AM, Michal Hocko wrote: > > On Tue 02-10-18 09:51:40, Michael Bringmann wrote: > > [...] > >> When the device-tree affinity attributes have changed for memory, > >> the 'nid' affinit

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-03 Thread Michal Hocko
On Tue 02-10-18 12:45:50, Tyrel Datwyler wrote: > On 10/02/2018 11:13 AM, Michael Bringmann wrote: > > > > > > On 10/02/2018 11:04 AM, Michal Hocko wrote: > >> On Tue 02-10-18 10:14:49, Michael Bringmann wrote: > >>> On 10/02/2018 09:59 AM, Michal Ho

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-03 Thread Michal Hocko
On Wed 03-10-18 15:38:04, Vitaly Kuznetsov wrote: > David Hildenbrand writes: > > > On 02/10/2018 15:47, Michal Hocko wrote: > ... > >> > >> Why do you need a generic hotplug rule in the first place? Why don't you > >> simply provide different

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-03 Thread Michal Hocko
On Tue 02-10-18 17:25:19, David Hildenbrand wrote: > On 02/10/2018 15:47, Michal Hocko wrote: [...] > > Zone imbalance is an inherent problem of the highmem zone. It is > > essentially the highmem zone we all loved so much back in 32b days. > > Yes the movable zone doesn&

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-03 Thread Michal Hocko
d of days here trying to come up with > an onlining solution which would work for everyone and eBPF would move > this decision to distro level. The point is that there is _no_ general onlining solution. This is basically policy which belongs to the userspace. -- Michal Hocko SUSE Labs

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-03 Thread Michal Hocko
ree that allocating that from the zone normal and off node is not great. Especially the second part which is noticeable for whole node hotplug. I have a feeling that arguing about fork not able to proceed or OOMing for the memory hotplug is a bit of a stretch and a sign a of misconfiguration. -- Michal Hocko SUSE Labs

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-04 Thread Michal Hocko
g to enable them anyway (e.g. RAS would require to have movable_node kernel parameters, ballooning a kernel module etc.). Really, one udev script to rule them all will simply never work. -- Michal Hocko SUSE Labs

Re: [PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

2018-10-10 Thread Michal Hocko
ic(size, 0) > + memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES) > | > - memblock_alloc_from_nopanic(size, 0, min_addr) > + memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr) > | > - memblock_alloc_node(size, 0, nid) > + memblock_alloc_node(size, SMP_CACHE_BYTES, nid) > ) >

Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.

2018-10-23 Thread Michal Hocko
s hard to review manually. -- Michal Hocko SUSE Labs

Re: [PATCH RFC 0/7] mm: PG_reserved cleanups and documentation

2018-12-05 Thread Michal Hocko
served users before we can do so for device memory? I am all for removing relicts because they just confuse people but I fail to see any relation here. -- Michal Hocko SUSE Labs

Re: [PATCH RFC 7/7] mm: better document PG_reserved

2018-12-05 Thread Michal Hocko
sor. And that is independent from > PG_reserved. > > Cc: Andrew Morton > Cc: Stephen Rothwell > Cc: Pavel Tatashin > Cc: Michal Hocko > Cc: Alexander Duyck > Cc: Matthew Wilcox > Cc: Anthony Yznaga > Cc: Miles Chen > Cc: yi.z.zh...@linux.intel.com > Cc: Dan

Re: [PATCH 1/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-06-25 Thread Michal Hocko
#endif > > -#ifdef CONFIG_NODES_SPAN_OTHER_NODES > +#ifdef CONFIG_NUMA > /* Only safe to use early in boot when initialisation is single-threaded */ > static inline bool __meminit early_pfn_in_nid(unsigned long pfn, int node) > { > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [PATCH 1/2] x86, numa: always initialize all possible nodes

2019-06-26 Thread Michal Hocko
On Thu 02-05-19 09:00:31, Michal Hocko wrote: > On Wed 01-05-19 15:12:32, Barret Rhoden wrote: > [...] > > A more elegant solution may be to avoid registering with sysfs during early > > boot, or something else entirely. But I figured I'd ask for help at this > > p

Re: [PATCH v3 01/11] mm/memory_hotplug: Simplify and fix check_hotplug_memory_range()

2019-07-01 Thread Michal Hocko
rovide an unaligned address and even if it did then rounding that to a pfn doesn't sound like a terrible thing to do. Anyway this removes few lines so why not. > > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko > Cc: David Hildenbrand > Cc: Pavel Tatashin > Cc: Q

Re: [PATCH v3 02/11] s390x/mm: Fail when an altmap is used for arch_add_memory()

2019-07-01 Thread Michal Hocko
e the case for other arches which support hotplug. I do not see much point in adding warning to each of them. > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Mike Rapoport > Cc: David Hildenbrand > Cc: Vasily Gorbik > Cc: Oscar

Re: [PATCH v3 03/11] s390x/mm: Implement arch_remove_memory()

2019-07-01 Thread Michal Hocko
hwidefsky > Cc: Heiko Carstens > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Mike Rapoport > Cc: David Hildenbrand > Cc: Vasily Gorbik > Cc: Oscar Salvador > Signed-off-by: David Hildenbrand > --- > arch/s390/mm/init.c | 13 +++-- > 1 file changed,

Re: [PATCH v3 05/11] drivers/base/memory: Pass a block_id to init_memory_block()

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:46, David Hildenbrand wrote: > We'll rework hotplug_memory_register() shortly, so it no longer consumes > pass a section. > > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Signed-off-by: David Hildenbrand Acked-by: Michal Hocko &g

Re: [PATCH v3 06/11] mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVE

2019-07-01 Thread Michal Hocko
Yoshinori Sato > Cc: Rich Felker > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Cc:

Re: [PATCH v3 07/11] mm/memory_hotplug: Create memory block devices after arch_add_memory()

2019-07-01 Thread Michal Hocko
Use find_memory_block_by_id() in init_memory_block() to catch > duplicates > > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Cc: David Hildenbrand > Cc: "mike.tra...@hpe.com" > Cc: Andrew Morton > Cc: Ingo Molnar > Cc: Andrew Banman >

Re: [PATCH v3 08/11] mm/memory_hotplug: Drop MHP_MEMBLOCK_API

2019-07-01 Thread Michal Hocko
On Mon 27-05-19 13:11:49, David Hildenbrand wrote: > No longer needed, the callers of arch_add_memory() can handle this > manually. > > Cc: Andrew Morton > Cc: David Hildenbrand > Cc: Michal Hocko > Cc: Oscar Salvador > Cc: Pavel Tatashin > Cc: Wei Yang > C

Re: [PATCH v3 09/11] mm/memory_hotplug: Remove memory block devices before arch_remove_memory()

2019-07-01 Thread Michal Hocko
ot;mike.tra...@hpe.com" > Cc: Andrew Morton > Cc: Andrew Banman > Cc: Ingo Molnar > Cc: Alex Deucher > Cc: "David S. Miller" > Cc: Mark Brown > Cc: Chris Wilson > Cc: Oscar Salvador > Cc: Jonathan Cameron > Cc: Michal Hocko > Cc: Pavel Tatashi

Re: [PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-07-01 Thread Michal Hocko
Hildenbrand > Cc: Oscar Salvador > Cc: Andrew Morton > Cc: Jonathan Cameron > Signed-off-by: David Hildenbrand Anyway Acked-by: Michal Hocko > --- > drivers/base/node.c | 18 +- > include/linux/node.h | 5 ++--- > 2 files changed, 7 insertions(+)

Re: [PATCH v3 11/11] mm/memory_hotplug: Remove "zone" parameter from sparse_remove_one_section

2019-07-01 Thread Michal Hocko
vid Hildenbrand Acked-by: Michal Hocko > --- > include/linux/memory_hotplug.h | 2 +- > mm/memory_hotplug.c| 2 +- > mm/sparse.c| 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/memory_hotplu

Re: [PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 11:36:44, Oscar Salvador wrote: > On Mon, Jul 01, 2019 at 10:51:44AM +0200, Michal Hocko wrote: > > Yeah, we do not allow to offline multi zone (node) ranges so the current > > code seems to be over engineered. > > > > Anyway, I am wondering why do we

Re: [PATCH v3 02/11] s390x/mm: Fail when an altmap is used for arch_add_memory()

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 09:43:06, Michal Hocko wrote: > On Mon 27-05-19 13:11:43, David Hildenbrand wrote: > > ZONE_DEVICE is not yet supported, fail if an altmap is passed, so we > > don't forget arch_add_memory()/arch_remove_memory() when unlocking > > support. > > Why d

Re: [PATCH v3 03/11] s390x/mm: Implement arch_remove_memory()

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 09:45:03, Michal Hocko wrote: > On Mon 27-05-19 13:11:44, David Hildenbrand wrote: > > Will come in handy when wanting to handle errors after > > arch_add_memory(). > > I do not understand this. Why do you add a code for something that is > not possible

Re: [PATCH v3 04/11] arm64/mm: Add temporary arch_remove_memory() implementation

2019-07-01 Thread Michal Hocko
anup page tables (also in arch_add_memory() in case > + * adding fails). Until then, this function should only be used > + * during memory hotplug (adding memory), not for memory > + * unplug. ARCH_ENABLE_MEMORY_HOTREMOVE must not be > + * unlocked yet. > + */ > + zone = page_zone(pfn_to_page(start_pfn)); > + __remove_pages(zone, start_pfn, nr_pages, altmap); > +} > +#endif > #endif > -- > 2.20.1 -- Michal Hocko SUSE Labs

Re: [PATCH v3 06/11] mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVE

2019-07-01 Thread Michal Hocko
On Mon 01-07-19 10:01:41, Michal Hocko wrote: > On Mon 27-05-19 13:11:47, David Hildenbrand wrote: > > We want to improve error handling while adding memory by allowing > > to use arch_remove_memory() and __remove_pages() even if > > CONFIG_MEMORY_HOTREMOVE is not set to e.g.

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-12 Thread Michal Hocko
PAN_OTHER_NODES by default for NUMA to fix this issue. Yes it can occur on any arch but most sane platforms simply do not overlap physical ranges. So I do not really see any reason to unconditionally enable the config for everybody. What is an advantage? -- Michal Hocko SUSE Labs

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-12 Thread Michal Hocko
in the first place. Please explain what motivated you to make this change. -- Michal Hocko SUSE Labs

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-12 Thread Michal Hocko
On Fri 12-07-19 15:37:30, Will Deacon wrote: > Hi all, > > On Fri, Jul 12, 2019 at 02:12:23PM +0200, Michal Hocko wrote: > > On Fri 12-07-19 10:56:47, Hoan Tran OS wrote: > > [...] > > > It would be good if we can enable it by-default. Otherwise, let arch > &g

Re: [PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

2019-07-18 Thread Michal Hocko
On Mon 15-07-19 13:10:33, David Hildenbrand wrote: > On 01.07.19 12:27, Michal Hocko wrote: > > On Mon 01-07-19 11:36:44, Oscar Salvador wrote: > >> On Mon, Jul 01, 2019 at 10:51:44AM +0200, Michal Hocko wrote: > >>> Yeah, we do not allow to offline multi zon

Re: [PATCH v3 06/11] mm/memory_hotplug: Allow arch_remove_pages() without CONFIG_MEMORY_HOTREMOVE

2019-07-18 Thread Michal Hocko
be simpler rather than going half way to get there. I would have liked the above for the purpose of this patch more and then go with another one to remove the config altogether. But Andrew has already sent his patch bomb including this series to Linus so this is all moot. -- Michal Hocko SUSE Labs

Re: [PATCH v3 02/11] s390x/mm: Fail when an altmap is used for arch_add_memory()

2019-07-18 Thread Michal Hocko
On Mon 15-07-19 12:51:27, David Hildenbrand wrote: > On 01.07.19 14:46, Michal Hocko wrote: > > On Mon 01-07-19 09:43:06, Michal Hocko wrote: > >> On Mon 27-05-19 13:11:43, David Hildenbrand wrote: > >>> ZONE_DEVICE is not yet supported, fail if an altmap is pa

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-30 Thread Michal Hocko
[Sorry for a late reply] On Mon 15-07-19 17:55:07, Hoan Tran OS wrote: > Hi, > > On 7/12/19 10:00 PM, Michal Hocko wrote: [...] > > Hmm, I thought this was selectable. But I am obviously wrong here. > > Looking more closely, it seems that this is indeed only about > >

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-31 Thread Michal Hocko
On Wed 31-07-19 09:24:21, Mike Rapoport wrote: > [ sorry for a late reply too, somehow I missed this thread before ] > > On Tue, Jul 30, 2019 at 10:14:15AM +0200, Michal Hocko wrote: > > [Sorry for a late reply] > > > > On Mon 15-07-19 17:55:07, Hoan Tran OS wrote: >

Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-07-31 Thread Michal Hocko
On Wed 31-07-19 14:14:22, Mike Rapoport wrote: > On Wed, Jul 31, 2019 at 10:03:09AM +0200, Michal Hocko wrote: > > On Wed 31-07-19 09:24:21, Mike Rapoport wrote: > > > [ sorry for a late reply too, somehow I missed this thread before ] > > > > > > On Tue, Jul

microblaze HAVE_MEMBLOCK_NODE_MAP dependency (was Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)

2019-07-31 Thread Michal Hocko
On Wed 31-07-19 15:26:32, Mike Rapoport wrote: > On Wed, Jul 31, 2019 at 01:40:16PM +0200, Michal Hocko wrote: > > On Wed 31-07-19 14:14:22, Mike Rapoport wrote: > > > On Wed, Jul 31, 2019 at 10:03:09AM +0200, Michal Hocko wrote: > > > > On Wed 31-07-19

Re: microblaze HAVE_MEMBLOCK_NODE_MAP dependency (was Re: [PATCH v2 0/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA)

2019-07-31 Thread Michal Hocko
On Wed 31-07-19 17:21:29, Mike Rapoport wrote: > On Wed, Jul 31, 2019 at 03:00:37PM +0200, Michal Hocko wrote: > > On Wed 31-07-19 15:26:32, Mike Rapoport wrote: > > > On Wed, Jul 31, 2019 at 01:40:16PM +0200, Michal Hocko wrote: > > > > On Wed 31-07-19 14:14:22, Mik

Re: [PATCH V4 0/3] * mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region

2018-12-18 Thread Michal Hocko
upport for migrating compound pages. The first path adds > > the helper > > get_user_pages_cma_migrate() which pin the page making sure we migrate them > > out of > > CMA region before incrementing the reference count. > > Very little review activity. Perhaps Andrey and/or Michal can find the > time.. I will unlikely find some time before the end of the year. Sorry about that. -- Michal Hocko SUSE Labs

Re: [PATCHv2 2/3] mm/numa: build zonelist when alloc for device on offline node

2018-12-20 Thread Michal Hocko
gfp_zonelist(flags); > } No, please don't do this. We do not want to make things work magically and we definitely do not want to put something like that into the hot path. We definitely need zonelists to be build transparently for all possible nodes during the init time. -- Michal Hocko SUSE Labs

Re: [PATCHv2 2/3] mm/numa: build zonelist when alloc for device on offline node

2018-12-20 Thread Michal Hocko
On Thu 20-12-18 20:26:28, Pingfan Liu wrote: > On Thu, Dec 20, 2018 at 7:35 PM Michal Hocko wrote: > > > > On Thu 20-12-18 17:50:38, Pingfan Liu wrote: > > [...] > > > @@ -453,7 +456,12 @@ static inline int gfp_zonelist(gfp_t flags) > > > */ > > &g

Re: [PATCH RFCv2 0/4] mm/memory_hotplug: Introduce memory block types

2018-12-20 Thread Michal Hocko
w, I am doing it just like > > the other types (e.g. online_type) we are using in that context. > > - The "removable" property should never have been named like that. It > > should have been "offlinable". Can we still rename that? E.g. boot memory > > is sometimes marked as removable ... > > > > > Any feedback regarding the suggested block types would be very much > appreciated! I still do not like this much to be honest. I just didn't get to think through this properly. My fear is that this is conflating an actual API with the current implementation and as such will cause problems in future. But I haven't really looked into your patches closely so I might be wrong. Anyway I won't be able to look into it by the end of year. -- Michal Hocko SUSE Labs

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Michal Hocko
expose in generic gfp.h IMHO. It just risks an abuse. I would be looking at providing asm-generic implementation and reuse it to remove the code duplication. But I haven't tried that to know that it will work out due to small/subtle differences between arches. > Signed-off-by: Anshuman Khand

Re: [PATCH] mm: Introduce GFP_PGTABLE

2019-01-13 Thread Michal Hocko
On Mon 14-01-19 09:30:55, Anshuman Khandual wrote: > > > On 01/13/2019 11:05 PM, Michal Hocko wrote: > > On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: > >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > >> __GFP_ZERO) and u

[RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Michal Hocko
From: Michal Hocko Pingfan Liu has reported the following splat [5.772742] BUG: unable to handle kernel paging request at 2088 [5.773618] PGD 0 P4D 0 [5.773618] Oops: [#1] SMP NOPTI [5.773618] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.20.0-rc1+ #3 [5.773618

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-14 Thread Michal Hocko
On Mon 14-01-19 21:26:39, Michael Ellerman wrote: > Michal Hocko writes: > > > From: Michal Hocko > > > > Pingfan Liu has reported the following splat > > [5.772742] BUG: unable to handle kernel paging request at > > 2088 > > [5.7

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-15 Thread Michal Hocko
t *pgd) > @@ -422,7 +420,8 @@ static inline void _pgd_free(pgd_t *pgd) > > static inline pgd_t *_pgd_alloc(void) > { > - return (pgd_t *)__get_free_pages(PGALLOC_GFP, PGD_ALLOCATION_ORDER); > + return (pgd_t *)__get_free_pages(GFP_PGTABLE | __GFP_ACCOUNT, > + PGD_ALLOCATION_ORDER); > } > > static inline void _pgd_free(pgd_t *pgd) > diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h > index 05e61e6..3d9cde6 100644 > --- a/include/asm-generic/pgtable.h > +++ b/include/asm-generic/pgtable.h > @@ -1186,4 +1186,6 @@ static inline bool arch_has_pfn_modify_check(void) > #define mm_pmd_folded(mm)__is_defined(__PAGETABLE_PMD_FOLDED) > #endif > > +#define GFP_PGTABLE (GFP_KERNEL | __GFP_ZERO) > + > #endif /* _ASM_GENERIC_PGTABLE_H */ > diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c > index fbdf3ac..f60a5b8 100644 > --- a/virt/kvm/arm/mmu.c > +++ b/virt/kvm/arm/mmu.c > @@ -143,7 +143,7 @@ static int mmu_topup_memory_cache(struct > kvm_mmu_memory_cache *cache, > if (cache->nobjs >= min) > return 0; > while (cache->nobjs < max) { > - page = (void *)__get_free_page(PGALLOC_GFP); > + page = (void *)__get_free_page(GFP_PGTABLE); > if (!page) > return -ENOMEM; > cache->objects[cache->nobjs++] = page; > -- > 2.7.4 > -- Michal Hocko SUSE Labs

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Michal Hocko
On Wed 16-01-19 04:30:18, Matthew Wilcox wrote: > On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > > On Wed 16-01-19 11:51:32, Anshuman Khandual wrote: > > > All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL > > > | > &g

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Michal Hocko
On Wed 16-01-19 05:18:27, Matthew Wilcox wrote: > On Wed, Jan 16, 2019 at 06:42:22PM +0530, Anshuman Khandual wrote: > > On 01/16/2019 06:00 PM, Matthew Wilcox wrote: > > > On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > > >> On Wed 16-01-19 11:

Re: [PATCH V2] mm: Introduce GFP_PGTABLE

2019-01-16 Thread Michal Hocko
On Wed 16-01-19 18:57:13, Anshuman Khandual wrote: > > > On 01/16/2019 06:14 PM, Michal Hocko wrote: > > On Wed 16-01-19 04:30:18, Matthew Wilcox wrote: > >> On Wed, Jan 16, 2019 at 07:57:03AM +0100, Michal Hocko wrote: > >>> On Wed 16-01-19 11:51:32,

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-24 Thread Michal Hocko
a friendly ping for this. Does anybody see any problem with this approach? On Mon 14-01-19 09:24:16, Michal Hocko wrote: > From: Michal Hocko > > Pingfan Liu has reported the following splat > [5.772742] BUG: unable to handle kernel paging request at 2088 > [

Re: [RFC PATCH] x86, numa: always initialize all possible nodes

2019-01-25 Thread Michal Hocko
On Thu 24-01-19 19:51:44, Mike Rapoport wrote: > On Thu, Jan 24, 2019 at 03:17:27PM +0100, Michal Hocko wrote: > > a friendly ping for this. Does anybody see any problem with this > > approach? > > FWIW, it looks fine to me. > > It'd just be nice to have a few m

<    1   2   3   4   5   >