Re: [RFC PATCH] Memory hotplug support for arm64 platform

2016-12-15 Thread Andrea Reale
Hi Xishi Qiu, thanks for your comments. The short anwser to your question is the following. As you hinted, it is related to the way pfn_valid() is implemented in arm64 when CONFIG_HAVE_ARCH_PFN_VALID is true (default), i.e., just a check for the NOMAP flags on the corresponding memblocks. Sinc

Re: [RFC PATCH] Memory hotplug support for arm64 platform

2017-02-06 Thread Andrea Reale
lug on arm64 platform. > >>> > >>>To enable the feature the CONFIG_MEMORY_HOTPLUG compilation flag > >>>needs to be set to true. Then, after memory is physically hotplugged, > >>>the standard two steps to make it available (as also documented in > >>&

Re: [PATCH 4/5] Hot-remove implementation for arm64

2017-04-21 Thread Andrea Reale
Hi all, Thanks Mark, Ard and Laura for your comments. Replies in-line. On Tue, Apr 18, 2017 at 07:21:26PM +0100, Mark Rutland wrote: [...] > > > > The name direct is inherited directly from the x86_64 hot remove code. > > It serves to distinguish if we are removing either a pagetable page that

Re: [PATCH 4/5] Hot-remove implementation for arm64

2017-04-21 Thread Andrea Reale
Hi all, thanks for taking the time to comment. Replies in-line. On Wed, Apr 19, 2017 at 08:53:13AM -0700, Laura Abbott wrote: > On 04/18/2017 11:48 AM, Ard Biesheuvel wrote: > >On 18 April 2017 at 19:21, Mark Rutland wrote: > >>On Fri, Apr 14, 2017 at 03:01:58PM +0100,

[PATCH 0/5] Memory hotplug support for arm64 - complete patchset

2017-04-11 Thread Andrea Reale
] https://lkml.org/lkml/2016/12/14/188 [2] https://lkml.org/lkml/2016/12/1/811 [3] https://hotplug-tests.eu-gb.mybluemix.net Andrea Reale (2): Hot-remove implementation for arm64 Add "remove" probe driver for memory hot-remove Maciej Bielski (1): Memory hotplug support for arm64 pl

[PATCH 1/5] arm64: memory-hotplug: Add MEMORY_HOTPLUG, MEMORY_HOTREMOVE, MEMORY_PROBE

2017-04-11 Thread Andrea Reale
From: Scott Branden Add memory-hotplug support for ARM64 platform. This requires addition of ARCH_ENABLE_MEMORY_HOTPLUG and ARCH_ENABLE_MEMORY_HOTREMOVE config options. MEMORY_PROBE config option is added to support /sys/devices/system/memory/probe functionality. In addition architecture speci

[PATCH 2/5] arm64: defconfig: enable MEMORY_HOTPLUG config options

2017-04-11 Thread Andrea Reale
From: Scott Branden Enable memory hotplug config options to add/remove memory. Signed-off-by: Scott Branden --- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 7c48028..80f48b0 100644 --- a/ar

[PATCH 3/5] Memory hotplug support for arm64 platform (v2)

2017-04-11 Thread Andrea Reale
highly appreciated. [1] https://lkml.org/lkml/2016/11/17/49 [2] https://lkml.org/lkml/2016/12/1/811 [3] https://lkml.org/lkml/2016/12/14/188 Signed-off-by: Maciej Bielski Signed-off-by: Andrea Reale --- arch/arm64/Kconfig | 4 +-- arch/arm64/include/asm/mmu.h

[PATCH 4/5] Hot-remove implementation for arm64

2017-04-11 Thread Andrea Reale
- arch_remove_memory interface - kernel page tables cleanup - vmemmap_free implementation for arm64 Signed-off-by: Andrea Reale Signed-off-by: Maciej Bielski --- arch/arm64/Kconfig | 3 + arch/arm64/include/asm/mmu.h | 4 + arch/arm64/include/asm/pgtable.h | 15 ++ arch

[PATCH 5/5] Add "remove" probe driver for memory hot-remove

2017-04-11 Thread Andrea Reale
system/memory/memoryXXX/state To use the remove interface to remove the section: # echo $((0xYY)) > /sys/devices/system/memory/remove where 0xYY is the physical address of the memory section to remove. Signed-off-by: Andrea Reale Signed-off-by: Maciej Bielski --- drivers/ba

Re: [RFC PATCH] Memory hotplug support for arm64 platform

2017-03-31 Thread Andrea Reale
Hi Florian, thanks for your message. Please, find the replies in-line. On Wed, Mar 29, 2017 at 05:40:02PM -0700, Florian Fainelli wrote: > While the "hack" that sets/clears NOMAP in order for pfn_valid() to > return false/true when appropriate during __add_pages() definitively > does seem to work

Re: [PATCH 4/5] Hot-remove implementation for arm64

2017-04-14 Thread Andrea Reale
Hi, > > On Tue, Apr 11, 2017 at 03:55:42PM +0100, Andrea Reale wrote: > > +static inline unsigned long pmd_page_vaddr(pmd_t pmd) > > +{ > > + return (unsigned long) __va(pmd_page_paddr(pmd)); > > +} > > + > > /* Find an entry in the third-lev

Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page()

2017-11-22 Thread Andrea Reale
On Tue 21 Nov 2017, 17:35, Zi Yan wrote: > On 21 Nov 2017, at 17:12, Andrew Morton wrote: > > > On Mon, 20 Nov 2017 21:18:55 -0500 Zi Yan wrote: > > > >> This patch fixes it by only calling prep_transhuge_page() when we are > >> certain that the target page is THP. > > > > What are the user-visib

[PATCH v2 0/5] Memory hotplug support for arm64 - complete patchset v2

2017-11-23 Thread Andrea Reale
aversal macros. - Check on the corner case where P[UM]Ds would have to be split during hot remove: now this is forbidden. - Minor fixes and refactoring. Andrea Reale (4): mm: memory_hotplug: Remove assumption on memory state before hotremove mm: memory_hotplug: memblock to track partially r

[PATCH v2 2/5] mm: memory_hotplug: Remove assumption on memory state before hotremove

2017-11-23 Thread Andrea Reale
software-aided arm64 offlining and removal process. Signed-off-by: Andrea Reale Signed-off-by: Maciej Bielski --- drivers/acpi/acpi_memhotplug.c | 2 +- include/linux/memory_hotplug.h | 9 ++--- mm/memory_hotplug.c| 13 + 3 files changed, 16 insertions(+), 8 deletions(-)

[PATCH v2 3/5] mm: memory_hotplug: memblock to track partially removed vmemmap mem

2017-11-23 Thread Andrea Reale
now, this will be used for the arm64 port of memory hot remove, but the idea is to eventually use the same mechanism for x86 as well. Signed-off-by: Andrea Reale Signed-off-by: Maciej Bielski --- include/linux/memblock.h | 12 mm/memblock.c| 32 +

[PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-11-23 Thread Andrea Reale
Adding a "remove" sysfs handle that can be used to trigger memory hotremove manually, exactly simmetrically with what happens with the "probe" device for hot-add. This is usueful for architecture that do not rely on ACPI for memory hot-remove. Signed-off-by: Andrea Reale S

[PATCH v2 5/5] mm: memory-hotplug: Add memory hot remove support for arm64

2017-11-23 Thread Andrea Reale
er hot-added (there since boot). If the above conditions hold, we avoid splitting the P[UM]Ds and, instead, we forbid hot removal. - Minor fixes and refactoring. Signed-off-by: Andrea Reale Signed-off-by: Maciej Bielski --- arch/arm64/Kconfig | 3 + arch/arm64/configs/defconfig

Re: [PATCH v2 1/5] mm: memory_hotplug: Memory hotplug (add) support for arm64

2017-11-27 Thread Andrea Reale
> all changes are additive and non destructive. > > > > > >- stop_machine used to updated swapper on hot add, avoiding races > > > > > >- checking if pagealloc is under debug to stay coherent with mem_map > > > > >

Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-11-27 Thread Andrea Reale
Hi Robin, On Mon 27 Nov 2017, 15:33, Robin Murphy wrote: > On 23/11/17 11:14, Andrea Reale wrote: > >Adding a "remove" sysfs handle that can be used to trigger > >memory hotremove manually, exactly simmetrically with > >what happens with the "probe" devic

Re: [PATCH v2 3/5] mm: memory_hotplug: memblock to track partially removed vmemmap mem

2017-11-27 Thread Andrea Reale
Hi Robin, On Mon 27 Nov 2017, 15:20, Robin Murphy wrote: > On 23/11/17 11:14, Andrea Reale wrote: > >When hot-removing memory we need to free vmemmap memory. > > What problems arise if we don't? Is it only for the sake of freeing up some > pages here and there, or

Re: [PATCH v2 2/5] mm: memory_hotplug: Remove assumption on memory state before hotremove

2017-11-27 Thread Andrea Reale
Hi again, On Mon 27 Nov 2017, 15:20, Robin Murphy wrote: > On 24/11/17 15:54, Andrea Reale wrote: > >On Fri 24 Nov 2017, 16:43, Michal Hocko wrote: > >>On Fri 24-11-17 14:49:17, Andrea Reale wrote: > >>>Hi Rafael, > >>> > >>>On Fri 24 Nov 2017

Re: [PATCH v2 2/5] mm: memory_hotplug: Remove assumption on memory state before hotremove

2017-12-04 Thread Andrea Reale
Hi Joey, and thanks for your comments. Response inline: On Wed 29 Nov 2017, 09:52, joeyli wrote: > On Wed, Nov 29, 2017 at 08:49:13AM +0800, joeyli wrote: > > Hi Andrea, > > > > On Fri, Nov 24, 2017 at 10:22:35AM +, Andrea Reale wrote: > > > Resending the pat

Re: [PATCH v2 0/5] Memory hotplug support for arm64 - complete patchset v2

2017-12-04 Thread Andrea Reale
Hi Michal, On Thu 30 Nov 2017, 15:57, Michal Hocko wrote: > On Thu 23-11-17 17:33:31, Andrea Reale wrote: > > On Thu 23 Nov 2017, 17:02, Michal Hocko wrote: > > > > Hi Michal, > > > > > I will try to have a look but I do not expect to understand any of ar

Re: [PATCH v2 3/5] mm: memory_hotplug: memblock to track partially removed vmemmap mem

2017-12-04 Thread Andrea Reale
On Thu 30 Nov 2017, 15:51, Michal Hocko wrote: > On Thu 23-11-17 11:14:38, Andrea Reale wrote: > > When hot-removing memory we need to free vmemmap memory. > > However, depending on the memory is being removed, it might > > not be always possible to free a full vmemmap page /

Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-12-04 Thread Andrea Reale
On Thu 30 Nov 2017, 15:49, Michal Hocko wrote: > On Thu 23-11-17 11:14:52, Andrea Reale wrote: > > Adding a "remove" sysfs handle that can be used to trigger > > memory hotremove manually, exactly simmetrically with > > what happens with the "probe" device

Re: [PATCH v2 3/5] mm: memory_hotplug: memblock to track partially removed vmemmap mem

2017-12-04 Thread Andrea Reale
On Mon 4 Dec 2017, 13:32, Michal Hocko wrote: > On Mon 04-12-17 11:49:09, Andrea Reale wrote: > > On Thu 30 Nov 2017, 15:51, Michal Hocko wrote: > > > On Thu 23-11-17 11:14:38, Andrea Reale wrote: > > > > When hot-removing memory we need to free vmemmap memory. >

Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-12-04 Thread Andrea Reale
On Mon 4 Dec 2017, 13:33, Michal Hocko wrote: > On Mon 04-12-17 11:51:29, Andrea Reale wrote: > > On Thu 30 Nov 2017, 15:49, Michal Hocko wrote: > > > On Thu 23-11-17 11:14:52, Andrea Reale wrote: > > > > Adding a "remove" sysfs handle that can be used to t

[PATCH 0/1] mm/migrate: do not call prep_transhuge_page if !thp_migration_supported

2017-11-20 Thread Andrea Reale
gus. Best regards, Andrea [1] https://lkml.org/lkml/2017/4/11/536 Andrea Reale (1): mm/migrate: do not call prep_transhuge_page if !thp_migration_supported include/linux/migrate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4

[PATCH 1/1] mm/migrate: do not call prep_transhuge_page if !thp_migration_supported

2017-11-20 Thread Andrea Reale
new_page_nodemask in linux/migrate.h should not call prep_transhuge_page if thp_migration_support is false. Fixes commit 8135d8926c08 ("mm: memory_hotplug: memory hotremove supports thp migration") Signed-off-by: Andrea Reale --- include/linux/migrate.h | 2 +- 1 file changed, 1

Re: [PATCH 1/1] mm/migrate: do not call prep_transhuge_page if !thp_migration_supported

2017-11-20 Thread Andrea Reale
preferred_nid, nodemask); > > - if (new_page && PageTransHuge(page)) > + if (new_page && PageTransHuge(new_page)) > prep_transhuge_page(new_page); > > return new_page; > -- > > > -- > Best Regards > Yan

Re: [PATCH v2 0/5] Memory hotplug support for arm64 - complete patchset v2

2017-11-23 Thread Andrea Reale
evels. Now this is hidden in the pgtable traversal macros. > > - Check on the corner case where P[UM]Ds would have to be split during > > hot remove: now this is forbidden. > > - Minor fixes and refactoring. > > > > Andrea Reale (4): > > mm: memory_hotplug:

Re: [PATCH v2 1/5] mm: memory_hotplug: Memory hotplug (add) support for arm64

2017-11-24 Thread Andrea Reale
Hi Arun, On Fri 24 Nov 2017, 11:25, Arun KS wrote: > On Thu, Nov 23, 2017 at 4:43 PM, Maciej Bielski > wrote: >> [ ...] > > Introduces memory hotplug functionality (hot-add) for arm64. > > @@ -615,6 +616,44 @@ void __init paging_init(void) > > SWAPPER_DIR_SIZE - PAGE_SIZE);

Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-11-24 Thread Andrea Reale
we require !NUMA to enable ARCH_ENABLE_MEMORY_HOTPLUG. The reason for this simplification is simply that we would not know how to decide the correct node to which to add memory when NUMA is on. Any suggestion on that matter is welcome. Thanks, Andrea > Thnaks > zhongjiang > > On 2017/11/23

Re: [PATCH v2 4/5] mm: memory_hotplug: Add memory hotremove probe device

2017-11-24 Thread Andrea Reale
ckstart this discussion on what's the best approach to support NUMA . Ideas/suggestions? Thanks, Andrea > > Thanks > zhongjiang > > On 2017/11/24 18:44, Andrea Reale wrote: > > Hi zhongjiang, > > > > On Fri 24 Nov 2017, 18:35, zhong jiang wrote: > >> HI,

Re: [PATCH v2 2/5] mm: memory_hotplug: Remove assumption on memory state before hotremove

2017-11-24 Thread Andrea Reale
Hi Rafael, On Fri 24 Nov 2017, 15:39, Rafael J. Wysocki wrote: > On Fri, Nov 24, 2017 at 11:22 AM, Andrea Reale > wrote: > > Resending the patch adding linux-acpi in CC, as suggested by Rafael. > > Everyone else: apologies for the noise. > > > > Commit 242831

Re: [PATCH v2 2/5] mm: memory_hotplug: Remove assumption on memory state before hotremove

2017-11-24 Thread Andrea Reale
On Fri 24 Nov 2017, 16:43, Michal Hocko wrote: > On Fri 24-11-17 14:49:17, Andrea Reale wrote: > > Hi Rafael, > > > > On Fri 24 Nov 2017, 15:39, Rafael J. Wysocki wrote: > > > On Fri, Nov 24, 2017 at 11:22 AM, Andrea Reale > > > wrote: > > > &