On 02/19/2014 03:55 AM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 07:58:49PM -0500, Waiman Long wrote:
On 02/18/2014 04:37 PM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
+ /*
+* At the head of the wait queue now
+*/
+ whil
On 02/19/2014 03:52 AM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 07:50:13PM -0500, Waiman Long wrote:
On 02/18/2014 04:34 PM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
The #ifdef is harder to take away here. The point is that doing a 32-bit
exchang
On Tue, Feb 18, 2014 at 07:58:49PM -0500, Waiman Long wrote:
> On 02/18/2014 04:37 PM, Peter Zijlstra wrote:
> >On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
> + /*
> + * At the head of the wait queue now
> + */
> + while (true) {
> + u32 qcode;
> +
On Tue, Feb 18, 2014 at 07:50:13PM -0500, Waiman Long wrote:
> On 02/18/2014 04:34 PM, Peter Zijlstra wrote:
> >On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
> >>The #ifdef is harder to take away here. The point is that doing a 32-bit
> >>exchange may accidentally steal the lock with
On 02/18/2014 04:37 PM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
+ /*
+* At the head of the wait queue now
+*/
+ while (true) {
+ u32 qcode;
+ int retval;
+
+ retval = queue_get_lock_q
On 02/18/2014 04:34 PM, Peter Zijlstra wrote:
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
The #ifdef is harder to take away here. The point is that doing a 32-bit
exchange may accidentally steal the lock with the additional code to handle
that. Doing a 16-bit exchange, on the ot
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
> >>+ /*
> >>+* At the head of the wait queue now
> >>+*/
> >>+ while (true) {
> >>+ u32 qcode;
> >>+ int retval;
> >>+
> >>+ retval = queue_get_lock_qcode(lock,&qcode, my_qcode);
> >>+
On Tue, Feb 18, 2014 at 02:39:31PM -0500, Waiman Long wrote:
> The #ifdef is harder to take away here. The point is that doing a 32-bit
> exchange may accidentally steal the lock with the additional code to handle
> that. Doing a 16-bit exchange, on the other hand, will never steal the lock
> and s
On 02/18/2014 02:39 AM, Peter Zijlstra wrote:
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
+void queue_spin_lock_slowpath(struct qspinlock *lock, int qsval)
+{
+ unsigned int cpu_nr, qn_idx;
+ struct qnode *node, *next;
+ u32 prev_qcode, my_qcode;
+
+#ifdef queu
On 02/18/2014 02:33 AM, Peter Zijlstra wrote:
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
+#define_QCODE(lock)(atomic_read(&(lock)->qlcode)>> _QCODE_OFFSET)
+#define_QLOCK(lock)(atomic_read(&(lock)->qlcode)&
_QSPINLOCK_LOCKED)
+#define GET_QN_IDX(code)
On 02/18/2014 02:30 AM, Peter Zijlstra wrote:
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
+/*
+ * The queue node structure
+ *
+ * This structure is essentially the same as the mcs_spinlock structure
+ * in mcs_spinlock.h file. This structure is retained for future extension
+ *
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
> +void queue_spin_lock_slowpath(struct qspinlock *lock, int qsval)
> +{
> + unsigned int cpu_nr, qn_idx;
> + struct qnode *node, *next;
> + u32 prev_qcode, my_qcode;
> +
> +#ifdef queue_spin_trylock_quick
> + /*
> +
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
> +#define _QCODE(lock)(atomic_read(&(lock)->qlcode) >> _QCODE_OFFSET)
> +#define _QLOCK(lock)(atomic_read(&(lock)->qlcode) &
> _QSPINLOCK_LOCKED)
> +#define GET_QN_IDX(code) (((code) >> _QCODE_VAL_OFFSET) & 3)
> +
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
> +/*
> + * The queue node structure
> + *
> + * This structure is essentially the same as the mcs_spinlock structure
> + * in mcs_spinlock.h file. This structure is retained for future extension
> + * where new fields may be added.
> + *
This patch introduces a new queue spinlock implementation that can
serve as an alternative to the default ticket spinlock. Compared with
the ticket spinlock, this queue spinlock should be almost as fair as
the ticket spinlock. It has about the same speed in single-thread and
it can be much faster i
15 matches
Mail list logo