mbox series

[v1,0/5] mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory

Message ID 20210317110644.25343-1-david@redhat.com (mailing list archive)
Headers show
Series mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc memory | expand

Message

David Hildenbrand March 17, 2021, 11:06 a.m. UTC
Excessive details on MADV_POPULATE_(READ|WRITE) can be found in patch #2.

Now accompanied by minor adjustments and selftests/vm tests.

RFCv2 -> v1
- "mm: fix variable name in declaration of populate_vma_page_range()"
-- Added
- "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault ..."
-- Fix detection of memory holes when we have to re-lookup the VMA
-- Return -EHWPOISON to user space when we hit HW poisoned pages
-- Make variable names in definition and declaration consistent
- "MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT"
-- Added
- "selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore"
-- Added
- "selftests/vm: add test for MADV_POPULATE_(READ|WRITE)"
-- Added

RFC -> RFCv2:
- Fix re-locking (-> set "locked = 1;")
- Don't mimic MAP_POPULATE semantics:
--> Explicit READ/WRITE request instead of selecting it automatically,
    which makes it more generic and better suited for some use cases (e.g., we
    usually want to prefault shmem writable)
--> Require proper access permissions
- Introduce and use faultin_vma_page_range()
--> Properly handle HWPOISON pages (FOLL_HWPOISON)
--> Require proper access permissions (!FOLL_FORCE)
- Let faultin_vma_page_range() check for compatible mappings/permissions
- Extend patch description and add some performance numbers

David Hildenbrand (5):
  mm: make variable names for populate_vma_page_range() consistent
  mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc
    memory
  MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT
  selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore
  selftests/vm: add test for MADV_POPULATE_(READ|WRITE)

 MAINTAINERS                                |   1 +
 arch/alpha/include/uapi/asm/mman.h         |   3 +
 arch/mips/include/uapi/asm/mman.h          |   3 +
 arch/parisc/include/uapi/asm/mman.h        |   3 +
 arch/xtensa/include/uapi/asm/mman.h        |   3 +
 include/uapi/asm-generic/mman-common.h     |   3 +
 mm/gup.c                                   |  54 ++++
 mm/internal.h                              |   5 +-
 mm/madvise.c                               |  69 +++++
 tools/testing/selftests/vm/.gitignore      |   3 +
 tools/testing/selftests/vm/Makefile        |   1 +
 tools/testing/selftests/vm/madv_populate.c | 342 +++++++++++++++++++++
 tools/testing/selftests/vm/run_vmtests.sh  |  16 +
 13 files changed, 505 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/vm/madv_populate.c

Comments

David Hildenbrand March 30, 2021, 8:58 a.m. UTC | #1
On 17.03.21 12:06, David Hildenbrand wrote:
> Excessive details on MADV_POPULATE_(READ|WRITE) can be found in patch #2.
> 
> Now accompanied by minor adjustments and selftests/vm tests.
> 
> RFCv2 -> v1
> - "mm: fix variable name in declaration of populate_vma_page_range()"
> -- Added
> - "mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault ..."
> -- Fix detection of memory holes when we have to re-lookup the VMA
> -- Return -EHWPOISON to user space when we hit HW poisoned pages
> -- Make variable names in definition and declaration consistent
> - "MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT"
> -- Added
> - "selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore"
> -- Added
> - "selftests/vm: add test for MADV_POPULATE_(READ|WRITE)"
> -- Added
> 
> RFC -> RFCv2:
> - Fix re-locking (-> set "locked = 1;")
> - Don't mimic MAP_POPULATE semantics:
> --> Explicit READ/WRITE request instead of selecting it automatically,
>      which makes it more generic and better suited for some use cases (e.g., we
>      usually want to prefault shmem writable)
> --> Require proper access permissions
> - Introduce and use faultin_vma_page_range()
> --> Properly handle HWPOISON pages (FOLL_HWPOISON)
> --> Require proper access permissions (!FOLL_FORCE)
> - Let faultin_vma_page_range() check for compatible mappings/permissions
> - Extend patch description and add some performance numbers
> 
> David Hildenbrand (5):
>    mm: make variable names for populate_vma_page_range() consistent
>    mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault/prealloc
>      memory
>    MAINTAINERS: add tools/testing/selftests/vm/ to MEMORY MANAGEMENT
>    selftests/vm: add protection_keys_32 / protection_keys_64 to gitignore
>    selftests/vm: add test for MADV_POPULATE_(READ|WRITE)
> 
>   MAINTAINERS                                |   1 +
>   arch/alpha/include/uapi/asm/mman.h         |   3 +
>   arch/mips/include/uapi/asm/mman.h          |   3 +
>   arch/parisc/include/uapi/asm/mman.h        |   3 +
>   arch/xtensa/include/uapi/asm/mman.h        |   3 +
>   include/uapi/asm-generic/mman-common.h     |   3 +
>   mm/gup.c                                   |  54 ++++
>   mm/internal.h                              |   5 +-
>   mm/madvise.c                               |  69 +++++
>   tools/testing/selftests/vm/.gitignore      |   3 +
>   tools/testing/selftests/vm/Makefile        |   1 +
>   tools/testing/selftests/vm/madv_populate.c | 342 +++++++++++++++++++++
>   tools/testing/selftests/vm/run_vmtests.sh  |  16 +
>   13 files changed, 505 insertions(+), 1 deletion(-)
>   create mode 100644 tools/testing/selftests/vm/madv_populate.c
> 

Gentle ping.
Andrew Morton March 31, 2021, 4:58 a.m. UTC | #2
On Tue, 30 Mar 2021 10:58:43 +0200 David Hildenbrand <david@redhat.com> wrote:

> > 
> >   MAINTAINERS                                |   1 +
> >   arch/alpha/include/uapi/asm/mman.h         |   3 +
> >   arch/mips/include/uapi/asm/mman.h          |   3 +
> >   arch/parisc/include/uapi/asm/mman.h        |   3 +
> >   arch/xtensa/include/uapi/asm/mman.h        |   3 +
> >   include/uapi/asm-generic/mman-common.h     |   3 +
> >   mm/gup.c                                   |  54 ++++
> >   mm/internal.h                              |   5 +-
> >   mm/madvise.c                               |  69 +++++
> >   tools/testing/selftests/vm/.gitignore      |   3 +
> >   tools/testing/selftests/vm/Makefile        |   1 +
> >   tools/testing/selftests/vm/madv_populate.c | 342 +++++++++++++++++++++
> >   tools/testing/selftests/vm/run_vmtests.sh  |  16 +
> >   13 files changed, 505 insertions(+), 1 deletion(-)
> >   create mode 100644 tools/testing/selftests/vm/madv_populate.c
> > 
> 
> Gentle ping.

Ping who ;)

I was hoping for more review activity.  Were no changes expected from
the [2/5] discussion with Jann?
David Hildenbrand March 31, 2021, 6:46 a.m. UTC | #3
On 31.03.21 06:58, Andrew Morton wrote:
> On Tue, 30 Mar 2021 10:58:43 +0200 David Hildenbrand <david@redhat.com> wrote:
> 
>>>
>>>    MAINTAINERS                                |   1 +
>>>    arch/alpha/include/uapi/asm/mman.h         |   3 +
>>>    arch/mips/include/uapi/asm/mman.h          |   3 +
>>>    arch/parisc/include/uapi/asm/mman.h        |   3 +
>>>    arch/xtensa/include/uapi/asm/mman.h        |   3 +
>>>    include/uapi/asm-generic/mman-common.h     |   3 +
>>>    mm/gup.c                                   |  54 ++++
>>>    mm/internal.h                              |   5 +-
>>>    mm/madvise.c                               |  69 +++++
>>>    tools/testing/selftests/vm/.gitignore      |   3 +
>>>    tools/testing/selftests/vm/Makefile        |   1 +
>>>    tools/testing/selftests/vm/madv_populate.c | 342 +++++++++++++++++++++
>>>    tools/testing/selftests/vm/run_vmtests.sh  |  16 +
>>>    13 files changed, 505 insertions(+), 1 deletion(-)
>>>    create mode 100644 tools/testing/selftests/vm/madv_populate.c
>>>
>>
>> Gentle ping.
> 
> Ping who ;)

Well, the ping worked - Jann replied! :)

> 
> I was hoping for more review activity.  Were no changes expected from
> the [2/5] discussion with Jann?

They are, but that discussion happened after the ping. There will be a 
new version some-when next week or so, after I figure out some details.