Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936080AbdCXUPI (ORCPT ); Fri, 24 Mar 2017 16:15:08 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34294 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935652AbdCXUO7 (ORCPT ); Fri, 24 Mar 2017 16:14:59 -0400 Date: Fri, 24 Mar 2017 21:14:39 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Dmitry Vyukov , Andrew Morton , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Paul McKenney , Thomas Gleixner , Ingo Molnar , LKML Subject: Re: locking/atomic: Introduce atomic_try_cmpxchg() Message-ID: <20170324201439.GY5680@worktop> References: <20170324142140.vpyzl755oj6rb5qv@hirez.programming.kicks-ass.net> <20170324164108.ibcxxqbhvx6ao54r@hirez.programming.kicks-ass.net> <20170324172342.radlrhk2z6mwmdgk@hirez.programming.kicks-ass.net> <20170324180838.crc2dmxswklqmyrx@hirez.programming.kicks-ass.net> <20170324181303.fnasnmtw2tmcy27u@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 592 Lines: 12 On Fri, Mar 24, 2017 at 12:16:11PM -0700, Andy Lutomirski wrote: > On Fri, Mar 24, 2017 at 11:13 AM, Peter Zijlstra wrote: > > Not to mention we cannot use the C11 atomics in kernel because we want > > to be able to runtime patch LOCK prefixes when only 1 CPU is available. > > Is this really a show-stopper? I bet that objtool could be persuaded > to emit a list of the locations of all those LOCK prefixes. Ah, but its not _all_ LOCK prefixes. Some are needed even on UP, because against hardware instead of other CPUs. Or again hypervisor instead of other vCPU.