[RFC 31/43] memblock, mm: defer initialization of preserved pages

2020-05-06 Thread Anthony Yznaga
skipping them when other reserved pages are initialized and initializing them later with a separate kernel thread. Signed-off-by: Anthony Yznaga --- arch/x86/mm/init_64.c | 1 - include/linux/mm.h| 2 +- mm/memblock.c | 10 -- mm/page_alloc.c | 52

[RFC 05/43] mm: PKRAM: support preserving transparent hugepages

2020-05-06 Thread Anthony Yznaga
Support preserving a transparent hugepage by recording the page order and a flag indicating it is a THP. Use these values when the page is restored to reconstruct the THP. Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 2 ++ mm/pkram.c| 20 2 files

[RFC 42/43] shmem: reduce time holding xa_lock when inserting pages

2020-05-06 Thread Anthony Yznaga
, add them to a local xarray, export the xarray node, and then take the lock on the page cache xarray and insert the node. Signed-off-by: Anthony Yznaga --- mm/shmem.c | 145 ++--- 1 file changed, 138 insertions(+), 7 deletions(-) diff --git

[RFC 39/43] shmem: optimize adding pages to the LRU in shmem_insert_pages()

2020-05-06 Thread Anthony Yznaga
Reduce LRU lock contention when inserting shmem pages by staging pages to be added to the same LRU and adding them en masse. Signed-off-by: Anthony Yznaga --- mm/shmem.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index ca5edf580f24

[RFC 10/43] PKRAM: add code for walking the preserved pages pagetable

2020-05-06 Thread Anthony Yznaga
allocated from as will be seen in a later patch. Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 15 + mm/Makefile | 2 +- mm/pkram_pagetable.c | 169 ++ 3 files changed, 185 insertions(+), 1 deletion(-) create mode

[RFC 15/43] PKRAM: provide a way to ban pages from use by PKRAM

2020-05-06 Thread Anthony Yznaga
: Vladimir Davydov Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 2 + mm/pkram.c| 210 ++ 2 files changed, 212 insertions(+) diff --git a/include/linux/pkram.h b/include/linux/pkram.h index 409022e1472f..1ba48442ef8e 100644

[RFC 26/43] mm: shmem: when inserting, handle pages already charged to a memcg

2020-05-06 Thread Anthony Yznaga
ff-by: Anthony Yznaga --- mm/shmem.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 13475073fb52..1f3b43b8fa34 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -693,6 +693,7 @@ int shmem_insert_page(struct mm_struct *mm, struct inode *

[RFC 40/43] shmem: initial support for adding multiple pages to pagecache

2020-05-06 Thread Anthony Yznaga
, but improvements in performance when multiple threads are adding to the same pagecache are achieved by calling a new shmem_add_to_page_cache_fast() function that does not check for conflicts and drops the xarray lock before updating stats. Signed-off-by: Anthony Yznaga --- mm/shmem.c | 95

[RFC 43/43] PKRAM: improve index alignment of pkram_link entries

2020-05-06 Thread Anthony Yznaga
and the next aligned page will not fit on the pkram_link page. Signed-off-by: Anthony Yznaga --- mm/pkram.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mm/pkram.c b/mm/pkram.c index ef092aa5ce7a..416c3ca4411b 100644 --- a/mm/pkram.c +++ b/mm/pkram.c

[RFC 36/43] PKRAM: add support for loading pages in bulk

2020-05-06 Thread Anthony Yznaga
pages in the array are provided to the caller. pkram_finish_load_pages() Called when no more pages will be loaded from the pkram_obj. Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 6 +++ mm/pkram.c| 106 ++ 2 files

[RFC 12/43] mm: PKRAM: reserve preserved memory at boot

2020-05-06 Thread Anthony Yznaga
by the contiguous ranges present rather than a page at a time. Signed-off-by: Anthony Yznaga --- arch/x86/kernel/setup.c | 3 + arch/x86/mm/init_64.c | 2 + include/linux/pkram.h | 8 +++ mm/pkram.c | 179 +++- 4 files changed

[RFC 35/43] shmem: introduce shmem_insert_pages()

2020-05-06 Thread Anthony Yznaga
the shmem_inode_info lock and prepare for future optimizations, introduce shmem_insert_pages() which allows a caller to pass an array of pages to be inserted into a shmem segment. Signed-off-by: Anthony Yznaga --- include/linux/shmem_fs.h | 3 +- mm/shmem.c | 114

[RFC 37/43] shmem: PKRAM: enable bulk loading of preserved pages into shmem

2020-05-06 Thread Anthony Yznaga
Make use of new interfaces for loading and inserting preserved pages into a shmem file in bulk. Signed-off-by: Anthony Yznaga --- mm/shmem_pkram.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/mm/shmem_pkram.c b/mm/shmem_pkram.c index 4992b6c3e54e

[RFC 04/43] mm: PKRAM: implement page stream operations

2020-05-06 Thread Anthony Yznaga
puts it. Originally-by: Vladimir Davydov Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 5 ++ mm/pkram.c| 219 +- 2 files changed, 221 insertions(+), 3 deletions(-) diff --git a/include/linux/pkram.h b/include/linux/pkram.h

[RFC 38/43] mm: implement splicing a list of pages to the LRU

2020-05-06 Thread Anthony Yznaga
. For now only unevictable pages are supported. Signed-off-by: Anthony Yznaga --- include/linux/swap.h | 11 ++ mm/swap.c| 101 +++ 2 files changed, 112 insertions(+) diff --git a/include/linux/swap.h b/include/linux/swap.h index

[RFC 41/43] XArray: add xas_export_node() and xas_import_node()

2020-05-06 Thread Anthony Yznaga
it. Signed-off-by: Anthony Yznaga --- Documentation/core-api/xarray.rst | 8 +++ include/linux/xarray.h| 2 + lib/test_xarray.c | 45 + lib/xarray.c | 100 ++ 4 files changed, 155 insertions

[RFC 29/43] memblock: PKRAM: mark memblocks that contain preserved pages

2020-05-06 Thread Anthony Yznaga
To support deferred initialization of page structs for preserved pages, separate memblocks containing preserved pages by setting a new flag when adding them to the memblock reserved list. Signed-off-by: Anthony Yznaga --- include/linux/memblock.h | 7 +++ mm/memblock.c| 8

[RFC 23/43] mm: shmem: enable saving to PKRAM

2020-05-06 Thread Anthony Yznaga
implified: it supports only regular files in the root directory without multiple hard links, and it does not save swapped out files and aborts if any are found. However, it can be elaborated to fully support tmpfs. Originally-by: Vladimir Davydov Signed-off-by: Anthony Yznaga --- include/linux/pkram

[RFC 33/43] PKRAM: atomically add and remove link pages

2020-05-06 Thread Anthony Yznaga
Add and remove pkram_link pages from a pkram_obj atomically to prepare for multithreading. Signed-off-by: Anthony Yznaga --- mm/pkram.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/mm/pkram.c b/mm/pkram.c index 5f4e4d12865f..042c14dedc25

[RFC 34/43] shmem: PKRAM: multithread preserving and restoring shmem pages

2020-05-06 Thread Anthony Yznaga
of a file to a pkram_obj until no more no more chunks are available. When restoring pages each thread loads pages using a copy of a pkram_stream initialized by pkram_prepare_load_obj(). Under the hood each thread ends up fetching and operating on pkram_link pages. Signed-off-by: Anth

[RFC 17/43] PKRAM: provide a way to check if a memory range has preserved pages

2020-05-06 Thread Anthony Yznaga
When a kernel is loaded for kexec the address ranges where the kexec segments will be copied to may conflict with pages already set to be preserved. Provide a way to determine if preserved pages exist in a specified range. Signed-off-by: Anthony Yznaga --- include/linux/pkram.h | 2 ++ mm

[RFC 27/43] x86/mm/numa: add numa_isolate_memblocks()

2020-05-06 Thread Anthony Yznaga
. Signed-off-by: Anthony Yznaga --- arch/x86/include/asm/numa.h | 4 arch/x86/mm/numa.c | 32 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index bbfde3d2662f..f9e05f4eb1c6

Re: [RFC 14/43] mm: memblock: PKRAM: prevent memblock resize from clobbering preserved pages

2020-05-11 Thread Anthony Yznaga
On 5/11/20 6:57 AM, Mike Rapoport wrote: > On Wed, May 06, 2020 at 05:41:40PM -0700, Anthony Yznaga wrote: >> The size of the memblock reserved array may be increased while preserved >> pages are being reserved. When this happens, preserved pages that have >> not yet been

Re: [RFC 34/43] shmem: PKRAM: multithread preserving and restoring shmem pages

2020-05-07 Thread Anthony Yznaga
On 5/7/20 9:30 AM, Randy Dunlap wrote: > On 5/6/20 5:42 PM, Anthony Yznaga wrote: >> Improve performance by multithreading the work to preserve and restore >> shmem pages. >> >> Add 'pkram_max_threads=' kernel option to specify the maximum number >> o

Re: [RFC 21/43] x86/KASLR: PKRAM: support physical kaslr

2020-05-07 Thread Anthony Yznaga
On 5/7/20 10:51 AM, Kees Cook wrote: > On Wed, May 06, 2020 at 05:41:47PM -0700, Anthony Yznaga wrote: >> Avoid regions of memory that contain preserved pages when computing >> slots used to select where to put the decompressed kernel. > This is changing the slot-walki

Re: [PATCH RESEND v10 00/10] Application Data Integrity feature introduced by SPARC M7

2017-11-16 Thread Anthony Yznaga
nother thread > (Suggested by Anthony) Looks good, Khalid. Thanks for making the changes. For the entire series: Reviewed-by: Anthony Yznaga

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-25 Thread Anthony Yznaga
> On Aug 9, 2017, at 2:26 PM, Khalid Aziz wrote: > > ADI is a new feature supported on SPARC M7 and newer processors to allow > hardware to catch rogue accesses to memory. ADI is supported for data > fetches only and not instruction fetches. An app can enable ADI on its > data pages, set version

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-31 Thread Anthony Yznaga
Hi Khalid, > On Aug 30, 2017, at 3:27 PM, Khalid Aziz wrote: > > Hi Anthony, > > Thanks for taking the time to provide feedback. My comments inline below. > > On 08/25/2017 04:31 PM, Anthony Yznaga wrote: >>> On Aug 9, 2017, at 2:26 PM, Khalid

Re: [PATCH v2 2/2] sparc64: Use lzcnt instruction for fls and __fls

2017-09-27 Thread Anthony Yznaga
> On Sep 27, 2017, at 12:56 PM, Sam Ravnborg wrote: > > Hi Vijay. > > On Wed, Sep 27, 2017 at 01:25:26PM -0600, Vijay Kumar wrote: >> For T4 and above, patch fls and __fls functions >> at the boot time to use lzcnt instruction. >> >> Signed-off-by: Vijay Kumar >> Reviewed-by: Babu Moger >> -

Re: [PATCH v8 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-10-12 Thread Anthony Yznaga
> On Oct 12, 2017, at 7:44 AM, Khalid Aziz wrote: > > Hi Anthony, > > Please quote only the relevant parts of the patch with comments. That makes > it much easier to find the comments. Okay. > > On 10/06/2017 04:12 PM, Anthony Yznaga wrote: >>> On Sep

Re: [PATCH v8 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-10-13 Thread Anthony Yznaga
> On Oct 13, 2017, at 9:18 AM, Khalid Aziz wrote: > > On 10/13/2017 08:14 AM, Khalid Aziz wrote: >> On 10/12/2017 02:27 PM, Anthony Yznaga wrote: >>> >>>> On Oct 12, 2017, at 7:44 AM, Khalid Aziz wrote: >>>> >>>> >>>>

Re: [PATCH v8 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-10-06 Thread Anthony Yznaga
. > > Signed-off-by: Khalid Aziz > Cc: Khalid Aziz > --- > v8: > - Added note to doc about non-faulting loads not triggering > ADI tag mismatch and more details on special tag values > of 0x0 and 0xf, as suggested by Anthony Yznaga) > - Added an IP

Re: [PATCH v3 3/5] sparc64: SPARC optimised fls function

2017-10-06 Thread Anthony Yznaga
> On Oct 6, 2017, at 9:54 AM, Vijay Kumar wrote: > > Defined SPARC optimised fls using lzcnt opcode. > > Signed-off-by: Vijay Kumar > --- > arch/sparc/lib/Makefile |1 + > arch/sparc/lib/NG4fls.S | 20 > 2 files changed, 21 insertions(+), 0 deletions(-) > > diff --git

Re: [PATCH v9 00/10] Application Data Integrity feature introduced by SPARC M7

2017-11-08 Thread Anthony Yznaga
> On Oct 20, 2017, at 9:57 AM, Khalid Aziz wrote: > > Patch 9/10 > When a processor supports additional metadata on memory pages, that > additional metadata needs to be copied to new memory pages when those > pages are moved. This patch allows architecture specific code to > replace the defa

<    1   2