o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
tools/testi
Generally, the documentation we wrote for hugetlbfs-based minor faults
still all applies. The only missing piece is to mention the new feature
flag which indicates that the kernel supports this for shmem as well.
Signed-off-by: Axel Rasmussen
---
Documentation/admin-guide/mm/userfaultfd.rst | 3
which would
double-count since shmem_add_to_page_cache() also does this.
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 5
mm/shmem.c| 53 ---
mm/userfaultfd.c | 17 ---
3 files changed, 22 insertions(
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29
1 file changed, 25 insertions(+), 4 deletions(-)
diff
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 215 ---
1 file changed, 116 insertions(+), 99 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 22 +++---
1 file changed, 19 insertions(+), 3 dele
o two statements. This means the line
number reported when the BUG is hit specifies exactly which condition
was true.
Reviewed-by: Peter Xu
Acked-by: Hugh Dickins
Signed-off-by: Axel Rasmussen
---
include/linux/shmem_fs.h | 17 ++---
mm/shmem.c
ear to do it as a separate change.
Signed-off-by: Axel Rasmussen
---
mm/userfaultfd.c | 172 ++-
1 file changed, 127 insertions(+), 45 deletions(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 23fa2583bbd1..51d8c0127161 100644
--- a/mm/user
t yet have a way to resolve
such faults.
Acked-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +++---
include/uapi/linux/userfaultfd.h | 7 ++-
mm/memory.c | 8 +---
mm/shmem.c | 12 +++-
4 files c
Minimizing header file inclusion is desirable. In this case, we can do
so just by forward declaring the enumeration our signature relies upon.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4 +++-
mm/hugetlb.c| 1 +
2 files changed, 4 insertions
the heap efficiently. Without this feature, uneccessary page
copying (ioctl(UFFDIO_COPY)) would be required."
[1] https://lore.kernel.org/patchwork/cover/1388144/
[2] https://lore.kernel.org/patchwork/patch/1408161/
[3]
https://lore.kernel.org/linux-fsdevel/20210301222728.176417-1-axelrasmu
On Thu, Apr 15, 2021 at 12:13 PM Hugh Dickins wrote:
>
> On Thu, 15 Apr 2021, Axel Rasmussen wrote:
>
> > Base
> >
> >
> > This series is based on (and therefore should apply cleanly to) the tag
> > "v5.12-rc7-mmots-2021-04-11-20-49"
On Fri, Apr 16, 2021 at 5:34 PM Hugh Dickins wrote:
>
> On Mon, 12 Apr 2021, Axel Rasmussen wrote:
>
> > In a previous commit, we added the mcopy_atomic_install_ptes() helper.
> > This helper does the job of setting up PTEs for an existing page, to map
> > it into a gi
On Fri, Apr 16, 2021 at 4:47 PM Hugh Dickins wrote:
>
> On Mon, 12 Apr 2021, Axel Rasmussen wrote:
>
> > With this change, userspace can resolve a minor fault within a
> > shmem-backed area with a UFFDIO_CONTINUE ioctl. The semantics for this
> > match those for
Generally, the documentation we wrote for hugetlbfs-based minor faults
still all applies. The only missing piece is to mention the new feature
flag which indicates that the kernel supports this for shmem as well.
Signed-off-by: Axel Rasmussen
---
Documentation/admin-guide/mm/userfaultfd.rst | 3
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 215 ---
1 file changed, 116 insertions(+), 99 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
which would
double-count since shmem_add_to_page_cache() also does this.
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 5
mm/shmem.c| 52 +++
mm/userfaultfd.c | 25 -
3 files changed, 27 inse
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29
1 file changed, 25 insertions(+), 4 deletions(-)
diff
o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
tools/testi
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 22 +++---
1 file changed, 19 insertions(+), 3 dele
t yet have a way to resolve
such faults.
Acked-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +++---
include/uapi/linux/userfaultfd.h | 7 ++-
mm/memory.c | 8 +---
mm/shmem.c | 12 +++-
4 files c
clear to do it as a separate change.
Signed-off-by: Axel Rasmussen
---
mm/userfaultfd.c | 176 +++
1 file changed, 131 insertions(+), 45 deletions(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 23fa2583bbd1..8df0438f5d6a 100644
--- a/mm/user
Minimizing header file inclusion is desirable. In this case, we can do
so just by forward declaring the enumeration our signature relies upon.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4 +++-
mm/hugetlb.c| 1 +
2 files changed, 4 insertions
o two statements. This means the line
number reported when the BUG is hit specifies exactly which condition
was true.
Reviewed-by: Peter Xu
Acked-by: Hugh Dickins
Signed-off-by: Axel Rasmussen
---
include/linux/shmem_fs.h | 17 ++---
mm/shmem.c
;non-moving'
portion of the heap efficiently. Without this feature, uneccessary page
copying (ioctl(UFFDIO_COPY)) would be required."
[1] https://lore.kernel.org/patchwork/cover/1388144/
[2] https://lore.kernel.org/patchwork/patch/1408161/
[3]
https://lore.kernel.org/linux-fsdev
On Tue, Apr 13, 2021 at 11:12 AM Peter Xu wrote:
>
> On Mon, Apr 12, 2021 at 09:40:22PM -0700, Axel Rasmussen wrote:
> > On Mon, Apr 12, 2021 at 4:17 PM Peter Xu wrote:
> > >
> > > On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote:
> > >
On Tue, Apr 13, 2021 at 1:15 PM Peter Xu wrote:
>
> On Mon, Apr 12, 2021 at 10:17:19PM -0700, Axel Rasmussen wrote:
> > Currently, the context (fds, mmap-ed areas, etc.) are global. Each test
> > mutates this state in some way, in some cases really "clobbering it"
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29
1 file changed, 25 insertions(+), 4 deletions(-)
diff
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 221 +--
1 file changed, 127 insertions(+), 94 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
clear to do it as a separate change.
Signed-off-by: Axel Rasmussen
---
mm/userfaultfd.c | 176 +++
1 file changed, 131 insertions(+), 45 deletions(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 23fa2583bbd1..8df0438f5d6a 100644
--- a/mm/user
o two statements. This means the line
number reported when the BUG is hit specifies exactly which condition
was true.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
include/linux/shmem_fs.h | 15 +---
mm/shmem.c | 52 +--
o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/use
which would
double-count since shmem_add_to_page_cache() also does this.
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 5
mm/shmem.c| 52 +++
mm/userfaultfd.c | 25 -
3 files changed, 27 inse
t yet have a way to resolve
such faults.
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +++---
include/uapi/linux/userfaultfd.h | 7 ++-
mm/memory.c | 8 +---
mm/shmem.c | 10 +-
4 files changed, 23 insert
Minimizing header file inclusion is desirable. In this case, we can do
so just by forward declaring the enumeration our signature relies upon.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4 +++-
mm/hugetlb.c| 1 +
2 files changed, 4 insertions
e heap efficiently. Without this feature, uneccessary page
copying (ioctl(UFFDIO_COPY)) would be required."
[1] https://lore.kernel.org/patchwork/cover/1388144/
[2] https://lore.kernel.org/patchwork/patch/1408161/
[3]
https://lore.kernel.org/linux-fsdevel/20210301222728.176417-1-axelrasmus...@goog
On Mon, Apr 12, 2021 at 4:17 PM Peter Xu wrote:
>
> On Thu, Apr 08, 2021 at 04:43:22PM -0700, Axel Rasmussen wrote:
> > +/*
> > + * Install PTEs, to map dst_addr (within dst_vma) to page.
> > + *
> > + * This function handles MCOPY_ATOMIC_CONTINUE (wh
On Thu, Apr 8, 2021 at 10:04 PM Andrew Morton wrote:
>
> On Thu, 8 Apr 2021 16:43:18 -0700 Axel Rasmussen
> wrote:
>
> > The idea is that it will apply cleanly to akpm's tree, *replacing* the
> > following
> > patches (i.e., drop these first, and then appl
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 221 +--
1 file changed, 129 insertions(+), 92 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29
1 file changed, 25 insertions(+), 4 deletions(-)
diff
t yet have a way to resolve
such faults.
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +++---
include/uapi/linux/userfaultfd.h | 7 ++-
mm/memory.c | 8 +---
mm/shmem.c | 20
4 files changed, 30
o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/use
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/
clear to do it as a separate change.
Signed-off-by: Axel Rasmussen
---
mm/userfaultfd.c | 176 +++
1 file changed, 131 insertions(+), 45 deletions(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 60ae22207761..a539fe18b9a7 100644
--- a/mm/user
which would
double-count since shmem_add_to_page_cache() also does this.
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 5
mm/shmem.c| 52 +++
mm/userfaultfd.c | 25 -
3 files changed, 27 inse
Minimizing header file inclusion is desirable. In this case, we can do
so just by forward declaring the enumeration our signature relies upon.
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 5 -
mm/hugetlb.c| 1 +
2 files changed, 5 insertions(+), 1 deletion
o two statements. This means the line
number reported when the BUG is hit specifies exactly which condition
was true.
Signed-off-by: Axel Rasmussen
---
include/linux/shmem_fs.h | 15 +---
mm/shmem.c | 52 +---
mm/userfaultfd.c
l.org/patchwork/patch/1408161/
[3]
https://lore.kernel.org/linux-fsdevel/20210301222728.176417-1-axelrasmus...@google.com/T/#t
Axel Rasmussen (9):
userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h
userfaultfd/shmem: combine shmem_{mcopy_atomic,mfill_zeropage}_pte
userfaultf
On Tue, Apr 6, 2021 at 4:49 PM Peter Xu wrote:
>
> On Mon, Apr 05, 2021 at 10:19:17AM -0700, Axel Rasmussen wrote:
> > Previously, the continue implementation in shmem_mcopy_atomic_pte was
> > incorrect for two main reasons:
> >
> > - It didn't correctly sk
Thanks for the thorough and insightful review, Hugh!
On Tue, Apr 6, 2021 at 11:14 PM Hugh Dickins wrote:
>
> [PATCH v4] userfaultfd/shmem: fix MCOPY_ATOMIC_CONTINUE behavior
> was a significant rework, so here I'm reviewing a synthetic patch
> merged from 5.12-rc5's 2021-03-31 mmotm patches:
>
392464/
Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by: Axel Rasmussen
---
mm/shmem.c | 56 +++
mm/userfaultfd.c | 183 ---
tools/testing/selftests/vm/userfaultfd.c | 12
"if (!is_continue)".
- Fix unconditional ClearPageDirty().
- Don't pte_mkwrite() when is_continue && !VM_SHARED.
[1] https://lore.kernel.org/patchwork/patch/1392464/
Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by: Axel Rasmu
On Tue, Mar 30, 2021 at 1:55 PM Peter Xu wrote:
>
> On Mon, Mar 29, 2021 at 04:41:31PM -0700, Axel Rasmussen wrote:
> > Previously, we shared too much of the code with COPY and ZEROPAGE, so we
> > manipulated things in various invalid ways:
> >
> > - Previou
heck in the continue case.
Changes since v1:
- Refactor to skip ahead with goto, instead of adding several more
"if (!is_continue)".
- Fix unconditional ClearPageDirty().
- Don't pte_mkwrite() when is_continue && !VM_SHARED.
Fixes: 00da60b9d0a0 ("us
unconditional ClearPageDirty().
- Don't pte_mkwrite() when is_continue && !VM_SHARED.
Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by: Axel Rasmussen
---
mm/shmem.c | 67 ++--
tools/t
ve
already accounted for the RAM usage when the page was originally
allocated (since at this point it's already in the page cache). So,
doing it in the continue case causes us to double-count.
Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by
On Wed, Mar 24, 2021 at 5:52 PM Peter Xu wrote:
>
> Hi, Andrew,
>
> On Wed, Mar 24, 2021 at 04:20:27PM -0700, Andrew Morton wrote:
> > On Mon, 22 Mar 2021 13:48:35 -0700 Axel Rasmussen
> > wrote:
> >
> > > This fix is analogous to Peter Xu's fix
mAvailable steadily decreasing with each run of the test. With the
fix, memory is correctly freed after the test program exits.
Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by: Axel Rasmussen
---
mm/shmem.c | 1 +
1 file changed, 1 insertion
gt; mode, then cat /proc/meminfo.
>
> Cc: Axel Rasmussen
> Cc: Andrea Arcangeli
> Cc: Mike Kravetz
> Cc: Mike Rapoport
> Cc: Andrew Morton
> Fixes: f2bf15fb0969 ("userfaultfd: add minor fault registration mode")
> Signed-off-by: Peter Xu
> ---
> mm/
Sorry for the build failure! I sent a new version of my patch with
this same fix on the 10th
(https://lore.kernel.org/patchwork/patch/1392464/), and I believe
Andrew has already included it in his tree.
On Tue, Mar 16, 2021 at 8:40 AM SeongJae Park wrote:
>
> From: SeongJae Park
>
> Commit 49eea
These look like good cleanups to me! I reviewed all of the patches,
and tried out the resulting selftest program, it seems to work
correctly. So, for what it's worth:
Reviewed-by: Axel Rasmussen
On Tue, Mar 9, 2021 at 4:45 PM Peter Xu wrote:
>
> Based on v5.12-rc2-mmots-2021-
+Stephen to CC, as an FYI.
On Tue, Mar 9, 2021 at 2:58 PM Axel Rasmussen wrote:
>
> Modify the userfaultfd register API to allow registering shmem VMAs in
> minor mode. Modify the shmem mcopy implementation to support
> UFFDIO_CONTINUE in order to resolve such faults.
>
> Combi
On Tue, Mar 9, 2021 at 7:16 PM Stephen Rothwell wrote:
>
> Hi all,
>
> After merging the akpm-current tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
Hi Stephen,
Sorry about the failure! Indeed, I had guarded this in the header, but
not in the .c file. I sent a v2.5
matches how
the hugetlbfs implementation is structured, and lets us remove a good
chunk of boilerplate.
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +-
include/linux/shmem_fs.h | 26 -
include/uapi/linux/userfaultfd.h | 4 +-
mm/memory.c
On Tue, Mar 9, 2021 at 11:52 AM Zi Yan wrote:
>
> On 1 Mar 2021, at 19:01, Axel Rasmussen wrote:
>
> > Modify the userfaultfd register API to allow registering shmem VMAs in
> > minor mode. Modify the shmem mcopy implementation to support
> > UFFDIO_CONTINUE in o
On Thu, Mar 4, 2021 at 8:31 AM Peter Xu wrote:
>
> v2 changes:
> - Fix wordings as suggested [MikeR]
> - convert ".BR" to ".B" where proper for the patchset [Alex]
> - rearrange a few lines in the last two patches where they got messed up
> - document more things, e.g. UFFDIO_COPY_MODE_WP; and als
matches how
the hugetlbfs implementation is structured, and lets us remove a good
chunk of boilerplate.
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +--
include/linux/shmem_fs.h | 26 -
include/uapi/linux/userfaultfd.h | 4 +-
mm/memory.c
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29 +---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/
o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/use
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 249 ++-
1 file changed, 151 insertions(+), 98 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
on of the heap efficiently. Without this feature, uneccessary page
copying (ioctl(UFFDIO_COPY)) would be required."
Axel Rasmussen (5):
userfaultfd: support minor fault handling for shmem
userfaultfd/selftests: use memfd_create for shmem test type
userfaultfd/selftests: create ali
ve() on
it.)
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 67
include/linux/hugetlb.h | 3 ++
include/linux/userfaultfd_k.h| 18 +
include/uapi/linux/userfaultfd.h | 21 +-
mm
ING faults, whereas CONTINUE is used for MINOR
faults.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
Documentation/admin-guide/mm/userfaultfd.rst | 107 ---
1 file changed, 66 insertions(+), 41 deletions(-)
diff --git a/Documentation/admin-guide/mm/userfaultfd.rst
b/Doc
ioctl, to setup the
mapping and resolve the fault. The reading thread should wake up and see
this modification.
Currently the minor fault test is only enabled in hugetlb_shared mode,
as this is the only configuration the kernel feature supports.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4
mm/hugetlb.c| 2 ++
2 files changed, 6 insertions(+)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index c0b10f0c7f23..7b86bf809d7a 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
Huge PMD sharing would prevent these faults from occurring for
suitably aligned areas, so disable it upon UFFD registration.
Reviewed-by: Peter Xu
Reviewed-by: Mike Kravetz
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 13 ++---
1 file changed, 10 insertions(
y supports hugetlbfs. I have a second series in flight to support
shmem as well, extending the functionality. This series is more mature than the
shmem support at this point, and the functionality works fully on hugetlbfs, so
this series can be merged first and then shmem support will follow.
] https://lore.kernel.org/patchwork/patch/1380226/
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
arch/arm64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
fs/proc/task_mmu.c | 3 ++
fs/userfaultfd.c | 78 ++---
On Wed, Feb 24, 2021 at 6:14 PM Axel Rasmussen wrote:
>
> Modify the userfaultfd register API to allow registering shmem VMAs in
> minor mode. Modify the shmem mcopy implementation to support
> UFFDIO_CONTINUE in order to resolve such faults.
>
> Combine the shmem mcopy handle
On Wed, Feb 24, 2021 at 4:26 PM Mike Kravetz wrote:
>
> On 2/18/21 4:48 PM, Axel Rasmussen wrote:
>
> > @@ -401,8 +398,10 @@ vm_fault_t handle_userfault(struct vm_fault *vmf,
> > unsigned long reason)
> >
> > BUG_ON(ctx->mm != mm);
> >
>
#x27;t a problem for hugetlb, as we don't mremap in
that case.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 249 ++-
1 file changed, 151 insertions(+), 98 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c
b/tools/testing/selft
matches how
the hugetlbfs implementation is structured, and lets us remove a good
chunk of boilerplate.
Signed-off-by: Axel Rasmussen
---
fs/userfaultfd.c | 6 +--
include/linux/shmem_fs.h | 26 --
include/uapi/linux/userfaultfd.h | 4 +-
mm/memory.c
, we'll leverage this setup to exercise minor fault handling
support for shmem, just like we do in the hugetlb_shared test.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 29 +---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/
Enable test_uffdio_minor for test_type == TEST_SHMEM, and modify the
test slightly to pass in / check for the right feature flags.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/userfaultfd.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a
o test new
userfaultfd behavior being introduced in this series.
Also, a small fix in the area we're changing: when the hugetlb setup
fails in main(), pass in the right argv[] so we actually print out the
hugetlb file path.
Signed-off-by: Axel Rasmussen
---
tools/testing/selftests/vm/use
optimize the Android JVM garbage collector using this feature (a paper
describing a somewhat similar approach: https://arxiv.org/pdf/1902.04738.pdf).
Axel Rasmussen (5):
userfaultfd: support minor fault handling for shmem
userfaultfd/selftests: use memfd_create for shmem test type
userfaultf
ioctl, to setup the
mapping and resolve the fault. The reading thread should wake up and see
this modification.
Currently the minor fault test is only enabled in hugetlb_shared mode,
as this is the only configuration the kernel feature supports.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
ING faults, whereas CONTINUE is used for MINOR
faults.
Signed-off-by: Axel Rasmussen
---
Documentation/admin-guide/mm/userfaultfd.rst | 107 ---
1 file changed, 66 insertions(+), 41 deletions(-)
diff --git a/Documentation/admin-guide/mm/userfaultfd.rst
b/Documentation/admi
it for the UFFDIO_ZEROPAGE case, so
just extend that design: add an enum for the three modes of operation,
and make the small adjustments needed for the MCOPY_ATOMIC_CONTINUE
case. (Basically, look up the existing page, and avoid adding the
existing page to the page cache or calling set_page_huge_ac
] https://lore.kernel.org/patchwork/patch/1380226/
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
arch/arm64/Kconfig | 1 +
arch/x86/Kconfig | 1 +
fs/proc/task_mmu.c | 3 ++
fs/userfaultfd.c | 78 +++---
Huge PMD sharing would prevent these faults from occurring for
suitably aligned areas, so disable it upon UFFD registration.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
---
include/linux/userfaultfd_k.h | 13 ++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --
Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4
mm/hugetlb.c| 2 ++
2 files changed, 6 insertions(+)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ef5b55dbeb9a..7e6d2f126df3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
eturned (or -EINVAL
in the case of hugetlb, as UFFDIO_ZEROPAGE is unsupported in any case).
- UFFDIO_WRITEPROTECT simply doesn't work with shared memory, and returns
-ENOENT in that case (regardless of the kind of fault).
Future Work
===
Currently the patchset only supports hug
On Tue, Feb 23, 2021 at 7:38 AM Peter Xu wrote:
>
> On Thu, Feb 18, 2021 at 04:48:22PM -0800, Axel Rasmussen wrote:
> > @@ -4645,8 +4646,18 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct
> > *dst_mm,
> > spinlock_t *ptl;
> > int ret;
> >
it for the UFFDIO_ZEROPAGE case, so
just extend that design: add an enum for the three modes of operation,
and make the small adjustments needed for the MCOPY_ATOMIC_CONTINUE
case. (Basically, look up the existing page, and avoid adding the
existing page to the page cache or calling set_page_huge_ac
Xu
Signed-off-by: Axel Rasmussen
---
include/linux/hugetlb.h | 4
mm/hugetlb.c| 2 ++
2 files changed, 6 insertions(+)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ef5b55dbeb9a..7e6d2f126df3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
ING faults, whereas CONTINUE is used for MINOR
faults.
Signed-off-by: Axel Rasmussen
---
Documentation/admin-guide/mm/userfaultfd.rst | 107 ---
1 file changed, 66 insertions(+), 41 deletions(-)
diff --git a/Documentation/admin-guide/mm/userfaultfd.rst
b/Documentation/admi
ioctl, to setup the
mapping and resolve the fault. The reading thread should wake up and see
this modification.
Currently the minor fault test is only enabled in hugetlb_shared mode,
as this is the only configuration the kernel feature supports.
Reviewed-by: Peter Xu
Signed-off-by: Axel Rasmussen
1 - 100 of 262 matches
Mail list logo