[2/2] lowlevellock-futex: Remove not used macros

Message ID 20201201121727.25155-2-lukma@denx.de
State Committed
Commit 135ca0a7cd08a9e86e6e0dabe0ef560a4bdac9be
Headers
Series [1/2] futex: Remove not used futex_reltimed_wait{_cancelable} |

Commit Message

Lukasz Majewski Dec. 1, 2020, 12:17 p.m. UTC
  Following macros: lll_futex_timed_lock_pi, lll_futex_clock_wait_bitset,
lll_futex_wait_requeue_pi, lll_futex_timed_wait_requeue_pi are not
used anymore so are eligible for removal.

Build tests:
./src/scripts/build-many-glibcs.py glibcs
---
 sysdeps/nptl/lowlevellock-futex.h | 43 -------------------------------
 1 file changed, 43 deletions(-)
  

Comments

Adhemerval Zanella Netto Dec. 1, 2020, 12:52 p.m. UTC | #1
On 01/12/2020 09:17, Lukasz Majewski wrote:
> Following macros: lll_futex_timed_lock_pi, lll_futex_clock_wait_bitset,
> lll_futex_wait_requeue_pi, lll_futex_timed_wait_requeue_pi are not
> used anymore so are eligible for removal.
> 
> Build tests:
> ./src/scripts/build-many-glibcs.py glibcs

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/nptl/lowlevellock-futex.h | 43 -------------------------------
>  1 file changed, 43 deletions(-)
> 
> diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
> index 2209ca76a1..d09e9a8749 100644
> --- a/sysdeps/nptl/lowlevellock-futex.h
> +++ b/sysdeps/nptl/lowlevellock-futex.h
> @@ -94,28 +94,6 @@
>  # define lll_futex_supported_clockid(clockid)			\
>    ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC)
>  
> -/* The kernel currently only supports CLOCK_MONOTONIC or
> -   CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET.  We could attempt to
> -   convert others here but currently do not.  */
> -# define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \
> -  ({									\
> -    long int __ret;							\
> -    if (lll_futex_supported_clockid (clockid))                          \
> -      {                                                                 \
> -        const unsigned int clockbit =                                   \
> -          (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0;       \
> -        const int op =                                                  \
> -          __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private);   \
> -                                                                        \
> -        __ret = lll_futex_syscall (6, futexp, op, val,                  \
> -                                   timeout, NULL /* Unused.  */,	\
> -                                   FUTEX_BITSET_MATCH_ANY);		\
> -      }                                                                 \
> -    else                                                                \
> -      __ret = -EINVAL;							\
> -    __ret;								\
> -  })
> -
>  /* Wake up up to NR waiters on FUTEXP.  */
>  # define lll_futex_wake(futexp, nr, private)                             \
>    lll_futex_syscall (4, futexp,                                         \
> @@ -138,32 +116,11 @@
>  		     FUTEX_OP_CLEAR_WAKE_IF_GT_ONE)
>  
>  
> -/* Priority Inheritance support.  */
> -#define lll_futex_timed_lock_pi(futexp, abstime, private) 		\
> -  lll_futex_syscall (4, futexp,						\
> -		     __lll_private_flag (FUTEX_LOCK_PI, private),	\
> -		     0, abstime)
> -
>  #define lll_futex_timed_unlock_pi(futexp, private) 			\
>    lll_futex_syscall (4, futexp,						\
>  		     __lll_private_flag (FUTEX_UNLOCK_PI, private),	\
>  		     0, 0)
>  
> -/* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
> -   that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
> -   be used to do the wakeup.  Confers priority-inheritance behavior on
> -   the waiter.  */
> -# define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
> -  lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
> -
> -/* Like lll_futex_wait_requeue_pi, but with a timeout.  */
> -# define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
> -                                        mutex, private)                 \
> -  lll_futex_syscall (5, futexp,                                         \
> -		     __lll_private_flag (FUTEX_WAIT_REQUEUE_PI          \
> -					 | (clockbit), private),        \
> -		     val, timeout, mutex)
> -
>  /* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
>     and inherits priority from the waiter.  */
>  # define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex,       \
>
  
Alistair Francis Dec. 1, 2020, 4:47 p.m. UTC | #2
On Tue, Dec 1, 2020 at 4:18 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> Following macros: lll_futex_timed_lock_pi, lll_futex_clock_wait_bitset,
> lll_futex_wait_requeue_pi, lll_futex_timed_wait_requeue_pi are not
> used anymore so are eligible for removal.
>
> Build tests:
> ./src/scripts/build-many-glibcs.py glibcs

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  sysdeps/nptl/lowlevellock-futex.h | 43 -------------------------------
>  1 file changed, 43 deletions(-)
>
> diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
> index 2209ca76a1..d09e9a8749 100644
> --- a/sysdeps/nptl/lowlevellock-futex.h
> +++ b/sysdeps/nptl/lowlevellock-futex.h
> @@ -94,28 +94,6 @@
>  # define lll_futex_supported_clockid(clockid)                  \
>    ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC)
>
> -/* The kernel currently only supports CLOCK_MONOTONIC or
> -   CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET.  We could attempt to
> -   convert others here but currently do not.  */
> -# define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \
> -  ({                                                                   \
> -    long int __ret;                                                    \
> -    if (lll_futex_supported_clockid (clockid))                          \
> -      {                                                                 \
> -        const unsigned int clockbit =                                   \
> -          (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0;       \
> -        const int op =                                                  \
> -          __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private);   \
> -                                                                        \
> -        __ret = lll_futex_syscall (6, futexp, op, val,                  \
> -                                   timeout, NULL /* Unused.  */,       \
> -                                   FUTEX_BITSET_MATCH_ANY);            \
> -      }                                                                 \
> -    else                                                                \
> -      __ret = -EINVAL;                                                 \
> -    __ret;                                                             \
> -  })
> -
>  /* Wake up up to NR waiters on FUTEXP.  */
>  # define lll_futex_wake(futexp, nr, private)                             \
>    lll_futex_syscall (4, futexp,                                         \
> @@ -138,32 +116,11 @@
>                      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE)
>
>
> -/* Priority Inheritance support.  */
> -#define lll_futex_timed_lock_pi(futexp, abstime, private)              \
> -  lll_futex_syscall (4, futexp,                                                \
> -                    __lll_private_flag (FUTEX_LOCK_PI, private),       \
> -                    0, abstime)
> -
>  #define lll_futex_timed_unlock_pi(futexp, private)                     \
>    lll_futex_syscall (4, futexp,                                                \
>                      __lll_private_flag (FUTEX_UNLOCK_PI, private),     \
>                      0, 0)
>
> -/* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
> -   that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
> -   be used to do the wakeup.  Confers priority-inheritance behavior on
> -   the waiter.  */
> -# define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
> -  lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
> -
> -/* Like lll_futex_wait_requeue_pi, but with a timeout.  */
> -# define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
> -                                        mutex, private)                 \
> -  lll_futex_syscall (5, futexp,                                         \
> -                    __lll_private_flag (FUTEX_WAIT_REQUEUE_PI          \
> -                                        | (clockbit), private),        \
> -                    val, timeout, mutex)
> -
>  /* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
>     and inherits priority from the waiter.  */
>  # define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex,       \
> --
> 2.20.1
>
  

Patch

diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h
index 2209ca76a1..d09e9a8749 100644
--- a/sysdeps/nptl/lowlevellock-futex.h
+++ b/sysdeps/nptl/lowlevellock-futex.h
@@ -94,28 +94,6 @@ 
 # define lll_futex_supported_clockid(clockid)			\
   ((clockid) == CLOCK_REALTIME || (clockid) == CLOCK_MONOTONIC)
 
-/* The kernel currently only supports CLOCK_MONOTONIC or
-   CLOCK_REALTIME timeouts for FUTEX_WAIT_BITSET.  We could attempt to
-   convert others here but currently do not.  */
-# define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \
-  ({									\
-    long int __ret;							\
-    if (lll_futex_supported_clockid (clockid))                          \
-      {                                                                 \
-        const unsigned int clockbit =                                   \
-          (clockid == CLOCK_REALTIME) ? FUTEX_CLOCK_REALTIME : 0;       \
-        const int op =                                                  \
-          __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private);   \
-                                                                        \
-        __ret = lll_futex_syscall (6, futexp, op, val,                  \
-                                   timeout, NULL /* Unused.  */,	\
-                                   FUTEX_BITSET_MATCH_ANY);		\
-      }                                                                 \
-    else                                                                \
-      __ret = -EINVAL;							\
-    __ret;								\
-  })
-
 /* Wake up up to NR waiters on FUTEXP.  */
 # define lll_futex_wake(futexp, nr, private)                             \
   lll_futex_syscall (4, futexp,                                         \
@@ -138,32 +116,11 @@ 
 		     FUTEX_OP_CLEAR_WAKE_IF_GT_ONE)
 
 
-/* Priority Inheritance support.  */
-#define lll_futex_timed_lock_pi(futexp, abstime, private) 		\
-  lll_futex_syscall (4, futexp,						\
-		     __lll_private_flag (FUTEX_LOCK_PI, private),	\
-		     0, abstime)
-
 #define lll_futex_timed_unlock_pi(futexp, private) 			\
   lll_futex_syscall (4, futexp,						\
 		     __lll_private_flag (FUTEX_UNLOCK_PI, private),	\
 		     0, 0)
 
-/* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
-   that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
-   be used to do the wakeup.  Confers priority-inheritance behavior on
-   the waiter.  */
-# define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
-  lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
-
-/* Like lll_futex_wait_requeue_pi, but with a timeout.  */
-# define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
-                                        mutex, private)                 \
-  lll_futex_syscall (5, futexp,                                         \
-		     __lll_private_flag (FUTEX_WAIT_REQUEUE_PI          \
-					 | (clockbit), private),        \
-		     val, timeout, mutex)
-
 /* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
    and inherits priority from the waiter.  */
 # define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex,       \