I generated the attached kernel module + userspace utility reproducer to
verify that the issue is indeed resolved in noble/linux 6.8.0-147.147
and resolute/linux 7.0.0-39.39.

With the reproducer it can be seen that the fast path is taken in the
NULL-mapping order-0 folio case now that this patch is applied. The fast
path is usable 0/512 attempts on the unpatched kernels, but can be used
on 512/512 attempts on the patched kernels. Running the reproducer on
noble/linux and resolute/linux yields the following:

noble/linux 6.8.0-146-generic
$ ./gupbench -p 512 -r 5 -i 200 1 8 32 128
page size: 4K, pages/thread: 512, reps: 5, iters: 200

get_user_pages_fast_only() verdict:
  gupfast (alloc_page+vm_insert_page): 0/512
  anon (control)                     : 512/512

pin_user_pages_fast(FOLL_WRITE) median ns/page:
 threads      gupfast         anon
       1        187.1        110.2
       8        171.2         73.1
      32        310.4        108.7
     128       1212.5        195.2

RESULT: FAIL - GUP-fast rejects NULL-mapping order-0 folios (bug
present)

noble/linux 6.8.0-147-generic
$ ./gupbench -p 512 -r 5 -i 200 1 8 32 128
page size: 4K, pages/thread: 512, reps: 5, iters: 200

get_user_pages_fast_only() verdict:
  gupfast (alloc_page+vm_insert_page): 512/512
  anon (control)                     : 512/512

pin_user_pages_fast(FOLL_WRITE) median ns/page:
 threads      gupfast         anon
       1        110.2        113.3
       8         89.9         74.1
      32        114.7        106.6
     128        177.9        209.3

RESULT: PASS - GUP-fast accepts NULL-mapping order-0 folios (fixed)

resolute/linux 7.0.0-38-generic
$ ./gupbench -p 512 -r 5 -i 200 1 8 32 128
page size: 4K, pages/thread: 512, reps: 5, iters: 200

get_user_pages_fast_only() verdict:
  gupfast (alloc_page+vm_insert_page): 0/512
  anon (control)                     : 512/512

pin_user_pages_fast(FOLL_WRITE) median ns/page:
 threads      gupfast         anon
       1        177.3        115.7
       8        153.7        117.0
      32        257.4        119.5
     128        752.7        213.2

RESULT: FAIL - GUP-fast rejects NULL-mapping order-0 folios (bug
present)

resolute/linux 7.0.0-39-generic
$ ./gupbench -p 512 -r 5 -i 200 1 8 32 128
page size: 4K, pages/thread: 512, reps: 5, iters: 200

get_user_pages_fast_only() verdict:
  gupfast (alloc_page+vm_insert_page): 512/512
  anon (control)                     : 512/512

pin_user_pages_fast(FOLL_WRITE) median ns/page:
 threads      gupfast         anon
       1        121.9        117.1
       8         93.8         84.2
      32        124.2        115.6
     128        155.0        212.5

RESULT: PASS - GUP-fast accepts NULL-mapping order-0 folios (fixed)

** Attachment added: "lp2162917-gup-fast-reproducer.tar.xz"
   
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2162917/+attachment/6007403/+files/lp2162917-gup-fast-reproducer.tar.xz

** Tags removed: verification-needed-noble-linux 
verification-needed-resolute-linux verification-needed-resolute-linux-nvidia 
verification-needed-resolute-linux-nvidia-bos
** Tags added: verification-done-noble-linux verification-done-resolute-linux 
verification-done-resolute-linux-nvidia 
verification-done-resolute-linux-nvidia-bos

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2162917

Title:
  Backport: "mm/gup: fix GUP-fast fallback for NULL-mapping order-0
  folios"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2162917/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to