Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755616Ab3FKRfz (ORCPT ); Tue, 11 Jun 2013 13:35:55 -0400 Received: from mail-vb0-f54.google.com ([209.85.212.54]:53032 "EHLO mail-vb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421Ab3FKRfy (ORCPT ); Tue, 11 Jun 2013 13:35:54 -0400 MIME-Version: 1.0 In-Reply-To: <20130611170249.GA1091@linux.vnet.ibm.com> References: <20130609193657.GA13392@linux.vnet.ibm.com> <20130611170249.GA1091@linux.vnet.ibm.com> Date: Tue, 11 Jun 2013 10:35:53 -0700 X-Google-Sender-Auth: Mq0ci6vgsWKgBcASGFW2qfMzHKU Message-ID: Subject: Re: [PATCH RFC ticketlock] v2 Auto-queued ticketlock From: Linus Torvalds To: Paul McKenney Cc: Linux Kernel Mailing List , Ingo Molnar , =?UTF-8?B?6LWW5rGf5bGx?= , Dipankar Sarma , Andrew Morton , Mathieu Desnoyers , Josh Triplett , niv@us.ibm.com, Thomas Gleixner , Peter Zijlstra , Steven Rostedt , Valdis Kletnieks , David Howells , Eric Dumazet , Darren Hart , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Silas Boyd-Wickizer , Michel Lespinasse , Waiman Long Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 834 Lines: 24 Hmm. Something just struck me when reading this patch.. Our memory ordering semantics in our *current* locks are very very subtle. We have just a "barrier()" between the inc.head = ACCESS_ONCE(lock->tickets.head); if (inc.head == inc.tail) break; /* success */ and the inside of the locked region. I think it's safe because of the new memory ordering semantics (loads are in-order, and stores only move *down*), but there's not even a comment about it. So let's at least comment the current locks before making them even more complex and subtle.. Linus -- 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/