From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E493C282D8 for ; Wed, 30 Jan 2019 23:55:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FBF0218FD for ; Wed, 30 Jan 2019 23:55:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbfA3Xz0 (ORCPT ); Wed, 30 Jan 2019 18:55:26 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:48411 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfA3Xz0 (ORCPT ); Wed, 30 Jan 2019 18:55:26 -0500 Received: from p5492e0d8.dip0.t-ipconnect.de ([84.146.224.216] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gozhP-0008S7-7V; Thu, 31 Jan 2019 00:55:19 +0100 Date: Thu, 31 Jan 2019 00:55:18 +0100 (CET) From: Thomas Gleixner To: "Paul E. McKenney" cc: Sebastian Sewior , Heiko Carstens , Peter Zijlstra , Ingo Molnar , Martin Schwidefsky , LKML , linux-s390@vger.kernel.org, Stefan Liebler Subject: Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggerede In-Reply-To: <20190130233557.GA4240@linux.ibm.com> Message-ID: References: <20190129171653.ycl64psq2liy5o5c@linutronix.de> <20190130094913.GC5299@osiris> <20190130125955.GD5299@osiris> <20190130132420.spwrq2d4oxeydk5s@linutronix.de> <20190130210733.mg6aascw2gzl3oqz@linutronix.de> <20190130233557.GA4240@linux.ibm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Jan 2019, Paul E. McKenney wrote: > On Thu, Jan 31, 2019 at 12:13:51AM +0100, Thomas Gleixner wrote: > > I might be wrong as usual, but this would definitely explain the fail very > > well. > > On recent versions of GCC, the fix would be to put this between the two > stores that need ordering: > > __atomic_thread_fence(__ATOMIC_RELEASE); > > I must defer to Heiko on whether s390 GCC might tear the stores. My > guess is "probably not". ;-) So I just checked the latest glibc code. It has: /* We must not enqueue the mutex before we have acquired it. Also see comments at ENQUEUE_MUTEX. */ __asm ("" ::: "memory"); ENQUEUE_MUTEX_PI (mutex); /* We need to clear op_pending after we enqueue the mutex. */ __asm ("" ::: "memory"); THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL); 8f9450a0b7a9 ("Add compiler barriers around modifications of the robust mutex list.") in the glibc repository, There since Dec 24 2016 ... So the question is whether this is sufficient. That ordering only only matters vs. the thread itself and not for others. Thanks, tglx