[v1,00/14] futex: More futex2 bits

Message ID 20230721102237.268073801@infradead.org
Headers
Series futex: More futex2 bits |

Message

Peter Zijlstra July 21, 2023, 10:22 a.m. UTC
  Hi,

New version of the futex2 patches. These are actually tested and appear to work
as expected.

I'm hoping to get at least the first 3 patches merged such that Jens can base
the io_uring futex patches on them.


Changes since v0:
 - switched over to 'unsigned long' for values (Arnd)
 - unshare vmalloc_huge() (Willy)
 - added wait/requeue syscalls
 - fixed NUMA to support sparse nodemask
 - added FUTEX2_n vs FUTEX2_NUMA check to ensure
   the node_id fits in the futex
 - added selftests
 - fixed a ton of silly bugs

---
 arch/alpha/kernel/syscalls/syscall.tbl             |   3 +
 arch/arm/tools/syscall.tbl                         |   3 +
 arch/arm64/include/asm/unistd32.h                  |   6 +
 arch/ia64/kernel/syscalls/syscall.tbl              |   3 +
 arch/m68k/kernel/syscalls/syscall.tbl              |   3 +
 arch/microblaze/kernel/syscalls/syscall.tbl        |   3 +
 arch/mips/kernel/syscalls/syscall_n32.tbl          |   3 +
 arch/mips/kernel/syscalls/syscall_n64.tbl          |   3 +
 arch/mips/kernel/syscalls/syscall_o32.tbl          |   3 +
 arch/parisc/kernel/syscalls/syscall.tbl            |   3 +
 arch/powerpc/kernel/syscalls/syscall.tbl           |   3 +
 arch/s390/kernel/syscalls/syscall.tbl              |   3 +
 arch/sh/kernel/syscalls/syscall.tbl                |   3 +
 arch/sparc/kernel/syscalls/syscall.tbl             |   3 +
 arch/x86/entry/syscalls/syscall_32.tbl             |   3 +
 arch/x86/entry/syscalls/syscall_64.tbl             |   3 +
 arch/xtensa/kernel/syscalls/syscall.tbl            |   3 +
 include/linux/futex.h                              |  14 +-
 include/linux/syscalls.h                           |  10 +
 include/linux/vmalloc.h                            |   1 +
 include/uapi/asm-generic/unistd.h                  |   9 +-
 include/uapi/linux/futex.h                         |  17 +-
 kernel/futex/core.c                                | 144 +++++++++++---
 kernel/futex/futex.h                               |  96 ++++++++-
 kernel/futex/pi.c                                  |  12 +-
 kernel/futex/requeue.c                             |  18 +-
 kernel/futex/syscalls.c                            | 221 ++++++++++++++++-----
 kernel/futex/waitwake.c                            |  80 ++++----
 kernel/sys_ni.c                                    |   3 +
 mm/vmalloc.c                                       |   7 +
 .../selftests/futex/functional/futex_requeue.c     | 100 +++++++++-
 .../selftests/futex/functional/futex_wait.c        |  56 +++++-
 .../futex/functional/futex_wait_timeout.c          |  14 +-
 .../futex/functional/futex_wait_wouldblock.c       |  28 ++-
 .../selftests/futex/functional/futex_waitv.c       |  15 +-
 tools/testing/selftests/futex/functional/run.sh    |   6 +
 tools/testing/selftests/futex/include/futex2test.h |  39 ++++
 37 files changed, 777 insertions(+), 167 deletions(-)
  

Comments

Jens Axboe July 21, 2023, 2:42 p.m. UTC | #1
On 7/21/23 4:22?AM, Peter Zijlstra wrote:
> Hi,
> 
> New version of the futex2 patches. These are actually tested and appear to work
> as expected.
> 
> I'm hoping to get at least the first 3 patches merged such that Jens can base
> the io_uring futex patches on them.

First 4 now, as we'll need the validate patch as well!
  
Arnd Bergmann July 21, 2023, 3:49 p.m. UTC | #2
On Fri, Jul 21, 2023, at 12:22, Peter Zijlstra wrote:
> Hi,
>
> New version of the futex2 patches. These are actually tested and appear to work
> as expected.
>
> I'm hoping to get at least the first 3 patches merged such that Jens can base
> the io_uring futex patches on them.
>
>
> Changes since v0:
>  - switched over to 'unsigned long' for values (Arnd)
>  - unshare vmalloc_huge() (Willy)
>  - added wait/requeue syscalls
>  - fixed NUMA to support sparse nodemask
>  - added FUTEX2_n vs FUTEX2_NUMA check to ensure
>    the node_id fits in the futex
>  - added selftests
>  - fixed a ton of silly bugs

The changes look good to me, and the ABI should be fine without
special compat handler now. I sent a couple of minor comments, but
nothing important.

     Arnd