lkml.org 
[lkml]   [2021]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V3 50/64] locking/rtmutex: Extend the rtmutex core to support ww_mutex
On Thu, Aug 05, 2021 at 05:13:50PM +0200, Thomas Gleixner wrote:
> static __always_inline bool __waiter_less(struct rb_node *a, const struct rb_node *b)
> {
> - return rt_mutex_waiter_less(__node_2_waiter(a), __node_2_waiter(b));

Given ^

> + struct rt_mutex_waiter *aw = __node_2_waiter(a);
> + struct rt_mutex_waiter *bw = __node_2_waiter(b);
> +
> + if (rt_mutex_waiter_less(aw, bw))
> + return 1;

We can, with this new build_ww_mutex(), do:

if (!build_ww_mutex())
return 0;

here, to preserve the old behaviour.

> + if (rt_mutex_waiter_less(bw, aw))
> + return 0;
> +
> + /* NOTE: relies on waiter->ww_ctx being set before insertion */
> + if (build_ww_mutex() && aw->ww_ctx) {

Then it can go away here.

> + if (!bw->ww_ctx)
> + return 1;
> +
> + return (signed long)(aw->ww_ctx->stamp -
> + bw->ww_ctx->stamp) < 0;
> + }
> +
> + return 0;
> }

Also, I found a note that said I had to check what this code does for
!RT tasks, lemme go do that now.

\
 
 \ /
  Last update: 2021-08-06 13:03    [W:0.386 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site