Re: [PATCH V3 1/4] mm: Define coherent device memory (CDM) node

2017-02-21 Thread Anshuman Khandual
On 02/17/2017 07:35 PM, Bob Liu wrote: > Hi Anshuman, > > I have a few questions about coherent device memory. Sure. > > On Wed, Feb 15, 2017 at 8:07 PM, Anshuman Khandual > <khand...@linux.vnet.ibm.com> wrote: >> There are certain devices like specialized a

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

2017-02-21 Thread Anshuman Khandual
On 02/17/2017 07:02 PM, Mel Gorman wrote: > On Fri, Feb 17, 2017 at 05:11:57PM +0530, Anshuman Khandual wrote: >> On 02/15/2017 11:50 PM, Mel Gorman wrote: >>> On Wed, Feb 15, 2017 at 05:37:22PM +0530, Anshuman Khandual wrote: >>>>This four patches define

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

2017-02-21 Thread Anshuman Khandual
On 02/22/2017 10:34 AM, Balbir Singh wrote: > On Fri, Feb 17, 2017 at 04:54:47PM +0530, 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 u

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

2017-02-21 Thread Anshuman Khandual
On 02/21/2017 04:41 PM, Michal Hocko wrote: > On Fri 17-02-17 17:11:57, Anshuman Khandual wrote: > [...] >> * User space using mbind() to get CDM memory is an additional benefit >> we get by making the CDM plug in as a node and be part of the buddy >> allocator. Bu

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

2017-02-23 Thread Anshuman Khandual
On 02/22/2017 01:44 AM, Jerome Glisse wrote: > On Tue, Feb 21, 2017 at 06:39:17PM +0530, Anshuman Khandual wrote: >> On 02/17/2017 07:02 PM, Mel Gorman wrote: >>> On Fri, Feb 17, 2017 at 05:11:57PM +0530, Anshuman Khandual wrote: >>>> On 02/15/2017 11:50 PM, Mel Gorm

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

2017-02-22 Thread Anshuman Khandual
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: >>> [...] >>>> * User space using mbind() to get CDM memory

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

2017-02-23 Thread Anshuman Khandual
On 02/22/2017 02:59 PM, Michal Hocko wrote: > On Tue 21-02-17 18:39:17, Anshuman Khandual wrote: >> On 02/17/2017 07:02 PM, Mel Gorman wrote: > [...] >>> Why can this not be expressed with cpusets and memory policies >>> controlled by a combination of adminis

Re: [PATCH V2 0/3] Define coherent device memory node

2017-02-13 Thread Anshuman Khandual
On 02/13/2017 09:04 PM, Vlastimil Babka wrote: > On 02/10/2017 11:06 AM, Anshuman Khandual wrote: >> This three patches define CDM node with HugeTLB & Buddy allocation >> isolation. Please refer to the last RFC posting mentioned here for details. >> The series has bee

Re: [PATCH V2 1/3] mm: Define coherent device memory (CDM) node

2017-02-14 Thread Anshuman Khandual
On 02/13/2017 09:29 AM, John Hubbard wrote: > On 02/10/2017 02:06 AM, Anshuman Khandual wrote: >> There are certain devices like specialized accelerator, GPU cards, >> network >> cards, FPGA cards etc which might contain onboard memory which is >> coherent >> a

Re: [PATCH V2 3/3] mm: Enable Buddy allocation isolation for CDM nodes

2017-02-14 Thread Anshuman Khandual
On 02/14/2017 01:58 PM, Vlastimil Babka wrote: > On 02/10/2017 11:06 AM, Anshuman Khandual wrote: >> This implements allocation isolation for CDM nodes in buddy allocator by >> discarding CDM memory zones all the time except in the cases where the gfp >> flag has got __GFP_THI

Re: [PATCH 1/3] mm: Define coherent device memory (CDM) node

2017-02-09 Thread Anshuman Khandual
On 02/08/2017 07:31 PM, Anshuman Khandual wrote: > 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

Re: [PATCH V2 3/3] mm: Enable Buddy allocation isolation for CDM nodes

2017-02-14 Thread Anshuman Khandual
On 02/14/2017 03:44 PM, Anshuman Khandual wrote: > On 02/14/2017 01:58 PM, Vlastimil Babka wrote: >> On 02/10/2017 11:06 AM, Anshuman Khandual wrote: >>> This implements allocation isolation for CDM nodes in buddy allocator by >>> discarding CDM memory zones all the tim

[PATCH V3 4/4] mm: Enable Buddy allocation isolation for CDM nodes

2017-02-15 Thread Anshuman Khandual
process MPOL_BIND policy based requests). Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/page_alloc.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index afbd24d..40c942c 100644 --- a/mm/page_alloc.c ++

[PATCH V3 2/4] mm: Enable HugeTLB allocation isolation for CDM nodes

2017-02-15 Thread Anshuman Khandual
instead 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 | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/mm/hugetlb.

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

2017-02-15 Thread Anshuman Khandual
_cdm() functions and removed bunch of #ifdefs * Moved CDM helper functions into nodemask.h from node.h header file * Fixed the build failure by additional CONFIG_NEED_MULTIPLE_NODES check Previous V1:(https://lkml.org/lkml/2017/2/8/329) Anshuman Khandual (4): mm: Define coherent device memory

[PATCH V3 1/4] mm: Define coherent device memory (CDM) node

2017-02-15 Thread Anshuman Khandual
coherent device memory node in case they enable CONFIG_COHERENT_DEVICE. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Documentation/ABI/stable/sysfs-devices-node | 7 arch/powerpc/Kconfig| 1 + arch/powerpc/mm/numa.c

[PATCH V3 3/4] mm: Add new parameter to get_page_from_freelist() function

2017-02-15 Thread Anshuman Khandual
zone during allocation which is implemented in the subsequent patch. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/page_alloc.c | 50 ++ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/mm/page_alloc.

Re: [PATCH 3/3] mm: Enable Buddy allocation isolation for CDM nodes

2017-02-09 Thread Anshuman Khandual
On 02/09/2017 02:18 PM, Vlastimil Babka wrote: > On 02/09/2017 06:05 AM, Anshuman Khandual wrote: >> On 02/08/2017 10:48 PM, Vlastimil Babka wrote: >>> On 02/08/2017 03:01 PM, Anshuman Khandual wrote: >>>> This implements allocation isolation for CDM

[PATCH V2 1/3] mm: Define coherent device memory (CDM) node

2017-02-10 Thread Anshuman Khandual
coherent device memory node in case they enable CONFIG_COHERENT_DEVICE. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Documentation/ABI/stable/sysfs-devices-node | 7 arch/powerpc/Kconfig| 1 + arch/powerpc/mm/numa.c

[PATCH V2 3/3] mm: Enable Buddy allocation isolation for CDM nodes

2017-02-10 Thread Anshuman Khandual
process MPOL_BIND policy based requests). Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/page_alloc.c | 16 1 file changed, 16 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 84d61bb..392c24a 100644 --- a/mm/page_alloc.c +++ b/mm/page_a

[PATCH V2 2/3] mm: Enable HugeTLB allocation isolation for CDM nodes

2017-02-10 Thread Anshuman Khandual
instead 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 | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/mm/hugetlb.

[PATCH V2 0/3] Define coherent device memory node

2017-02-10 Thread Anshuman Khandual
ions into nodemask.h from node.h header file * Fixed the build failure by additional CONFIG_NEED_MULTIPLE_NODES check Previous V1: (https://lkml.org/lkml/2017/2/8/329) Anshuman Khandual (3): mm: Define coherent device memory (CDM) node mm: Enable HugeTLB allocation isolation for CDM nodes mm: Enable B

Re: [PATCH] mm/page_alloc: remove redundant init code for ZONE_MOVABLE

2017-02-09 Thread Anshuman Khandual
On 02/09/2017 07:47 PM, Wei Yang wrote: > arch_zone_lowest/highest_possible_pfn[] is set to 0 and [ZONE_MOVABLE] is > skipped in the loop. No need to reset them to 0 again. > > This patch just removes the redundant code. Yeah, sounds pretty straight forward.

[PATCH 0/6] Enable parallel page migration

2017-02-17 Thread Anshuman Khandual
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 series posted by Naoya Horiguchi on 8th November 2016

[PATCH 2/6] mm/migrate: Make migrate_mode types non-exclusive

2017-02-17 Thread Anshuman Khandual
From: Zi Yan <z...@nvidia.com> It basically changes the enum declaration from numbers to bit positions so that they can be used in combination which was not the case earlier. No functionality has been changed. Signed-off-by: Zi Yan <zi@cs.rutgers.edu> Signed-off-by: Anshuman Kha

[PATCH 4/6] mm/migrate: Add new migrate mode MIGRATE_MT

2017-02-17 Thread Anshuman Khandual
hanism instead the previous multi threaded attempt fails. It also attempts multi threaded copy for regular pages. Signed-off-by: Zi Yan <zi@cs.rutgers.edu> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/migrate_mode.h | 1 + mm/migrate.c

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

2017-02-17 Thread Anshuman Khandual
; Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- kernel/sysctl.c | 10 ++ mm/migrate.c| 14 ++ 2 files changed, 24 insertions(+) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 1aea594..e5f7ca9 100644 --- a/kernel/sysctl.c +++ b/kernel/sysct

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

2017-02-17 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

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

2017-02-17 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> --- include/linux/highmem.h | 2 ++ mm/Makefile | 2 ++ mm/copy_pages_mthread.c | 87 + 3

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

2017-02-17 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> --- fs/aio.c | 2 +- fs/f2fs/data.c | 2 +- fs/hugetlbfs/inode.c

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

2017-02-17 Thread Anshuman Khandual
On 02/15/2017 11:50 PM, Mel Gorman wrote: > On Wed, Feb 15, 2017 at 05:37:22PM +0530, Anshuman Khandual wrote: >> This four patches define CDM node with HugeTLB & Buddy allocation >> isolation. Please refer to the last RFC posting mentioned here for more > > Alwa

Re: [PATCH] mm, page_alloc: don't check cpuset allowed twice in fast-path

2017-01-16 Thread Anshuman Khandual
-off-by: Vlastimil Babka <vba...@suse.cz> > > Acked-by: Michal Hocko <mho...@suse.com> Reviewed-by: Anshuman Khandual <khand...@linux.vnet.ibm.com>

Re: mm allocation failure and hang when running xfstests generic/269 on xfs

2017-03-01 Thread Anshuman Khandual
On 03/02/2017 10:49 AM, Xiong Zhou wrote: > On Wed, Mar 01, 2017 at 04:37:31PM -0800, Christoph Hellwig wrote: >> On Wed, Mar 01, 2017 at 12:46:34PM +0800, Xiong Zhou wrote: >>> Hi, >>> >>> It's reproduciable, not everytime though. Ext4 works fine. >> On ext4 fsstress won't run bulkstat because it

Re: [RFC 00/11] make try_to_unmap simple

2017-03-02 Thread Anshuman Khandual
On 03/02/2017 12:09 PM, Minchan Kim wrote: > Currently, try_to_unmap returns various return value(SWAP_SUCCESS, > SWAP_FAIL, SWAP_AGAIN, SWAP_DIRTY and SWAP_MLOCK). When I look into > that, it's unncessary complicated so this patch aims for cleaning > it up. Change ttu to boolean function so we

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

2017-03-02 Thread Anshuman Khandual
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. Right. But should not we move the changes to the callers last in the patch series after doing the cleanup to the try_to_unmap() function as intended

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

2017-02-26 Thread Anshuman Khandual
On 02/27/2017 07:26 AM, Bob Liu wrote: > On 2017/2/24 12:53, Jerome Glisse wrote: >> On Fri, Feb 24, 2017 at 09:06:19AM +0800, Bob Liu wrote: >>> On 2017/2/21 21:39, Anshuman Khandual wrote: >>>> On 02/21/2017 04:41 PM, Michal Hocko wrote: >>>>> On F

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

2016-09-06 Thread Anshuman Khandual
st to use git(>=2.9.0) format-patch --base= (or --base=auto for > convenience) to record what (public, well-known) commit your patch series was > built on] > [Check https://git-scm.com/docs/git-format-patch for more information] > > url: > https://github.com/0day-ci

[PATCH V2 2/2] mm: Add sysfs interface to dump each node's zonelist information

2016-09-05 Thread Anshuman Khandual
) (3) (node 2) (zone DMA c002) ZONELIST_NOFALLBACK (0) (node 3) (zone DMA c003) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Changes in V2: - Added more details into the commit message - Added sysfs interface file details into the

[PATCH V2 1/2] mm: Export definition of 'zone_names' array through mmzone.h

2016-09-05 Thread Anshuman Khandual
zone_names[] is used to identify any zone given it's index which can be used in many other places. So exporting the definition through include/linux/mmzone.h header for it's broader access. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Changes in V2: - Removed the

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

2016-09-06 Thread Anshuman Khandual
) (3) (node 2) (zone DMA c002) ZONELIST_NOFALLBACK (0) (node 3) (zone DMA c003) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Changes in V3: - Moved all these new sysfs code inside CONFIG_NUMA Changes in V2: - Added more d

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

2016-09-06 Thread Anshuman Khandual
On 09/07/2016 08:38 AM, Kees Cook wrote: > On Tue, Sep 6, 2016 at 1:36 PM, Dave Hansen <dave.han...@intel.com> wrote: >> On 09/06/2016 01:31 AM, Anshuman Khandual wrote: >>> [NODE (0)] >>> ZONELIST_FALLBACK >>> (0) (node 0) (zone DMA c0

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

2016-09-01 Thread Anshuman Khandual
On 09/01/2016 02:42 AM, Andrew Morton wrote: > On Wed, 31 Aug 2016 08:55:50 +0530 Anshuman Khandual > <khand...@linux.vnet.ibm.com> wrote: > >> Each individual node in the system has a ZONELIST_FALLBACK zonelist >> and a ZONELIST_NOFALLBACK zonelist. These zonelis

Re: [PATCH 1/2] mm: Move definition of 'zone_names' array into mmzone.h

2016-09-01 Thread Anshuman Khandual
On 09/01/2016 02:40 AM, Andrew Morton wrote: > On Wed, 31 Aug 2016 08:55:49 +0530 Anshuman Khandual > <khand...@linux.vnet.ibm.com> wrote: > >> zone_names[] is used to identify any zone given it's index which >> can be used in many other places. So moving the defin

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

2016-09-07 Thread Anshuman Khandual
system] > [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for > convenience) to record what (public, well-known) commit your patch series was > built on] > [Check https://git-scm.com/docs/git-format-patch for more information] > > url: > https://github.c

Re: [PATCH -v3 01/10] mm, swap: Make swap cluster size same of THP size on x86_64

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > In this patch, the size of the swap cluster is changed to that of the > THP (Transparent Huge Page) on x86_64 architecture (512). This is for > the THP swap support on x86_64. Where one swap cluster will be

Re: [PATCH -v3 04/10] mm, THP, swap: Add swap cluster allocate/free functions

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > The swap cluster allocation/free functions are added based on the > existing swap cluster management mechanism for SSD. These functions > don't work for the rotating hard disks because the existing swap

Re: [PATCH -v3 01/10] mm, swap: Make swap cluster size same of THP size on x86_64

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > In this patch, the size of the swap cluster is changed to that of the > THP (Transparent Huge Page) on x86_64 architecture (512). This is for > the THP swap support on x86_64. Where one swap cluster will be

Re: [PATCH -v3 03/10] mm, memcg: Support to charge/uncharge multiple swap entries

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > This patch make it possible to charge or uncharge a set of continuous > swap entries in the swap cgroup. The number of swap entries is > specified via an added parameter. > > This will be used for the THP

Re: [PATCH -v3 07/10] mm, THP, swap: Support to add/delete THP to/from swap cache

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > With this patch, a THP (Transparent Huge Page) can be added/deleted > to/from the swap cache as a set of sub-pages (512 on x86_64). > > This will be used for the THP (Transparent Huge Page) swap support. >

Re: [PATCH -v3 03/10] mm, memcg: Support to charge/uncharge multiple swap entries

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > This patch make it possible to charge or uncharge a set of continuous > swap entries in the swap cgroup. The number of swap entries is > specified via an added parameter. > > This will be used for the THP

Re: [PATCH -v3 04/10] mm, THP, swap: Add swap cluster allocate/free functions

2016-09-08 Thread Anshuman Khandual
On 09/07/2016 10:16 PM, Huang, Ying wrote: > From: Huang Ying > > The swap cluster allocation/free functions are added based on the > existing swap cluster management mechanism for SSD. These functions > don't work for the rotating hard disks because the existing swap

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

2016-09-07 Thread Anshuman Khandual
) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Changes in V4: - Explicitly included mmzone.h header inside page_alloc.c - Changed the kernel address printing from %lx to %pK Changes in V3: - Moved all these new sysfs code inside CONFIG_NUMA Changes in V2: - Added more d

Re: [PATCH] thp: reduce usage of huge zero page's atomic counter

2016-08-29 Thread Anshuman Khandual
On 08/30/2016 04:20 AM, Andrew Morton wrote: > On Mon, 29 Aug 2016 14:31:20 +0800 Aaron Lu wrote: > >> > >> > The global zero page is used to satisfy an anonymous read fault. If >> > THP(Transparent HugePage) is enabled then the global huge zero page is >> > used. >> > The

Re: [PATCH] thp: reduce usage of huge zero page's atomic counter

2016-08-30 Thread Anshuman Khandual
On 08/30/2016 11:24 AM, Aaron Lu wrote: > On 08/30/2016 12:44 PM, Anshuman Khandual wrote: >> > On 08/30/2016 09:09 AM, Andrew Morton wrote: >>> >> On Tue, 30 Aug 2016 11:09:15 +0800 Aaron Lu <aaron...@intel.com> wrote: >>> >> >>>>>&

Re: [PATCH] thp: reduce usage of huge zero page's atomic counter

2016-08-29 Thread Anshuman Khandual
On 08/30/2016 09:09 AM, Andrew Morton wrote: > On Tue, 30 Aug 2016 11:09:15 +0800 Aaron Lu wrote: > Case used for test on Haswell EP: usemem -n 72 --readonly -j 0x20 100G Which spawns 72 processes and each will mmap 100G anonymous space and then do

[PATCH 1/2] mm: Move definition of 'zone_names' array into mmzone.h

2016-08-30 Thread Anshuman Khandual
zone_names[] is used to identify any zone given it's index which can be used in many other places. So moving the definition into include/linux/mmzone.h for broader access. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mmzone.h | 17 +++

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

2016-08-30 Thread Anshuman Khandual
) (3) (node 2) (zone DMA c002) ZONELIST_NOFALLBACK (0) (node 3) (zone DMA c003) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- drivers/base/memory.c | 46 ++ 1 file changed, 46 inse

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

2016-09-11 Thread Anshuman Khandual
On 09/09/2016 07:06 PM, Michal Hocko wrote: > On Thu 08-09-16 08:16:58, Anshuman Khandual wrote: >> > Each individual node in the system has a ZONELIST_FALLBACK zonelist >> > and a ZONELIST_NOFALLBACK zonelist. These zonelists decide fallback >> > order of z

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

2016-09-11 Thread Anshuman Khandual
On 09/09/2016 01:54 AM, Dave Hansen wrote: > On 09/07/2016 07:46 PM, Anshuman Khandual wrote: >> > after memory or node hot[un]plug is desirable. This change adds one >> > new sysfs interface (/sys/devices/system/memory/system_zone_details) >> > which will f

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

2016-09-16 Thread Anshuman Khandual
On 09/12/2016 11:43 PM, David Rientjes wrote: > On Mon, 12 Sep 2016, Anshuman Khandual wrote: > >>>>> after memory or node hot[un]plug is desirable. This change adds one >>>>> new sysfs interface (/sys/devices/system/memory/system_zone_details) >>>

Re: [PATCH 5/5] mm: cleanup pfn_t usage in track_pfn_insert()

2016-09-06 Thread Anshuman Khandual
On 09/06/2016 10:19 PM, Dan Williams wrote: > Now that track_pfn_insert() is no longer used in the DAX path, it no > longer needs to comprehend pfn_t values. > > Signed-off-by: Dan Williams > --- > arch/x86/mm/pat.c |4 ++-- >

Re: [PATCH] thp: reduce usage of huge zero page's atomic counter

2016-08-29 Thread Anshuman Khandual
On 08/29/2016 12:01 PM, Aaron Lu wrote: > The global zero page is used to satisfy an anonymous read fault. If > THP(Transparent HugePage) is enabled then the global huge zero page is used. > The global huge zero page uses an atomic counter for reference counting > and is allocated/freed

Re: [PATCH] mm: Use zonelist name instead of using hardcoded index

2016-08-28 Thread Anshuman Khandual
makes sense to replace those hard coded indices. > > Signed-off-by: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com> Reviewed-by: Anshuman Khandual <khand...@linux.vnet.ibm.com>

Re: [PATCH] thp: reduce usage of huge zero page's atomic counter

2016-08-29 Thread Anshuman Khandual
On 08/29/2016 02:23 PM, Aaron Lu wrote: > On 08/29/2016 04:49 PM, Anshuman Khandual wrote: >> > On 08/29/2016 12:01 PM, Aaron Lu wrote: >>> >> The global zero page is used to satisfy an anonymous read fault. If >>> >> THP(Transparent HugePage)

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

2016-10-27 Thread Anshuman Khandual
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, Anshuman Khandual wrote: >>> On 10/26/2016 12:22 AM, Jerome Glisse wrote: >>>> On Tue, Oct 25, 2016 at 11:01:08PM +0530, Aneesh

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

2016-10-26 Thread Anshuman Khandual
On 10/26/2016 09:32 PM, Jerome Glisse wrote: > On Wed, Oct 26, 2016 at 04:43:10PM +0530, Anshuman Khandual wrote: >> On 10/26/2016 12:22 AM, Jerome Glisse wrote: >>> On Tue, Oct 25, 2016 at 11:01:08PM +0530, Aneesh Kumar K.V wrote: >>>> Jerome Glisse <j.gli...@gma

Re: [RFC 8/8] mm: Add N_COHERENT_DEVICE node type into node_states[]

2016-10-25 Thread Anshuman Khandual
On 10/25/2016 12:52 PM, Balbir Singh wrote: > > > On 24/10/16 15:31, Anshuman Khandual wrote: >> Add a new member N_COHERENT_DEVICE into node_states[] nodemask array to >> enlist all those nodes which contain only coherent device memory. Also >> creates a new sysfs in

Re: [PATCH v2 00/12] mm: page migration enhancement for thp

2016-11-09 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > Hi everyone, > > I've updated thp migration patches for v4.9-rc2-mmotm-2016-10-27-18-27 > with feedbacks for ver.1. > > General description (no change since ver.1) > === > > This patchset enhances page

Re: [RFC][PATCH] mm: merge as soon as possible when pcp alloc/free

2016-11-06 Thread Anshuman Khandual
On 11/07/2016 07:18 AM, Xishi Qiu wrote: > On 2016/11/5 20:29, Anshuman Khandual wrote: > >> On 11/05/2016 01:27 PM, Xishi Qiu wrote: >>> Usually the memory of android phones is very small, so after a long >>> running, the fragment is very la

Re: [PATCH v2 05/12] mm: thp: add core routines for thp/pmd migration

2016-11-08 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > This patch prepares thp migration's core code. These code will be open when > unmap_and_move() stops unconditionally splitting thp and get_new_page() starts > to allocate destination thps. > > Signed-off-by: Naoya Horiguchi

Re: [PATCH] mm: add ZONE_DEVICE statistics to smaps

2016-11-10 Thread Anshuman Khandual
On 11/11/2016 03:41 AM, Dan Williams wrote: > ZONE_DEVICE pages are mapped into a process via the filesystem-dax and > device-dax mechanisms. There are also proposals to use ZONE_DEVICE > pages for other usages outside of dax. Add statistics to smaps so > applications can debug that they are

Re: [PATCH v2 03/12] mm: thp: introduce separate TTU flag for thp freezing

2016-11-10 Thread Anshuman Khandual
On 11/10/2016 02:39 PM, Naoya Horiguchi wrote: > On Thu, Nov 10, 2016 at 02:01:56PM +0530, Anshuman Khandual wrote: >> > On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: >>> > > TTU_MIGRATION is used to convert pte into migration entry until thp >>> > &

Re: [PATCH v2 00/12] mm: page migration enhancement for thp

2016-11-10 Thread Anshuman Khandual
On 11/10/2016 07:31 PM, Zi Yan wrote: > On 9 Nov 2016, at 18:52, Naoya Horiguchi wrote: > >> Hi Anshuman, >> >> On Wed, Nov 09, 2016 at 04:03:04PM +0530, Anshuman Khandual wrote: >>> On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: >>>> Hi everyone,

Re: [PATCH v2 05/12] mm: thp: add core routines for thp/pmd migration

2016-11-10 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > This patch prepares thp migration's core code. These code will be open when > unmap_and_move() stops unconditionally splitting thp and get_new_page() starts > to allocate destination thps. > Snip > Signed-off-by: Naoya Horiguchi

Re: [PATCH v2 03/12] mm: thp: introduce separate TTU flag for thp freezing

2016-11-10 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > TTU_MIGRATION is used to convert pte into migration entry until thp split > completes. This behavior conflicts with thp migration added later patches, Hmm, could you please explain why it conflicts with the PMD based migration without split ? Why

Re: [PATCH v2 07/12] mm: thp: check pmd migration entry in common path

2016-11-10 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > 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 checks the status of given pmds in

Re: [PATCH v2 08/12] mm: soft-dirty: keep soft-dirty bits over thp migration

2016-11-10 Thread Anshuman Khandual
On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: > Soft dirty bit is designed to keep tracked over page migration. This patch Small nit here. s/tracked/track/

Re: [RFC][PATCH] mm: merge as soon as possible when pcp alloc/free

2016-11-05 Thread Anshuman Khandual
On 11/05/2016 01:27 PM, Xishi Qiu wrote: > Usually the memory of android phones is very small, so after a long > running, the fragment is very large. Kernel stack which called by > alloc_thread_stack_node() usually alloc 16K memory, and it failed > frequently. > > However we have

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

2016-11-04 Thread Anshuman Khandual
On 10/25/2016 09:56 AM, Aneesh Kumar K.V wrote: > I looked at the hmm-v13 w.r.t migration and I guess some form of device > callback/acceleration during migration is something we should definitely > have. I still haven't figured out how non addressable and coherent device > memory can fit together

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

2016-10-23 Thread Anshuman Khandual
) (0) (node 4) (Movable 0xc143aa80) (1) (node 0) (DMA 0xc140c000) (2) (node 1) (DMA 0xc001) ZONELIST_NOFALLBACK (0xc143f110) (0) (node 4) (Movable 0xc143aa80) Signed-off-by: Anshuman

[RFC 5/8] mm: Add new flag VM_CDM for coherent device memory

2016-10-23 Thread Anshuman Khandual
VMAs containing coherent device memory should be marked with VM_CDM. These VMAs need to be identified in various core kernel paths and this new flag will help in this regard. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mm.h | 5 + mm/mempolicy.c

[RFC 6/8] mm: Make VM_CDM marked VMAs non migratable

2016-10-23 Thread Anshuman Khandual
Auto NUMA does migratability check on any given VMA before scanning it for marking purpose. For now if the coherent device memory has been faulted in or migrated into a process VMA, it should not be part of the auto NUMA migration scheme. The check is based on VM_CDM flag. Signed-off-by: Anshuman

[RFC 3/8] mm: Isolate coherent device memory nodes from HugeTLB allocation paths

2016-10-23 Thread Anshuman Khandual
pool allocations. This modifies relevant functions to skip all coherent memory nodes present on the system during allocation, freeing and auditing for HugeTLB pages. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/hugetlb.c | 38 --

[RFC 8/8] mm: Add N_COHERENT_DEVICE node type into node_states[]

2016-10-23 Thread Anshuman Khandual
-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- Documentation/ABI/stable/sysfs-devices-node | 7 +++ drivers/base/node.c | 6 ++ include/linux/nodemask.h| 3 +++ mm/memory_hotplug.c | 10 ++ 4 files chang

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

2016-10-23 Thread Anshuman Khandual
types of coherent devices in future. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mmzone.h | 29 + mm/Kconfig | 13 + 2 files changed, 42 insertions(+) diff --git a/include/linux/mmzone.h b/include/linux/mm

[RFC 0/8] Define coherent device memory node

2016-10-23 Thread Anshuman Khandual
With hot pluggable CMA and non LRU mapped migration support there may be an alternate approach to represent coherent device memory. Please do review this RFC proposal and let me know your comments or suggestions. Thank you. Anshuman Khandual (8): mm: Define coherent device memory node mm: Add

[RFC 7/8] mm: Add a new migration function migrate_virtual_range()

2016-10-23 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

[RFC 4/8] mm: Accommodate coherent device memory nodes in MPOL_BIND implementation

2016-10-23 Thread Anshuman Khandual
memory node through MPOL_MBIND interface. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/mempolicy.c | 20 1 file changed, 20 insertions(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0b859af..cb1ba01 100644 --- a/mm/mempolicy.c ++

[DEBUG 01/10] dt-bindings: Add doc for ibm,hotplug-aperture

2016-10-23 Thread Anshuman Khandual
From: Reza Arbab <ar...@linux.vnet.ibm.com> Signed-off-by: Reza Arbab <ar...@linux.vnet.ibm.com> Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- .../bindings/powerpc/opal/hotplug-aperture.txt | 26 ++ 1 file changed, 26 insertions(+)

[DEBUG 04/10] mm: Enable CONFIG_MOVABLE_NODE on powerpc

2016-10-23 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 03/10] powerpc/mm: Allow memory hotplug into a memory less node

2016-10-23 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 06/10] mm: Export definition of 'zone_names' array through mmzone.h

2016-10-23 Thread Anshuman Khandual
zone_names[] is used to identify any zone given it's index which can be used in many other places. So exporting the definition through include/linux/mmzone.h header for it's broader access. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- include/linux/mmzone.h | 1

[DEBUG 08/10] powerpc: Enable CONFIG_MOVABLE_NODE for PPC64 platform

2016-10-23 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 05/10] powerpc/mm: Identify isolation seeking coherent memory nodes during boot

2016-10-23 Thread Anshuman Khandual
erent mask in pglist_data structure as MNODE_ISOLATION. Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- arch/powerpc/mm/numa.c | 20 1 file changed, 20 insertions(+) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 5010181..89ae64c 100644 --

[DEBUG 09/10] drivers: Add two drivers for coherent device memory tests

2016-10-23 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 00/10] Test and debug patches for coherent device memory

2016-10-23 Thread Anshuman Khandual
: migration_passed migrate_virtual_range: 55094 325e 3261 1: migration_passed Anshuman Khandual (6): powerpc/mm: Identify isolation seeking coherent memory nodes during boot mm: Export definition of 'zone_names' array through mmzone.h mm: Add debugfs interface to dump each node's zonelist

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

2016-10-23 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 07/10] mm: Add debugfs interface to dump each node's zonelist information

2016-10-23 Thread Anshuman Khandual
) (1) (Node 0) (DMA) (2) (Node 1) (DMA) (3) (Node 2) (DMA) ZONELIST_NOFALLBACK (0) (Node 3) (DMA) Signed-off-by: Anshuman Khandual <khand...@linux.vnet.ibm.com> --- mm/memory.

[DEBUG 02/10] powerpc/mm: Create numa nodes for hotplug memory

2016-10-23 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 i

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

2016-10-24 Thread Anshuman Khandual
On 10/24/2016 10:39 PM, Dave Hansen wrote: >> +#ifdef CONFIG_COHERENT_DEVICE >> > +#define node_cdm(nid) (NODE_DATA(nid)->coherent_device) >> > +#define set_cdm_isolation(nid) (node_cdm(nid) = 1) >> > +#define clr_cdm_isolation(nid) (node_cdm(nid) = 0) >> > +#define isolated_cdm_node(nid)

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