Re: [RFC 2/8] mm: Add specialized fallback zonelist for coherent device memory nodes

2016-10-24 Thread Anshuman Khandual
On 10/24/2016 10:40 PM, Dave Hansen wrote: > On 10/23/2016 09:31 PM, Anshuman Khandual wrote: >> +#ifdef CONFIG_COHERENT_DEVICE >> +/* >> + * Isolation requiring coherent device memory node's zones >> + * should not be part of any oth

Re: [HMM v13 08/18] mm/hmm: heterogeneous memory management (HMM for short)

2016-11-22 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > HMM provides 3 separate functionality : > - Mirroring: synchronize CPU page table and device page table > - Device memory: allocating struct page for device memory > - Migration: migrating regular memory to device memory > > This patch

Re: [PATCH 1/5] mm: migrate: Add mode parameter to support additional page copy routines.

2016-11-23 Thread Anshuman Khandual
On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan There are multiple "from" for this patch, should be fixed to reflect just one of them. > > migrate_page_copy() and copy_huge_page() are affected. In this patch you are just

Re: [PATCH 1/5] mm: migrate: Add mode parameter to support additional page copy routines.

2016-11-23 Thread Anshuman Khandual
On 11/23/2016 01:26 AM, kbuild test robot wrote: > Hi Zi, > > [auto build test WARNING on linus/master] > [also build test WARNING on v4.9-rc6 next-20161122] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: >

[RFC 1/4] mm: Define coherent device memory node

2016-11-22 Thread Anshuman Khandual
There are certain devices like specialized accelerator, GPU cards, network cards, FPGA cards etc which might contain onboard memory which is coherent along with the existing system RAM while being accessed either from the CPU or from the device. They share some similar properties with that of

[DEBUG 06/12] powerpc/mm: Create numa nodes for hotplug memory

2016-11-22 Thread Anshuman Khandual
ed address range. Signed-off-by: Reza Arbab <ar...@linux.vnet.ibm.com> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- arch/powerpc/mm/numa.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c in

[RFC 4/4] mm: Ignore cpuset enforcement when allocation flag has __GFP_THISNODE

2016-11-22 Thread Anshuman Khandual
with this patch. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6de9440..1697e21 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3715,7 +3715,7 @@ struc

[RFC 0/4] Define coherent device memory node

2016-11-22 Thread Anshuman Khandual
. Inputs, thoughts or suggestions on other alternate approaches are welcome. Thank you. Anshuman Khandual (4): mm: Define coherent device memory node mm/cpuset: Exclude coherent device memory nodes from mems_allowed mm/hugetlb: Restrict HugeTLB page allocations only to system ram nodemask mm

[RFC 3/4] mm/hugetlb: Restrict HugeTLB page allocations only to system ram nodemask

2016-11-22 Thread Anshuman Khandual
of N_MEMORY node mask. This isolates coherent device memory nodes from HugeTLB allocations. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/hugetlb.c | 32 +++- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/mm/hugetlb.

[RFC 2/4] mm/cpuset: Exclude coherent device memory nodes from mems_allowed

2016-11-22 Thread Anshuman Khandual
isolation of the coherent device memory node from userspace allocations. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mm.h | 1 + include/linux/node.h | 12 kernel/cpuset.c | 12 +++- 3 files changed, 20 insertions(+), 5 del

[DEBUG 10/12] mm: Add a new migration function migrate_virtual_range()

2016-11-22 Thread Anshuman Khandual
This adds a new virtual address range based migration interface which can migrate all the mapped pages from a virtual range of a process to a destination node. This also exports this new function symbol. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mempo

[DEBUG 11/12] drivers: Add two drivers for coherent device memory tests

2016-11-22 Thread Anshuman Khandual
-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- drivers/char/Kconfig | 23 +++ drivers/char/Makefile| 2 + drivers/char/coherent_hotplug_demo.c | 133 ++ drivers/char/coherent_memory_demo.c

[DEBUG 12/12] test: Add a script to perform random VMA migrations across nodes

2016-11-22 Thread Anshuman Khandual
This is a test script which creates a workload (e.g ebizzy) and go through it's VMAs (/proc/pid/maps) and initiate migration to random nodes which can be either system memory node or coherent memory node. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- tools/testing/sel

[DEBUG 09/12] powerpc: Enable CONFIG_MOVABLE_NODE for PPC64 platform

2016-11-22 Thread Anshuman Khandual
Just enable MOVABLE_NODE config option for PPC64 platform by default. This prevents accidentally building the kernel without the required config option. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- arch/powerpc/Kconfig | 4 1 file changed, 4 insertions(+) diff

[DEBUG 07/12] powerpc/mm: Allow memory hotplug into a memory less node

2016-11-22 Thread Anshuman Khandual
From: Reza Arbab <ar...@linux.vnet.ibm.com> Remove the check which prevents us from hotplugging into an empty node. Signed-off-by: Reza Arbab <ar...@linux.vnet.ibm.com> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- arch/powerpc/mm/numa.c | 13 +--

[DEBUG 08/12] mm: Enable CONFIG_MOVABLE_NODE on powerpc

2016-11-22 Thread Anshuman Khandual
From: Reza Arbab <ar...@linux.vnet.ibm.com> Onlining memory into ZONE_MOVABLE requires CONFIG_MOVABLE_NODE. Enable the use of this config option on PPC64 platforms. Signed-off-by: Reza Arbab <ar...@linux.vnet.ibm.com> Signed-off-by: Anshuman Khandual <khand...@lin

[DEBUG 05/12] powerpc/mm: Identify coherent device memory nodes during platform init

2016-11-22 Thread Anshuman Khandual
to support the arch_check_cdm_node() function for the core VM. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- arch/powerpc/mm/numa.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 31efc27

Re: [PATCH 2/5] mm: migrate: Change migrate_mode to support combination migration modes.

2016-11-24 Thread Anshuman Khandual
On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan > > No functionality is changed. The commit message need to contains more details like it changes the enum declaration from numbers to bit positions, where all it changes existing

Re: [PATCH 5/5] mm: migrate: Add vm.accel_page_copy in sysfs to control whether to use multi-threaded to accelerate page copy.

2016-11-24 Thread Anshuman Khandual
On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan > > Since base page migration did not gain any speedup from > multi-threaded methods, we only accelerate the huge page case. > > Signed-off-by: Zi Yan >

Re: [PATCH 4/5] mm: migrate: Add copy_page_mt into migrate_pages.

2016-11-24 Thread Anshuman Khandual
On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan > > An option is added to move_pages() syscall to use multi-threaded > page migration. > > Signed-off-by: Zi Yan > Signed-off-by: Zi Yan >

Re: [PATCH 3/5] migrate: Add copy_page_mt to use multi-threaded page migration.

2016-11-24 Thread Anshuman Khandual
On 11/22/2016 09:55 PM, Zi Yan wrote: > From: Zi Yan > > From: Zi Yan Please fix these. > > Internally, copy_page_mt splits a page into multiple threads > and send them as jobs to system_highpri_wq. The function should be renamed as

Re: [PATCH] proc: mm: export PTE sizes directly in smaps (v2)

2016-11-24 Thread Anshuman Khandual
iganticPages: DeviceGinormousPages: > > 1. I'd like to thank Dan Williams for showing me a mirror as I >complained about the bozo that introduced 'AnonHugePages'. > > Cc: Christoph Hellwig <h...@lst.de> > Cc: Andrew Morton <a...@linux-foundation.org> >

Re: [PATCH v2 10/12] mm: mempolicy: mbind and migrate_pages support thp migration

2016-11-25 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > This patch enables thp migration for mbind(2) and migrate_pages(2). > > Signed-off-by: Naoya Horiguchi > --- > ChangeLog v1 -> v2: > - support pte-mapped and doubly-mapped thp > --- > mm/mempolicy.c | 108 >

Re: [RFC 4/4] mm: Ignore cpuset enforcement when allocation flag has __GFP_THISNODE

2016-11-28 Thread Anshuman Khandual
On 11/29/2016 02:42 AM, Dave Hansen wrote: > On 11/22/2016 06:19 AM, Anshuman Khandual wrote: >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -3715,7 +3715,7 @@ struct page * >> .migratetype = gfpflags_to_migratetype(gfp_mask), >> };

Re: [PATCH 1/5] mm: migrate: Add mode parameter to support additional page copy routines.

2016-11-28 Thread Anshuman Khandual
On 11/28/2016 08:43 PM, Zi Yan wrote: > On 24 Nov 2016, at 18:56, Balbir Singh wrote: > >> > On 23/11/16 03:25, Zi Yan wrote: >>> >> From: Zi Yan >>> >> >>> >> From: Zi Yan >>> >> >>> >> migrate_page_copy() and copy_huge_page() are affected. >>> >> >>> >>

Re: [PATCH 3/5] migrate: Add copy_page_mt to use multi-threaded page migration.

2016-11-28 Thread Anshuman Khandual
On 11/28/2016 08:33 PM, Zi Yan wrote: > On 24 Nov 2016, at 4:26, Anshuman Khandual wrote: > >> On 11/22/2016 09:55 PM, Zi Yan wrote: >>> From: Zi Yan <zi@cs.rutgers.edu> >>> >>> From: Zi Yan <z...@nvidia.com> >> >> Plea

Re: [HMM v13 08/18] mm/hmm: heterogeneous memory management (HMM for short)

2016-11-27 Thread Anshuman Khandual
On 11/27/2016 06:40 PM, Jerome Glisse wrote: > On Wed, Nov 23, 2016 at 09:33:35AM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > > [...] > >>> + * >>> + * hmm_vma_migrate(vma, start, end, ops); >>> + *

Re: [HMM v13 01/18] mm/memory/hotplug: convert device parameter bool to set of flags

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 05:57 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 12:11:50PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > > [...] > >>> @@ -956,7 +963,7 @@ kernel_physical_mapping_remove(unsigned long st

Re: [HMM v13 03/18] mm/ZONE_DEVICE/free_hot_cold_page: catch ZONE_DEVICE pages

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 06:20 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 01:48:26PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: >>> Catch page from ZONE_DEVICE in free_hot_cold_page(). This should never >>> happen as ZONE_DEVICE page m

Re: [HMM v13 06/18] mm/ZONE_DEVICE/unaddressable: add special swap for unaddressable

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 06:12 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 04:28:04PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: >>> To allow use of device un-addressable memory inside a process add a >>> special swap type. Also add a

Re: [HMM v13 05/18] mm/ZONE_DEVICE/devmem_pages_remove: allow early removal of device memory

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 06:09 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 04:07:46PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: >>> HMM wants to remove device memory early before device tear down so add an >>> helper to do that. >>

Re: [HMM v13 04/18] mm/ZONE_DEVICE/free-page: callback when page is freed

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 06:04 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 01:56:02PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: >>> When a ZONE_DEVICE page refcount reach 1 it means it is free and nobody >>> is holding a reference

Re: [HMM v13 02/18] mm/ZONE_DEVICE/unaddressable: add support for un-addressable device memory

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 06:03 PM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 01:36:57PM +0530, Anshuman Khandual wrote: >> On 11/18/2016 11:48 PM, Jérôme Glisse wrote: >>> This add support for un-addressable device memory. Such memory is hotpluged >>> only so we can have s

Re: [RFC 2/8] mm: Add specialized fallback zonelist for coherent device memory nodes

2016-11-16 Thread Anshuman Khandual
On 10/24/2016 10:01 AM, Anshuman Khandual wrote: > This change is part of the isolation requiring coherent device memory > node's implementation. > > Isolation seeking coherent memory node requires isolation from implicit > memory allocations from user space but at the same time th

[DRAFT 1/2] mm/cpuset: Exclude CDM nodes from each task's mems_allowed node mask

2016-11-16 Thread Anshuman Khandual
ace allocations. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- This completely isolates CDM nodes from user space allocations. Hence explicit allocation to the CDM nodes would not be possible any more. To again enable explicit allocation capability from user space, cpu

[DRAFT 2/2] mm/hugetlb: Restrict HugeTLB allocations only to the system RAM nodes

2016-11-16 Thread Anshuman Khandual
from HugeTLB allocation. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- This also completely isolates CDM nodes from user space HugeTLB allocations . Hence explicit allocation to the CDM nodes would not be possible any more . To again enable explicit HugeTLB allocation capa

Re: [HMM v13 05/18] mm/ZONE_DEVICE/devmem_pages_remove: allow early removal of device memory

2016-11-21 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > HMM wants to remove device memory early before device tear down so add an > helper to do that. Could you please explain why HMM wants to remove device memory before device tear down ?

Re: [HMM v13 06/18] mm/ZONE_DEVICE/unaddressable: add special swap for unaddressable

2016-11-21 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > To allow use of device un-addressable memory inside a process add a > special swap type. Also add a new callback to handle page fault on > such entry. IIUC this swap type is required only for the mirror cases and its not a requirement for migration.

Re: [HMM v13 06/18] mm/ZONE_DEVICE/unaddressable: add special swap for unaddressable

2016-11-21 Thread Anshuman Khandual
On 11/21/2016 07:36 AM, Balbir Singh wrote: > > > On 19/11/16 05:18, Jérôme Glisse wrote: >> To allow use of device un-addressable memory inside a process add a >> special swap type. Also add a new callback to handle page fault on >> such entry. >> >> Signed-off-by: Jérôme Glisse

Re: [HMM v13 01/18] mm/memory/hotplug: convert device parameter bool to set of flags

2016-11-20 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > Only usefull for arch where we support ZONE_DEVICE and where we want to A small nit s/usefull/useful/ > also support un-addressable device memory. We need struct page for such > un-addressable memory. But we should avoid populating the kernel linear

Re: [HMM v13 01/18] mm/memory/hotplug: convert device parameter bool to set of flags

2016-11-20 Thread Anshuman Khandual
On 11/21/2016 10:23 AM, Jerome Glisse wrote: > On Mon, Nov 21, 2016 at 11:44:36AM +1100, Balbir Singh wrote: >> >> >> On 19/11/16 05:18, Jérôme Glisse wrote: >>> Only usefull for arch where we support ZONE_DEVICE and where we want to >>> also support un-addressable device memory. We need struct

Re: [HMM v13 02/18] mm/ZONE_DEVICE/unaddressable: add support for un-addressable device memory

2016-11-21 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > This add support for un-addressable device memory. Such memory is hotpluged > only so we can have struct page but should never be map. This patch add code struct pages inside the system RAM range unlike the vmem_altmap scheme where the struct pages

Re: [HMM v13 03/18] mm/ZONE_DEVICE/free_hot_cold_page: catch ZONE_DEVICE pages

2016-11-21 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > Catch page from ZONE_DEVICE in free_hot_cold_page(). This should never > happen as ZONE_DEVICE page must always have an elevated refcount. > > This is to catch refcounting issues in a sane way for ZONE_DEVICE pages. > > Signed-off-by: Jérôme Glisse

Re: [HMM v13 04/18] mm/ZONE_DEVICE/free-page: callback when page is freed

2016-11-21 Thread Anshuman Khandual
On 11/18/2016 11:48 PM, Jérôme Glisse wrote: > When a ZONE_DEVICE page refcount reach 1 it means it is free and nobody > is holding a reference on it (only device to which the memory belong do). > Add a callback and call it when that happen so device driver can implement > their own free page

Re: [RFC 0/8] Define coherent device memory node

2016-10-27 Thread Anshuman Khandual
On 10/27/2016 08:35 PM, Jerome Glisse wrote: > On Thu, Oct 27, 2016 at 12:33:05PM +0530, Anshuman Khandual wrote: >> On 10/27/2016 10:08 AM, Anshuman Khandual wrote: >>> On 10/26/2016 09:32 PM, Jerome Glisse wrote: >>>> On Wed, Oct 26, 2016 at 04:43:10PM +0530, Anshum

Re: [RFC 0/8] Define coherent device memory node

2016-10-26 Thread Anshuman Khandual
j.gli...@gmail.com> writes: >>>>> On Mon, Oct 24, 2016 at 10:01:49AM +0530, Anshuman Khandual wrote: >>> >>> [...] >>> >>>>> You can take a look at hmm-v13 if you want to see how i do non LRU page >>>>> migration. Wh

Re: [RFC 0/8] Define coherent device memory node

2016-10-26 Thread Anshuman Khandual
j.gli...@gmail.com> writes: >>>>> On Mon, Oct 24, 2016 at 10:01:49AM +0530, Anshuman Khandual wrote: >>> >>> [...] >>> >>>>> You can take a look at hmm-v13 if you want to see how i do non LRU page >>>>> migration. Wh

MPOL_BIND on memory only nodes

2016-10-12 Thread Anshuman Khandual
Hi, We have the following function policy_zonelist() which selects a zonelist during various allocation paths. With this, general user space allocations (IIUC might not have __GFP_THISNODE) fails while trying to get memory from a memory only node without CPUs as the application runs some where

Re: MPOL_BIND on memory only nodes

2016-10-12 Thread Anshuman Khandual
On 10/12/2016 03:13 PM, Michal Hocko wrote: > On Wed 12-10-16 14:55:24, Anshuman Khandual wrote: >> Hi, >> >> We have the following function policy_zonelist() which selects a zonelist >> during various allocation paths. With this, general user space allocati

Re: [PATCH V4] mm: Add sysfs interface to dump each node's zonelist information

2016-10-13 Thread Anshuman Khandual
On 09/20/2016 06:24 AM, David Rientjes wrote: > On Sat, 17 Sep 2016, Anshuman Khandual wrote: > >>> > > I'm questioning if this information can be inferred from information >>> > > already in /proc/zoneinfo and sysfs. We know the no-fallback zonelist

Re: MPOL_BIND on memory only nodes

2016-10-13 Thread Anshuman Khandual
On 10/13/2016 03:37 PM, Michal Hocko wrote: > On Thu 13-10-16 15:24:54, Anshuman Khandual wrote: > [...] >> Which makes the function look like this. Even with these changes, MPOL_BIND >> is >> still going to pick up the local node's zonelist instead of the first no

Re: MPOL_BIND on memory only nodes

2016-10-13 Thread Anshuman Khandual
On 10/12/2016 06:46 PM, Michal Hocko wrote: > On Wed 12-10-16 11:43:37, Michal Hocko wrote: >> On Wed 12-10-16 14:55:24, Anshuman Khandual wrote: > [...] >>> Why we insist on __GFP_THISNODE ? >> >> AFAIU __GFP_THISNODE just overrides the given node to the polic

Re: [RFC 1/4] mm: Define coherent device memory node

2016-11-30 Thread Anshuman Khandual
On 11/29/2016 11:27 PM, Dave Hansen wrote: > On 11/22/2016 06:19 AM, Anshuman Khandual wrote: >> @@ -393,6 +393,9 @@ enum node_states { >> N_MEMORY = N_HIGH_MEMORY, >> #endif >> N_CPU, /* The node has one or more cpus */ >&g

Re: [RFC 4/4] mm: Ignore cpuset enforcement when allocation flag has __GFP_THISNODE

2016-11-30 Thread Anshuman Khandual
On 11/29/2016 10:22 PM, Dave Hansen wrote: > On 11/28/2016 10:51 PM, Anshuman Khandual wrote: >> On 11/29/2016 02:42 AM, Dave Hansen wrote: >>>> On 11/22/2016 06:19 AM, Anshuman Khandual wrote: >>>>>> --- a/mm/page_alloc.c >>>>>> +++ b

[RFC] nodemask: Consider MAX_NUMNODES inside node_isset

2017-01-03 Thread Anshuman Khandual
node_isset can give incorrect result if the node number is beyond the bitmask size (MAX_NUMNODES in this case) which is not checked inside test_bit. Hence check for the bit limits (MAX_NUMNODES) inside the node_isset function before calling test_bit. Signed-off-by: Anshuman Khandual <kh

Re: [RFC] nodemask: Consider MAX_NUMNODES inside node_isset

2017-01-03 Thread Anshuman Khandual
On 01/03/2017 02:14 PM, Michal Hocko wrote: > On Tue 03-01-17 13:57:53, Anshuman Khandual wrote: >> node_isset can give incorrect result if the node number is beyond the >> bitmask size (MAX_NUMNODES in this case) which is not checked inside >> test_bit. Hence che

Re: [RFC] nodemask: Consider MAX_NUMNODES inside node_isset

2017-01-03 Thread Anshuman Khandual
On 01/03/2017 02:47 PM, Michal Hocko wrote: > On Tue 03-01-17 14:37:09, Anshuman Khandual wrote: >> On 01/03/2017 02:14 PM, Michal Hocko wrote: >>> On Tue 03-01-17 13:57:53, Anshuman Khandual wrote: >>>> node_isset can give incorrect result if the node number i

Re: [HMM v14 05/16] mm/ZONE_DEVICE/unaddressable: add support for un-addressable device memory

2016-12-26 Thread Anshuman Khandual
On 12/09/2016 02:07 AM, Jerome Glisse wrote: >> On 12/08/2016 08:39 AM, Jerome Glisse wrote: > >> On 12/08/2016 08:39 AM, Jérôme Glisse wrote: >>> > >>> > > Architecture that wish to support un-addressable device >>> > >>> > > memory should >>> > >>> > > make >>> > >>> > >

[PATCH] mm/mmap: Replace SHM_HUGE_MASK with MAP_HUGE_MASK inside mmap_pgoff

2017-04-03 Thread Anshuman Khandual
ext. Hence change it back. Acked-by: Balbir Singh <bsinghar...@gmail.com> Acked-by: Michal Hocko <mho...@suse.com> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Posted this last year (https://patchwork.kernel.org/patch/8768891/) and then forgot to follow up. Sorry

Re: [PATCH 8/8] x86/mm: Allow to have userspace mappings above 47-bits

2017-04-07 Thread Anshuman Khandual
On 04/06/2017 07:31 PM, Kirill A. Shutemov wrote: > On x86, 5-level paging enables 56-bit userspace virtual address space. > Not all user space is ready to handle wide addresses. It's known that > at least some JIT compilers use higher bits in pointers to encode their > information. It collides

Re: [HMM 01/16] mm/memory/hotplug: add memory type parameter to arch_add/remove_memory

2017-04-06 Thread Anshuman Khandual
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c > index 5f84433..0933261 100644 > --- a/arch/powerpc/mm/mem.c > +++ b/arch/powerpc/mm/mem.c > @@ -126,14 +126,31 @@ int __weak remove_section_mapping(unsigned long start, > unsigned long end) > return -ENODEV; > } > > -int

[PATCH] mm/madvise: Clean up MADV_SOFT_OFFLINE and MADV_HWPOISON

2017-04-10 Thread Anshuman Khandual
0x3fff8637 Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/madvise.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index 7a2abf0..efd4721 100644 --- a/mm/madvise.c +++ b/mm/mad

[PATCH RESEND] mm/madvise: Clean up MADV_SOFT_OFFLINE and MADV_HWPOISON

2017-04-10 Thread Anshuman Khandual
0x10fd3 at process virtual address 0x3fff8635 Injecting memory failure for pfn 0x10fd4 at process virtual address 0x3fff8636 Injecting memory failure for pfn 0x10fd5 at process virtual address 0x3fff8637 Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Removed tim

[PATCH] mm/softoffline: Add page flag description in error paths

2017-04-08 Thread Anshuman Khandual
388018 After the patch: [ 87.694325] soft offline: 0x5900: migration failed 1, type 388018 (uptodate|dirty|head) [ 87.736273] soft offline: 0x6c00: migration failed 1, type 388018 (uptodate|dirty|head) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.

Re: [PATCH] mm: add VM_STATIC flag to vmalloc and prevent from removing the areas

2017-04-12 Thread Anshuman Khandual
On 04/12/2017 10:31 AM, Hoeun Ryu wrote: > vm_area_add_early/vm_area_register_early() are used to reserve vmalloc area > during boot process and those virtually mapped areas are never unmapped. > So `OR` VM_STATIC flag to the areas in vmalloc_init() when importing > existing vmlist entries and

Re: [RFC 1/6] mm, page_alloc: fix more premature OOM due to race with cpuset update

2017-04-12 Thread Anshuman Khandual
On 04/11/2017 07:36 PM, Vlastimil Babka wrote: > Commit e47483bca2cc ("mm, page_alloc: fix premature OOM when racing with > cpuset > mems update") has fixed known recent regressions found by LTP's cpuset01 > testcase. I have however found that by modifying the testcase to use per-vma >

Re: [PATCH v5 03/11] mm: thp: introduce separate TTU flag for thp freezing

2017-04-20 Thread Anshuman Khandual
On 04/21/2017 02:17 AM, Zi Yan wrote: > From: Naoya Horiguchi > > TTU_MIGRATION is used to convert pte into migration entry until thp split > completes. This behavior conflicts with thp migration added later patches, > so let's introduce a new TTU flag specifically for

Re: [PATCH v5 08/11] mm: hwpoison: soft offline supports thp migration

2017-04-21 Thread Anshuman Khandual
On 04/21/2017 02:17 AM, Zi Yan wrote: > From: Naoya Horiguchi > > This patch enables thp migration for soft offline. > > Signed-off-by: Naoya Horiguchi > > ChangeLog: v1 -> v5: > - fix page isolation counting error > > Signed-off-by: Zi

Re: [PATCH v5 09/11] mm: mempolicy: mbind and migrate_pages support thp migration

2017-04-21 Thread Anshuman Khandual
On 04/21/2017 02:17 AM, Zi Yan wrote: > From: Naoya Horiguchi > > This patch enables thp migration for mbind(2) and migrate_pages(2). > > Signed-off-by: Naoya Horiguchi > --- > ChangeLog v1 -> v2: > - support pte-mapped and doubly-mapped

Re: [PATCH v5 02/11] mm: mempolicy: add queue_pages_node_check()

2017-04-20 Thread Anshuman Khandual
debated and merged quickly and not hang on to the series if we have to respin again. Reviewed-by: Anshuman Khandual <khand...@linux.vnet.ibm.com>

Re: [PATCH v5 04/11] mm: thp: introduce CONFIG_ARCH_ENABLE_THP_MIGRATION

2017-04-20 Thread Anshuman Khandual
t;n-horigu...@ah.jp.nec.com> Aneesh's latest HugeTLB migration enablement on powerpc should make this work on powerpc platform as well. Will test it out in some time but for now enabling only on x86 where you have tested the series makes sense. Reviewed-by: Anshuman Khandual <khand...@linux.vnet.ibm.com>

Re: [PATCH v5 06/11] mm: thp: check pmd migration entry in common path

2017-04-21 Thread Anshuman Khandual
On 04/21/2017 02:17 AM, Zi Yan wrote: > From: Zi Yan > > If one of callers of page migration starts to handle thp, > memory management code start to see pmd migration entry, so we need > to prepare for it before enabling. This patch changes various code > point which

[PATCH] mm/madvise: Move up the behavior parameter validation

2017-04-13 Thread Anshuman Khandual
The madvise_behavior_valid() function should be called before acting upon the behavior parameter. Hence move up the function. This also includes MADV_SOFT_OFFLINE and MADV_HWPOISON options as valid behavior parameter for the system call madvise(). Signed-off-by: Anshuman Khandual <kh

[PATCH V2] mm/madvise: Move up the behavior parameter validation

2017-04-14 Thread Anshuman Khandual
The madvise_behavior_valid() function should be called before acting upon the behavior parameter. Hence move up the function. This also includes MADV_SOFT_OFFLINE and MADV_HWPOISON options as valid behavior parameter for the system call madvise(). Signed-off-by: Anshuman Khandual <kh

[PATCH] mm/madvise: Dont poison entire HugeTLB page for single page errors

2017-04-20 Thread Anshuman Khandual
small section of the entire page. This changes the behaviour so that only the affected page is marked poisoned and then the HugeTLB page is released back to buddy system. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- The number of poisoned pages on the system has r

Re: [RFC] mm/madvise: Enable (soft|hard) offline of HugeTLB pages at PGD level

2017-04-19 Thread Anshuman Khandual
On 04/19/2017 12:12 PM, Anshuman Khandual wrote: > On 04/19/2017 11:50 AM, Aneesh Kumar K.V wrote: >> Anshuman Khandual <khand...@linux.vnet.ibm.com> writes: >> >>> Though migrating gigantic HugeTLB pages does not sound much like real >>> world use case

Re: [RFC 07/11] mm: remove SWAP_AGAIN in ttu

2017-03-03 Thread Anshuman Khandual
On 03/02/2017 12:09 PM, Minchan Kim wrote: > In 2002, [1] introduced SWAP_AGAIN. > At that time, ttuo used spin_trylock(>page_table_lock) so it's Small nit: Please expand "ttuo" here. TTU in the first place is also not very clear but we have that in many places. > really easy to contend and fail

Re: [RFC 04/11] mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu

2017-03-02 Thread Anshuman Khandual
On 03/02/2017 12:09 PM, Minchan Kim wrote: > If the page is mapped and rescue in ttuo, page_mapcount(page) == 0 cannot Nit: "ttuo" is very cryptic. Please expand it. > be true so page_mapcount check in ttu is enough to return SWAP_SUCCESS. > IOW, SWAP_MLOCK check is redundant so remove it.

Re: [RFC 02/11] mm: remove unncessary ret in page_referenced

2017-03-02 Thread Anshuman Khandual
On 03/02/2017 12:09 PM, Minchan Kim wrote: > Anyone doesn't use ret variable. Remove it. > This change is correct. But not sure how this is related to try_to_unmap() clean up though. > Signed-off-by: Minchan Kim > --- > mm/rmap.c | 3 +-- > 1 file changed, 1 insertion(+),

Re: [patch] mm, zoneinfo: print non-populated zones

2017-03-03 Thread Anshuman Khandual
On 03/03/2017 04:56 AM, David Rientjes wrote: > Initscripts can use the information (protection levels) from > /proc/zoneinfo to configure vm.lowmem_reserve_ratio at boot. > > vm.lowmem_reserve_ratio is an array of ratios for each configured zone on > the system. If a zone is not populated on an

Re: [patch v2] mm, vmstat: print non-populated zones in zoneinfo

2017-03-04 Thread Anshuman Khandual
_zones_in_node() are unchanged. Files such as > /proc/pagetypeinfo require certain zone data to be initialized properly > for display, which is not done for unpopulated zones. > > Signed-off-by: David Rientjes <rient...@google.com> Reviewed-by: Anshuman Khandual <khand...@linux.vnet.ibm.com>

Re: [PATCH 3/6] mm/migrate: Add copy_pages_mthread function

2017-03-08 Thread Anshuman Khandual
> https://github.com/0day-ci/linux/commits/Anshuman-Khandual/Enable-parallel-page-migration/20170217-200523 > config: i386-tinyconfig (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: > # save the attached .config to linux build tree >

[PATCH 1/6] mm/migrate: Add new mode parameter to migrate_page_copy() function

2017-03-08 Thread Anshuman Khandual
. Only migrate_page_copy() and copy_huge_page() function's signatures are affected. Signed-off-by: Zi Yan <zi@cs.rutgers.edu> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- * Updated include/linux/migrate_mode.h comment as per Naoya fs/aio.c | 2

Re: [PATCH 0/6] Enable parallel page migration

2017-03-08 Thread Anshuman Khandual
On 02/17/2017 04:54 PM, Anshuman Khandual wrote: > This patch series is base on the work posted by Zi Yan back in > November 2016 (https://lkml.org/lkml/2016/11/22/457) but includes some > amount clean up and re-organization. This series depends on THP migration > optimization

[PATCH 3/6] mm/migrate: Add copy_pages_mthread function

2017-03-08 Thread Anshuman Khandual
s jobs to system_highpri_wq work queue. Signed-off-by: Zi Yan <zi@cs.rutgers.edu> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- * Updated cthread calculations, taking care of divide by zero issues, picking up the right single thread, defining NR_COPYTHREADS, fixing the build p

Re: [PATCH] mm,hugetlb: compute page_size_log properly

2017-03-08 Thread Anshuman Khandual
On 03/09/2017 01:09 AM, Andi Kleen wrote: >> One example of the problems with extra layers what this patch fixes: >> mmap_pgoff() should never be using SHM_HUGE_* logic. This was >> introduced by: >> >>091d0d55b28 (shm: fix null pointer deref when userspace specifies invalid >> hugepage size)

[PATCH 5/6] mm/migrate: Add new migration flag MPOL_MF_MOVE_MT for syscalls

2017-03-09 Thread Anshuman Khandual
From: Zi Yan <z...@nvidia.com> This change adds a new mode flag MPOL_MF_MOVE_MT for migration system calls like move_pages() and mbind() which indicates request for using the multi threaded copy method. Signed-off-by: Zi Yan <zi@cs.rutgers.edu> Signed-off-by: Anshuman Kha

Re: [PATCH 1/2] mm: Change generic FALLBACK zonelist creation process

2017-03-14 Thread Anshuman Khandual
On 03/08/2017 04:37 PM, John Hubbard wrote: > On 03/08/2017 01:21 AM, Anshuman Khandual wrote: >> Kernel allocation to CDM node has already been prevented by putting it's >> entire memory in ZONE_MOVABLE. But the CDM nodes must also be isolated >> from implicit allocations ha

Re: [kbuild-all] [PATCH 6/6] sysctl: Add global tunable mt_page_copy

2017-03-10 Thread Anshuman Khandual
On 03/10/2017 06:42 AM, Ye Xiaolong wrote: > On 03/08, Anshuman Khandual wrote: >> On 02/17/2017 09:00 PM, kbuild test robot wrote: >>> Hi Zi, >>> >>> [auto build test ERROR on linus/master] >>> [also build test ERROR on v4.10-rc8 next-20170217] >&g

Re: [PATCH V3 0/4] Define coherent device memory node

2017-03-08 Thread Anshuman Khandual
On 03/01/2017 04:29 PM, Balbir Singh wrote: > On Wed, Mar 1, 2017 at 8:55 PM, Mel Gorman wrote: >> On Wed, Mar 01, 2017 at 01:42:40PM +1100, Balbir Singh wrote: >> The idea of this patchset was to introduce >> the concept of memory that is not necessarily system memory,

[PATCH 1/2] mm: Change generic FALLBACK zonelist creation process

2017-03-08 Thread Anshuman Khandual
) (node 4) (Movable 0xc143aa80) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/page_alloc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 40908de..6f7dddc 100644 --- a/mm/page_alloc.c +++ b/mm/page_a

Re: [PATCH 6/6] sysctl: Add global tunable mt_page_copy

2017-03-08 Thread Anshuman Khandual
> https://github.com/0day-ci/linux/commits/Anshuman-Khandual/Enable-parallel-page-migration/20170217-200523 > config: i386-randconfig-a0-02131010 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 Though I dont have the same compiler, I am unable to reproduce this

[PATCH 2/2] mm: Change mbind(MPOL_BIND) implementation for CDM nodes

2017-03-08 Thread Anshuman Khandual
does not have any CPU. Hence MPOL_MBIND implementation must choose given CDM node's FALLBACK zonelist instead of the requesting local node's FALLBACK zonelist. This implements that change. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/mempolicy.

Re: [RFC 05/11] mm: make the try_to_munlock void function

2017-03-06 Thread Anshuman Khandual
On 03/06/2017 07:39 AM, Minchan Kim wrote: > On Fri, Mar 03, 2017 at 05:13:54PM +0530, Anshuman Khandual wrote: >> On 03/02/2017 12:09 PM, Minchan Kim wrote: >>> try_to_munlock returns SWAP_MLOCK if the one of VMAs mapped >>> the page has VM_LOCKED flag. In t

Re: [RFC 05/11] mm: make the try_to_munlock void function

2017-03-07 Thread Anshuman Khandual
On 03/07/2017 12:20 PM, Minchan Kim wrote: > Hi Anshuman, > > On Mon, Mar 06, 2017 at 03:10:17PM +0530, Anshuman Khandual wrote: >> On 03/06/2017 07:39 AM, Minchan Kim wrote: >>> On Fri, Mar 03, 2017 at 05:13:54PM +0530, Anshuman Khandual wrote: >>>> On 03

Re: [PATCH] mm: Do not use double negation for testing page flags

2017-03-07 Thread Anshuman Khandual
On 03/07/2017 12:06 PM, Minchan Kim wrote: > With the discussion[1], I found it seems there are every PageFlags > functions return bool at this moment so we don't need double > negation any more. > Although it's not a problem to keep it, it makes future users > confused to use dobule negation for

Re: [PATCH V3 0/4] Define coherent device memory node

2017-03-05 Thread Anshuman Khandual
On 02/23/2017 12:22 PM, Anshuman Khandual wrote: > On 02/22/2017 03:20 PM, Michal Hocko wrote: >> On Tue 21-02-17 19:09:18, Anshuman Khandual wrote: >>> On 02/21/2017 04:41 PM, Michal Hocko wrote: >>>> On Fri 17-02-17 17:11:57, Anshuman Khandual wrote: >>>

Re: [PATCH V3 0/4] Define coherent device memory node

2017-03-05 Thread Anshuman Khandual
On 02/23/2017 09:27 PM, Mel Gorman wrote: > On Tue, Feb 21, 2017 at 06:39:17PM +0530, Anshuman Khandual wrote: >>>>> In itself, the series does very little and as Vlastimil already pointed >>>>> out, it's not a good idea to try merge piecemeal when people could n

Re: [PATCH V3 0/4] Define coherent device memory node

2017-03-05 Thread Anshuman Khandual
On 02/22/2017 10:24 PM, Michal Hocko wrote: > On Wed 22-02-17 09:59:15, Jerome Glisse wrote: >> On Wed, Feb 22, 2017 at 10:29:21AM +0100, Michal Hocko wrote: >>> On Tue 21-02-17 18:39:17, Anshuman Khandual wrote: >>>> On 02/17/2

Re: [RFC 01/11] mm: use SWAP_SUCCESS instead of 0

2017-03-06 Thread Anshuman Khandual
On 03/03/2017 08:31 AM, Minchan Kim wrote: > On Thu, Mar 02, 2017 at 07:57:10PM +0530, Anshuman Khandual wrote: >> On 03/02/2017 12:09 PM, Minchan Kim wrote: >>> SWAP_SUCCESS defined value 0 can be changed always so don't rely on >>> it. Instead, use explict macro. >

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