unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: libc-alpha@sourceware.org
Cc: Kurt Kanzenbach <kurt@linutronix.de>
Subject: [PATCH v3 1/4] Linux: Add FUTEX_LOCK_PI2
Date: Mon,  6 Sep 2021 17:47:37 -0300	[thread overview]
Message-ID: <20210906204740.3988273-2-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20210906204740.3988273-1-adhemerval.zanella@linaro.org>

From: Kurt Kanzenbach <kurt@linutronix.de>

Linux v5.14.0 introduced a new futex operation called FUTEX_LOCK_PI2.

This kernel feature can be used to implement
pthread_mutex_clocklock(MONOTONIC)/PI.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
---
 sysdeps/unix/sysv/linux/kernel-features.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 3930e14322..ffb6af196b 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -220,4 +220,12 @@
 # define __ASSUME_FACCESSAT2 0
 #endif
 
+/* The FUTEX_LOCK_PI2 operation was introduced across all architectures in Linux
+   5.14.  */
+#if __LINUX_KERNEL_VERSION >= 0x050e00
+# define __ASSUME_FUTEX_LOCK_PI2 1
+#else
+# define __ASSUME_FUTEX_LOCK_PI2 0
+#endif
+
 #endif /* kernel-features.h */
-- 
2.30.2


  reply	other threads:[~2021-09-06 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 20:47 [PATCH v3 0/4] Add CLOCK_MONOTONIC support for PI mutexes Adhemerval Zanella via Libc-alpha
2021-09-06 20:47 ` Adhemerval Zanella via Libc-alpha [this message]
2021-09-06 20:47 ` [PATCH v3 2/4] nptl: Use FUTEX_LOCK_PI2 when available Adhemerval Zanella via Libc-alpha
2021-09-06 20:47 ` [PATCH v3 3/4] support: Add support_mutex_pi_monotonic Adhemerval Zanella via Libc-alpha
2021-09-06 20:47 ` [PATCH v3 4/4] nptl: Add CLOCK_MONOTONIC support for PI mutexes Adhemerval Zanella via Libc-alpha
2021-09-27 13:48 ` [PATCH v3 0/4] " Adhemerval Zanella via Libc-alpha
2021-10-01 11:42   ` Adhemerval Zanella via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210906204740.3988273-2-adhemerval.zanella@linaro.org \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=kurt@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).