From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F186733507C for ; Fri, 31 Jul 2026 04:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785473956; cv=none; b=GN9lHQPw647ZBx0yOUbvMvRF8sXRm93WenxIyV/TwSA2dHFRj6LDmLFJTBHSmjnMcVVUa/l/J+ynUu55v5R3rr5Nsqe5Ug0ilTa8jEK0tuQIbsuqMBtWoac7WEtmvVY7L2ALiyWVJNLkSeQOb1bmS/wqhXLDdK5cuIMWlDYY5/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785473956; c=relaxed/simple; bh=eUJmQbGjZa5awyRXhsBABDx+2T5gliMF7xxhmFBBhPA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fO+CO3lLf5AU5U4rnxbkPnVApelYXkZRrxIZtmArikad+tESt3maxOyHzOrbf/EXFyYcOdqABc+wo/xEojrcdusl53pBFBm7BhVCLSRCXc7lezDzDDyKa7AJRjnWftsyZ0W+QRkdq9d4pGSQzu8g7jGLi+8bW2mMPc6OLdAxyyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IOSt66wf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IOSt66wf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBDE51F000E9; Fri, 31 Jul 2026 04:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785473954; bh=a999mUVEywWRQZPkmOa+G1jSM9VJYIVya6xi8BuT0Vs=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=IOSt66wfK06lO8C5JtXJp6Wa67OHg+dxdOMKJkCnd7tFDmoSzoeKuLii6OMZKWzeh 66Fsdv5CLRbq+01vCQVbhB+q8SDPnR+Goc0P51NrYna0WKtwaTJhkLWBp5fKk8AywH 8YZSXUn7T+e+x8u9oZky+Ykdwf9YQsA1OTRIt1EY3EW2mhvlMbPYd2f9WoP92cf3lQ K3Gy9q+lCBLEzlnE+iGrimARFdNuBqbCojNRARv3Vfxwgrbe0yzw92WEerz0FH/KoT ebe483y+ckTC25KKOHqzhlie0cp9+sQD0rmGVM8g6im1rgK9wyXhX48/2DdR5dcLw+ kye+0KOjh7JAA== Message-ID: <7269d45e-93ea-450a-912b-d1ba6ba6eb8b@kernel.org> Date: Fri, 31 Jul 2026 06:59:07 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/1] powerpc: enable dynamic preemption To: Segher Boessenkool , "Paul E. McKenney" Cc: Shrikanth Hegde , Jirka Hladky , maddy@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, npiggin@gmail.com, bigeasy@linutronix.de, will@kernel.org, linux-kernel@vger.kernel.org References: <29a407ab-268e-4443-96dc-8f5f933cb63c@linux.ibm.com> <529b8d9f-54a0-4ec2-9886-83cd528e5e04@paulmck-laptop> <57d9de4a-65aa-44cf-9024-de4e5bdd1971@linux.ibm.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 30/07/2026 à 20:40, Segher Boessenkool a écrit : > On Thu, Jul 30, 2026 at 10:26:58AM -0700, Paul E. McKenney wrote: >> On Thu, Jul 30, 2026 at 10:40:38PM +0530, Shrikanth Hegde wrote: >>> Barrier are in core implementation, not in arch specific. > > "Compiler barrier"s are not actually a thing, it is not a barrier for > anything. It's just telling the compiler that at the point of the > "barrier" all the registers should hold the values that they > conceptually do also *actually*. > > (In theory the compiler can sometimes prove it can do things that do not > even guarantee that, but in practice this holds). > >> But barrier() is just "__asm__ __volatile__("": : :"memory")", which >> does not emit any instructions. Or is this doing more machine-register >> flushing/restoring than one might expect? > > (__volatile__ is redundant, any asm without outputs is always counted as > volatile. If this wasn't true, GCC could always delete any such asm, > since it has no side effects at all! There is a comment for the volatile: /* Optimization barrier */ #ifndef barrier /* The "volatile" is due to gcc bugs */ # define barrier() __asm__ __volatile__("": : :"memory") #endif > > People often think "volatile" asm is some magic that prohibits the > compiler from optimising stuff, but it is not, it has very contrained > and very specific meaning). > > Nope. The "memory" clobber says that all memory can be read and written > in that asm, so any value that conceptually resides in memory there > should have a stable value there. This can trigger some save/restore > stuff, sure, but on all Power ABIs we have actual registers for pretty > much everything, so nothing at all is done here. > > > Segher