Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958Ab3DVV5J (ORCPT ); Mon, 22 Apr 2013 17:57:09 -0400 Received: from mga02.intel.com ([134.134.136.20]:33977 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753555Ab3DVV5G (ORCPT ); Mon, 22 Apr 2013 17:57:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,529,1363158000"; d="scan'208";a="322570886" From: Andi Kleen To: Rik van Riel Cc: Jiannan Ouyang , LKML , Raghavendra K T , Peter Zijlstra , Avi Kivity , Gleb Natapov , Ingo Molnar , Marcelo Tosatti , Srikar , "H. Peter Anvin" , "Nikunj A. Dadhania" , KVM , Thomas Gleixner , Chegu Vinod , "Andrew M. Theurer" , Srivatsa Vaddagiri , Andrew Jones , Karen Noel Subject: Re: Preemptable Ticket Spinlock References: <51745650.9050204@redhat.com> Date: Mon, 22 Apr 2013 14:56:44 -0700 In-Reply-To: <51745650.9050204@redhat.com> (Rik van Riel's message of "Sun, 21 Apr 2013 17:12:48 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 767 Lines: 21 Rik van Riel writes: > > If we always incremented the ticket number by 2 (instead of 1), then > we could use the lower bit of the ticket number as the spinlock. Spinning on a single bit is very inefficient, as you need to do try lock in a loop which is very unfriendly to the MESI state protocol. It's much better to have at least three states and allow spinning-while-reading-only. This is typically very visible on systems with >2S. -Andi -- ak@linux.intel.com -- Speaking for myself only -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/