Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546815

Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock inline wrappers

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock inline wrappers
Date 2016-12-23 11:50 +0100
Message-ID <sRvAd-5K8-5@gated-at.bofh.it> (permalink)
References <sQU7D-70O-3@gated-at.bofh.it> <sQU7D-70O-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Dec 21, 2016 at 07:46:33PM +0100, Nicolai Hähnle wrote:
> diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h
> index a5960e5..b2eaaab 100644
> --- a/include/linux/ww_mutex.h
> +++ b/include/linux/ww_mutex.h
> @@ -186,11 +186,6 @@ static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
>  #endif
>  }
>  
> -extern int __must_check __ww_mutex_lock(struct ww_mutex *lock,
> -					struct ww_acquire_ctx *ctx);
> -extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
> -						      struct ww_acquire_ctx *ctx);
> -
>  /**
>   * ww_mutex_lock - acquire the w/w mutex
>   * @lock: the mutex to be acquired
> @@ -220,10 +215,8 @@ extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
>   *
>   * A mutex acquired with this function must be released with ww_mutex_unlock.
>   */
> -static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
> -{
> -	return __ww_mutex_lock(lock, ctx);
> -}
> +extern int __must_check ww_mutex_lock(struct ww_mutex *lock,
> +				      struct ww_acquire_ctx *ctx);
>  
>  /**
>   * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible
> @@ -255,11 +248,8 @@ static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ct
>   *
>   * A mutex acquired with this function must be released with ww_mutex_unlock.
>   */
> -static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
> -							   struct ww_acquire_ctx *ctx)
> -{
> -	return __ww_mutex_lock_interruptible(lock, ctx);
> -}
> +extern int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
> +						    struct ww_acquire_ctx *ctx);
>  
>  /**
>   * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex
> diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
> index a41bec2..282c6de 100644

For some reason this patch appears to make lib/locking-selftest.c really
unhappy.

I get endless streams of:

../lib/locking-selftest.c: In function ‘ww_test_fail_acquire’:
../lib/locking-selftest.c:1141:6: error: void value not ignored as it ought to be
  ret = WWL(&o, &t);
      ^

Apparently GCC gets confused about __much_check on inline functions or
something, or I got the patch wrong.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock inline wrappers Nicolai Hähnle <nhaehnle@gmail.com> - 2016-12-21 19:50 +0100
  Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock  inline wrappers Peter Zijlstra <peterz@infradead.org> - 2016-12-23 11:50 +0100
    Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock  inline wrappers Nicolai Hähnle <nhaehnle@gmail.com> - 2016-12-23 12:20 +0100
      Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock  inline wrappers Peter Zijlstra <peterz@infradead.org> - 2016-12-23 13:20 +0100

csiph-web