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/testing/selftests/vm
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
tlb, 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/selftests/vm/userfaultfd.c
index 1f
, 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 deletions
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 | 52
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/userfaultfd.c
+++ b
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 changed, 25
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
ssary 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...@google.com/T/#t
Axel Rasmussen (10):
userf
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
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
tlb, 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/selftests/vm/userfaultfd.c
index 1f
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
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/testing/selftests/vm
, 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 deletions
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 changed, 25
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/userfaultfd.c
+++ b
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
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 | 52
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...@google.co
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/tools
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
tlb, 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/selftests/vm/userfaultfd.c
index 1f
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/userfaultfd.c
+++ b
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 +---
mm
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/userfaultfd.c | 16
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
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 insertions(+), 8
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
, 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...@google.com/T/#t
Axel Rasmussen (9):
userf
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 apply thi
tlb, 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/selftests/vm/userfaultfd.c
index 4b
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
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 insertions
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/userfaultfd.c | 18
, 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/tools
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/userfaultfd.c
+++ b
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
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 | 10
.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
userfaultfd/shmem: support minor fault registration for shmem
u
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 skip so
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:
>
;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 ++
3 files changed, 168 insertion
- 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 Rasmussen
---
mm/shmem.c | 56 +
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
factor 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 ("userfaultfd: support minor fault handling for shmem"
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/testing/selftests/vm/userfaultfd.c | 12 +
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: Axel Rasmusse
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 for
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(+)
diff
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
The valid selector is 0 ~ 0xbf, so the .n_voltages should be 0xc0.
Signed-off-by: Axel Lin
---
drivers/regulator/mt6315-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/mt6315-regulator.c
b/drivers/regulator/mt6315-regulator.c
index fc7654624dd6
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-03-08
+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
. This 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
more things, e.g. UFFDIO_COPY_MODE_WP; and also on how to resolve a
> wr-protect page fault.
>
> There're two features missing in current manpage, namely:
>
> (1) Userfaultfd Thread-ID feature
> (2) Userfaultfd write protect mode
>
> There's also a 3rd one which was just co
Leilk Liu 於 2021年3月3日 週三 上午10:57寫道:
>
> From: "leilk.liu"
>
> It is wanted to use MTK spi bus driver with GPL-2.0 or MIT license.
> But now it is only licensed as GPL-2.0, so re-license it as dual
> MIT/GPL.
>
> Signed-off-by: leilk.liu
Acked-by: Axel Lin
. This 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
, 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/tools
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/userfaultfd.c | 35
tlb, 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/selftests/vm/userfaultfd.c
index 4a
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 alias mappings in the shmem test
userfaul
eviewed-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/hugetlb.c
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
INUE 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
-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
@@ -134,11
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(+), 3
eries 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.
Axel Rasmussen (6):
userfaultfd: add minor fault registration mode
userfaultfd: disable huge PMD sharing for MINOR
ps://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
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);
> >
>
tlb, 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/selftests/vm/userfaultfd.c
index 4a
. This 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/tools
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
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/userfaultfd.c | 35
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
userfaultfd/selftests: create alias
INUE 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
IO_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_active() on
it.)
ps://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 +++
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 --git
-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
@@ -134,11
IO_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 hugetlbfs. There is no reason it can't work
with shmem, but I expect hugetlbfs to be much more commonly used
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;
> >
IO_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_active() on
it.)
-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
@@ -134,11
1 - 100 of 3022 matches
Mail list logo