Re: [PATCH RFC ticketlock] Auto-queued ticketlock

From: Waiman Long
Date: Fri Jun 14 2013 - 23:37:08 EST


On 06/14/2013 09:26 PM, Benjamin Herrenschmidt wrote:
On Fri, 2013-06-14 at 14:17 -0400, Waiman Long wrote:
With some minor changes, the current patch can be modified to support
debugging lock for 32-bit system. For 64-bit system, we can apply a
similar concept for debugging lock with cmpxchg_double. However, for
architecture that does not have cmpxchg_double support, it will be out
of luck and we probably couldn't support the same feature in debugging
mode. It will have to fall back to taking the lock.
That means only x86_64 and s390 would benefit from it ... I'm sure we can do better :-)

Cheers,
Ben.

On second thought, using cmpxchg_double may not be such a good idea after all as it requires a 16-byte alignment, at least for x86-64. Another possible alternative is to integrate the reference count directly into the spinlock_t data structure immediately after arch_spinlock_t for this special case. If CONFIG_GENERIC_LOCKBREAK is not defined, there will be a 4-byte hole that can be used. Otherwise, the spinlock_t structure will have an 8 byte size increase. I suppose that others won't be too upset for an 8-byte increase in size when spinlock debugging is turned on.

Regards,
Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/