[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190718110928.GT3463@hirez.programming.kicks-ass.net>
Date: Thu, 18 Jul 2019 13:09:28 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jan Stancek <jstancek@...hat.com>
Cc: Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
linux-kernel@...r.kernel.org, dbueso@...e.de, mingo@...hat.com,
jade alglave <jade.alglave@....com>, paulmck@...ux.vnet.ibm.com
Subject: Re: [PATCH v2] locking/rwsem: add acquire barrier to read_slowpath
exit when queue is empty
It's simpler like so:
On Thu, Jul 18, 2019 at 01:04:46PM +0200, Peter Zijlstra wrote:
> X = 0;
>
> rwsem_down_read()
> for (;;) {
> set_current_state(TASK_UNINTERRUPTIBLE);
>
> X = 1;
> rwsem_up_write();
> rwsem_mark_wake()
> atomic_long_add(adjustment, &sem->count);
> smp_store_release(&waiter->task, NULL);
>
> if (!waiter.task)
> break;
>
> ...
> }
>
> r = X;
>
Powered by blists - more mailing lists