From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753499AbcEWRxV (ORCPT ); Mon, 23 May 2016 13:53:21 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:33274 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcEWRwL (ORCPT ); Mon, 23 May 2016 13:52:11 -0400 MIME-Version: 1.0 In-Reply-To: <20160523122554.GH15728@worktop.ger.corp.intel.com> References: <20160520053926.GC31084@linux-uzut.site> <20160520115819.GF3193@twins.programming.kicks-ass.net> <20160520140533.GA20726@insomnia> <20160520152149.GH3193@twins.programming.kicks-ass.net> <20160520160436.GQ3205@twins.programming.kicks-ass.net> <20160523122554.GH15728@worktop.ger.corp.intel.com> Date: Mon, 23 May 2016 10:52:09 -0700 X-Google-Sender-Auth: FiqfrVgeRgVqLkzLXpTGtGAPr34 Message-ID: Subject: Re: sem_lock() vs qspinlocks From: Linus Torvalds To: Peter Zijlstra Cc: Boqun Feng , Davidlohr Bueso , Manfred Spraul , Waiman Long , Ingo Molnar , ggherdovich@suse.com, Mel Gorman , Linux Kernel Mailing List , Paul McKenney , Will Deacon Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 23, 2016 at 5:25 AM, Peter Zijlstra wrote: > > Paul has smp_mb__after_unlock_lock() for the RCpc 'upgrade'. How about > something like: > > smp_mb__after_lock() I'd much rather make the naming be higher level. It's not necessarily going to be a "mb", and while the problem is about smp, the primitives it is synchronizing aren't actually smp-specific (ie you're synchronizing a lock that is relevant on UP too). So I'd just call it something like spin_lock_sync_after_lock(); because different locks might have different levels of serialization (ie maybe a spinlock needs one thing, and a mutex needs another - if we start worrying about ordering between spin_lock and mutex_is_locked(), for example, or between mutex_lock() and spin_is_locked()). Hmm? Linus