selftests: futex: Add futex wait test
authorAndré Almeida <andrealmeid@collabora.com>
Mon, 31 May 2021 16:50:35 +0000 (13:50 -0300)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 22 Jun 2021 09:20:15 +0000 (11:20 +0200)
commitc3d128581f64a9b3729e697a63760ff0a2c4a8fe
tree6fde0234a37794729f01a4b2741eda8b4ff902c7
parent149876d96877eedce0ae3ffbd64edb56360b8926
selftests: futex: Add futex wait test

There are three different strategies to uniquely identify a futex in the
kernel:

 - Private futexes: uses the pointer to mm_struct and the page address

 - Shared futexes: checks if the page containing the address is a PageAnon:
   - If it is, uses the same data as a private futexes
   - If it isn't, uses an inode sequence number from struct inode and
      the page's index

Create a selftest to check those three paths and basic wait/wake
mechanism.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Davidlohr Bueso <dbueso@suse.de>
Link: https://lore.kernel.org/r/20210531165036.41468-2-andrealmeid@collabora.com
tools/testing/selftests/futex/functional/.gitignore
tools/testing/selftests/futex/functional/Makefile
tools/testing/selftests/futex/functional/futex_wait.c [new file with mode: 0644]
tools/testing/selftests/futex/functional/run.sh