Re: [PATCH V3 2/4] mm/debug_vm_pgtable: Add tests validating advanced arch page table helpers

2020-06-27 Thread Christophe Leroy
Le 15/06/2020 à 05:37, Anshuman Khandual a écrit : This adds new tests validating for these following arch advanced page table helpers. These tests create and test specific mapping types at various page table levels. 1. pxxp_set_wrprotect() 2. pxxp_get_and_clear() 3. pxxp_set_access_flags() 4.

Re: [PATCH V3 2/4] mm/debug_vm_pgtable: Add tests validating advanced arch page table helpers

2020-06-27 Thread Christophe Leroy
Le 15/06/2020 à 05:37, Anshuman Khandual a écrit : This adds new tests validating for these following arch advanced page table helpers. These tests create and test specific mapping types at various page table levels. 1. pxxp_set_wrprotect() 2. pxxp_get_and_clear() 3. pxxp_set_access_flags() 4.

Re: [PATCH V3 0/4] mm/debug_vm_pgtable: Add some more tests

2020-06-27 Thread Christophe Leroy
Le 24/06/2020 à 05:13, Anshuman Khandual a écrit : On 06/15/2020 09:07 AM, Anshuman Khandual wrote: This series adds some more arch page table helper validation tests which are related to core and advanced memory functions. This also creates a documentation, enlisting expected semantics for

[PATCH 0/8] mm: cleanup usage of

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport Hi, Most architectures have very similar versions of pXd_alloc_one() and pXd_free_one() for intermediate levels of page table. These patches add generic versions of these functions in and enable use of the generic functions where appropriate. In addition, functions declare

[PATCH 2/8] opeinrisc: switch to generic version of pte allocation

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport Replace pte_alloc_one(), pte_free() and pte_free_kernel() with the generic implementation. The only actual functional change is the addition of __GFP_ACCOUT for the allocation of the user page tables. The pte_alloc_one_kernel() is kept back because its implementation on openr

[PATCH 1/8] mm: remove unneeded includes of

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport In the most cases header is required only for allocations of page table memory. Most of the .c files that include that header do not use symbols declared in and do not require that header. As for the other header files that used to include , it is possible to move that incl

[PATCH 3/8] xtensa: switch to generic version of pte allocation

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport xtensa clears PTEs during allocation of the page tables and pte_clear() sets the PTE to a non-zero value. Splitting ptes_clear() helper out of pte_alloc_one() and pte_alloc_one_kernel() allows reuse of base generic allocation methods (__pte_alloc_one() and __pte_alloc_one_kern

[PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport For most architectures that support >2 levels of page tables, pmd_alloc_one() is a wrapper for __get_free_pages(), sometimes with __GFP_ZERO and sometimes followed by memset(0) instead. More elaborate versions on arm64 and x86 account memory for the user page tables and call

[PATCH 5/8] asm-generic: pgalloc: provide generic pud_alloc_one() and pud_free_one()

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport Several architectures define pud_alloc_one() as a wrapper for __get_free_page() and pud_free() as a wrapper for free_page(). Provide a generic implementation in asm-generic/pgalloc.h and use it where appropriate. Signed-off-by: Mike Rapoport --- arch/arm64/include/asm/pgal

[PATCH 6/8] asm-generic: pgalloc: provide generic pgd_free()

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport Most architectures define pgd_free() as a wrapper for free_page(). Provide a generic version in asm-generic/pgalloc.h and enable its use for most architectures. Signed-off-by: Mike Rapoport --- arch/alpha/include/asm/pgalloc.h | 6 -- arch/arm/include/asm/pgalloc.

[PATCH 8/8] mm: move p?d_alloc_track to separate header file

2020-06-27 Thread Mike Rapoport
From: Joerg Roedel The functions are only used in two source files, both residing in mm/ subdirectory, so there is no need for them to be in the global header. Move them to the new mm/pgalloc-track.h header and include it only where needed. [rppt: mv include/linux/pgalloc-track.h mm/] Link: h

[PATCH 7/8] mm: move lib/ioremap.c to mm/

2020-06-27 Thread Mike Rapoport
From: Mike Rapoport The functionality in lib/ioremap.c deals with pagetables, vmalloc and caches, so it naturally belongs to mm/ Moving it there will also allow declaring p?d_alloc_track functions in an header file inside mm/ rather than having those declarations in include/linux/mm.h Suggested-

Re: [PATCH 0/8] mm: cleanup usage of

2020-06-27 Thread Matthew Wilcox
On Sat, Jun 27, 2020 at 05:34:45PM +0300, Mike Rapoport wrote: > Most architectures have very similar versions of pXd_alloc_one() and > pXd_free_one() for intermediate levels of page table. > These patches add generic versions of these functions in > and enable use of the generic functions where

[PATCH 9/8] mm: Account PMD tables like PTE tables

2020-06-27 Thread Matthew Wilcox
We account the PTE level of the page tables to the process in order to make smarter OOM decisions and help diagnose why memory is fragmented. For these same reasons, we should account pages allocated for PMDs. With larger process address spaces and ASLR, the number of PMDs in use is higher than it

Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()

2020-06-27 Thread Matthew Wilcox
On Sat, Jun 27, 2020 at 05:34:49PM +0300, Mike Rapoport wrote: > More elaborate versions on arm64 and x86 account memory for the user page > tables and call to pgtable_pmd_page_ctor() as the part of PMD page > initialization. > > Move the arm64 version to include/asm-generic/pgalloc.h and use the

Re: [PATCH 2/8] opeinrisc: switch to generic version of pte allocation

2020-06-27 Thread Stafford Horne
On Sat, Jun 27, 2020 at 05:34:47PM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > Replace pte_alloc_one(), pte_free() and pte_free_kernel() with the generic > implementation. The only actual functional change is the addition of > __GFP_ACCOUT for the allocation of the user page tables. >