mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nicolai Hähnle" <nhaehnle@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	"Nicolai Hähnle" <Nicolai.Haehnle@amd.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Maarten Lankhorst" <dev@mblankhorst.nl>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock inline wrappers
Date: Fri, 23 Dec 2016 12:16:03 +0100	[thread overview]
Message-ID: <b66b9686-2de6-59cc-8c05-c4221e3ac9b0@gmail.com> (raw)
In-Reply-To: <20161223104844.GN3107@twins.programming.kicks-ass.net>

On 23.12.2016 11:48, Peter Zijlstra wrote:
> 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.

Weird, I'm not getting that, and it makes no sense either from a quick 
glimpse of the code. Is there anything beside 
CONFIG_DEBUG_LOCKING_API_SELFTESTS I would have to enable to trigger 
this? FWIW:

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

>
>

  reply	other threads:[~2016-12-23 11:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 18:46 [PATCH v3 00/12] locking/ww_mutex: Keep sorted wait list to avoid stampedes Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 01/12] drm/vgem: Use ww_mutex_(un)lock even with a NULL context Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 02/12] locking/mutex: Fix a race with handoffs and interruptible waits Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 03/12] locking/ww_mutex: Extract stamp comparison to __ww_mutex_stamp_after Nicolai Hähnle
2016-12-22  1:58   ` zhoucm1
2016-12-22  8:43     ` Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 04/12] locking/ww_mutex: Set use_ww_ctx even when locking without a context Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 05/12] locking/ww_mutex: Remove the __ww_mutex_lock inline wrappers Nicolai Hähnle
2016-12-23 10:48   ` Peter Zijlstra
2016-12-23 11:16     ` Nicolai Hähnle [this message]
2016-12-23 12:13       ` Peter Zijlstra
2016-12-21 18:46 ` [PATCH v3 06/12] locking/ww_mutex: Add waiters in stamp order Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 07/12] locking/ww_mutex: Notify waiters that have to back off while adding tasks to wait list Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 08/12] locking/ww_mutex: Wake at most one waiter for back off when acquiring the lock Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 09/12] locking/ww_mutex: Re-check ww->ctx in the inner optimistic spin loop Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 10/12] locking/ww_mutex: Yield to other waiters from optimistic spin Nicolai Hähnle
2017-01-05 17:47   ` Peter Zijlstra
2016-12-21 18:46 ` [PATCH v3 11/12] locking/mutex: Initialize mutex_waiter::ww_ctx with poison when debugging Nicolai Hähnle
2016-12-21 18:46 ` [PATCH v3 12/12] Documentation/locking/ww_mutex: Update the design document Nicolai Hähnle

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

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

  git send-email \
    --in-reply-to=b66b9686-2de6-59cc-8c05-c4221e3ac9b0@gmail.com \
    --to=nhaehnle@gmail.com \
    --cc=Nicolai.Haehnle@amd.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=dev@mblankhorst.nl \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®