[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1422573326.2005.7.camel@stgolabs.net>
Date: Thu, 29 Jan 2015 15:15:26 -0800
From: Davidlohr Bueso <dave@...olabs.net>
To: Jason Low <jason.low2@...com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Michel Lespinasse <walken@...gle.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] locking/rwsem: Avoid deceiving lock spinners
On Thu, 2015-01-29 at 12:18 -0800, Jason Low wrote:
> /*
> - * We break out the loop above on need_resched() and when the
> - * owner changed, which is a sign for heavy contention. Return
> - * success only when lock->owner is NULL.
> + * We break out the loop above on either need_resched(), when
> + * the owner is not running, or when the lock owner changed.
> + * Return success only when the lock owner changed.
> */
> - return lock->owner == NULL;
> + return lock->owner != owner;
> }
Ideally we would refactor all this, along with getting rid of
owner_running() at some point. It no longer makes sense to split up
mutex_spin_on_owner() and we're doing duplicate owner checks. It would
also be simpler than having to guess why we broke out of the loop, for
example.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists