mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v8 00/10] futex: Create {set,get}_robust_list2() syscalls
@ 2026-11-15 17:31 André Almeida
  2026-11-15 17:31 ` [PATCH v8 01/10] futex: Skip test_futex_robust_unlock() if not supported André Almeida
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: André Almeida @ 2026-11-15 17:31 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Darren Hart, Davidlohr Bueso,
	Arnd Bergmann, Sebastian Andrzej Siewior, Waiman Long,
	Ryan Houdek, Thomas Gleixner
  Cc: linux-kernel, linux-kselftest, linux-api, kernel-dev, André Almeida

Hello,

Now that we mostly fixed the op_pending race condition, I believe it's time to
continue the new syscall work. This patchset is adapted to the robust_try_unlock
mechanics.

 * Use case

The use-case for the new syscalls is detailed in the last patch version:

  https://lore.kernel.org/lkml/20250626-tonyk-robust_futex-v5-0-179194dbde8f@igalia.com

 * The syscall interface

Documented at patches 3/9 "futex: Create set_robust_list2() syscall" and
4/9 "futex: Create get_robust_list2() syscall".

 * Testing

I expanded the current robust list selftest to use the new interface,
and also ported the original syscall to use the new syscall internals,
and everything survived the tests. Tested on both x86 and arm64.

 * Changelog

Changes from v7:
- Expanded the selftest for more corner cases and error handling
- Fix a lot of Sashiko findings, including:
- Refactor handling of 32-bit lists in get_robust_list2 
- Fix legacy 32-bit list creation overwritting 64-bit list
- Fix 32-bit list never getting cleared
- Fix corrupting error code
- Fix logic for modifying list elements
- Link to v7: https://patch.msgid.link/20260925-tonyk-robust_futex-v7-0-d1095991152c@igalia.com

Changes from v6:
 - Interface now uses CREATE/MODIFY semantics instead of SET. This allows to
 both libc and app to use the lists without conflicts.
 - Rebased on top of mainline, including the new VDSO changes
 - v6: https://lore.kernel.org/r/20251122-tonyk-robust_futex-v6-0-05fea005a0fd@igalia.com

Changes from v5:
 - Complete interface rewrite, there are so many changes but the main
   ones are the following points
 - Array of robust lists now has a static size, allocated once during the
   first usage of the list
 - Now that the list of robust lists have a fixed size, I removed the
   logic of having a command for creating a new index on the list. To
   simplify things for everyone, userspace just need to call
   set_robust_list2(head, 32-bit/64-bit type, index).
 - Created get_robust_list2()
 - The new code can be better integrated with the original interface
 - v5: https://lore.kernel.org/r/20250626-tonyk-robust_futex-v5-0-179194dbde8f@igalia.com

Feedback is very welcomed!

---
André Almeida (10):
      futex: Skip test_futex_robust_unlock() if not supported
      futex: Use explicit sizes for compat_robust_list structs
      futex: Make exit_robust_list32() unconditionally available for 64-bit kernels
      futex: Create set_robust_list2() syscall
      futex: Create get_robust_list2() syscall
      futex: Wire up set_robust_list2 syscall
      futex: Wire up get_robust_list2 syscall
      selftests/futex: Expand for set_robust_list2()
      selftests/futex: Expand for get_robust_list2()
      futex: Use new robust list API internally

 arch/alpha/kernel/syscalls/syscall.tbl             |   2 +
 arch/arm/tools/syscall.tbl                         |   2 +
 arch/m68k/kernel/syscalls/syscall.tbl              |   2 +
 arch/microblaze/kernel/syscalls/syscall.tbl        |   2 +
 arch/mips/kernel/syscalls/syscall_n32.tbl          |   2 +
 arch/mips/kernel/syscalls/syscall_n64.tbl          |   2 +
 arch/mips/kernel/syscalls/syscall_o32.tbl          |   2 +
 arch/parisc/kernel/syscalls/syscall.tbl            |   2 +
 arch/powerpc/kernel/syscalls/syscall.tbl           |   2 +
 arch/s390/kernel/syscalls/syscall.tbl              |   2 +
 arch/sh/kernel/syscalls/syscall.tbl                |   2 +
 arch/sparc/kernel/syscalls/syscall.tbl             |   2 +
 arch/x86/entry/syscalls/syscall_32.tbl             |   2 +
 arch/x86/entry/syscalls/syscall_64.tbl             |   2 +
 arch/xtensa/kernel/syscalls/syscall.tbl            |   2 +
 include/linux/compat.h                             |  13 +-
 include/linux/futex.h                              |  24 +
 include/linux/futex_types.h                        |   9 +-
 include/uapi/asm-generic/unistd.h                  |   7 +-
 include/uapi/linux/futex.h                         |  28 +
 kernel/futex/core.c                                | 196 +++++--
 kernel/futex/futex.h                               |   5 +
 kernel/futex/syscalls.c                            | 158 +++++-
 kernel/sys_ni.c                                    |   2 +
 scripts/syscall.tbl                                |   2 +
 .../selftests/futex/functional/robust_list.c       | 626 +++++++++++++++++++--
 26 files changed, 976 insertions(+), 124 deletions(-)
---
base-commit: 9f74092fda91ef93c2b07585785c1dc83cd7971f
change-id: 20250225-tonyk-robust_futex-60adeedac695

Best regards,
--  
André Almeida <andrealmeid@igalia.com>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-11-15 21:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-15 17:31 [PATCH v8 00/10] futex: Create {set,get}_robust_list2() syscalls André Almeida
2026-11-15 17:31 ` [PATCH v8 01/10] futex: Skip test_futex_robust_unlock() if not supported André Almeida
2026-11-15 17:31 ` [PATCH v8 02/10] futex: Use explicit sizes for compat_robust_list structs André Almeida
2026-11-15 17:31 ` [PATCH v8 03/10] futex: Make exit_robust_list32() unconditionally available for 64-bit kernels André Almeida
2026-11-15 17:31 ` [PATCH v8 04/10] futex: Create set_robust_list2() syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 05/10] futex: Create get_robust_list2() syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 06/10] futex: Wire up set_robust_list2 syscall André Almeida
2026-11-15 20:55   ` kernel test robot
2026-11-15 21:30   ` kernel test robot
2026-11-15 17:31 ` [PATCH v8 07/10] futex: Wire up get_robust_list2 syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 08/10] selftests/futex: Expand for set_robust_list2() André Almeida
2026-11-15 17:31 ` [PATCH v8 09/10] selftests/futex: Expand for get_robust_list2() André Almeida
2026-11-15 17:31 ` [PATCH v8 10/10] futex: Use new robust list API internally André Almeida
2026-11-15 20:44   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®