Re: [PATCH v4 3/3] qspinlock, x86: Add x86 specific optimization for 2 contending tasks

From: Waiman Long
Date: Fri Feb 21 2014 - 20:39:55 EST


On 02/21/2014 12:28 PM, Peter Zijlstra wrote:
On Mon, Feb 17, 2014 at 03:41:24PM -0500, Waiman Long wrote:
+ struct {
+ u8 lock; /* Lock bit */
+ u8 wait; /* Waiting bit */
+ u16 qcode; /* Queue code */
+ };
16 bit code would result in 14 bits for the CPU number, that's only 16k,
I think SGI actually had a machine with that many CPUs in.


If NR_CPUS >= 16k, the 2-task optimized code path will be disabled. However, with that many CPUs, it is high spinlock contention behavior that is more important than a bit better performance at low contention level.

-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/