Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3495538imu; Mon, 28 Jan 2019 06:00:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN5fS6Hr6edDGfR5ria2pB2MgoP8xzmr7B/qe9XFq1+be7UIlAbtCFpasX7h56T9k9EKPkRY X-Received: by 2002:a63:dc0c:: with SMTP id s12mr20173090pgg.398.1548684002863; Mon, 28 Jan 2019 06:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548684002; cv=none; d=google.com; s=arc-20160816; b=cmzfFVICqiMecU17BmLLaRO1hwFw/H0+IotfL0nol2irv8nJOZ6dl6S+XJwcoouUZy IyO6Nc/X+SN/PQOT7JaFvp8iQdpuVeuWVvUYEImc+M7MANMxWHzH+/F30cPTZHtxr6DO LCmrpNziLlfxnGvZdBT8Pgi+jeIJ4KaFoeYYbEVwzJzhl7D++t5slYtgM3vCdwCbzlSU macMzm6ITmgK//GwNMCjRZNPBQk0JAjQY5jbUteOQ4y5FUpaVhNnmWmV0KDMoovGvRXf Jp/Ju6rYUTG9wJWtjTIJiuc7T63T6/oWQLX6N7EoQ/J8wq3F1LK0LrsDDrQRmFe0K1UG z9IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CbSKuq8gbOVSeLddKe0qvIRvpEXxj8L97la8Qvn8jgo=; b=I38pj2J+jGH1juv4cDsZFAqH/xPJ553a2if7ygY63yizw6xN2ReMKt9D61dQDBcmqJ CgHgfdDxLPwH/6KMR3zhxhoy1m3Z4nEAMrFhqQg8XBzzghglbnWBHWwilNOKqGgcGYdS S7bedWdlohSC1iikFks9ocm7c+rXJP8qvYEC9R0lQmreuXLku+YMFn6c6kHZ9Dd+Iuds d7aoArNO/T0crKMI1xgM4PtaomHCwX0bJfUf8zOAI/qZOQYeH4myfPu7fT6fH1WlioJz 1ioHIzIeeH3naw/j8RcLah4UM4wpTRoUWiqEjZHSAsZGwchmUbsX5ZxL6s1BBbyp6qeq S17g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WY88YdWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13si11924798pgw.472.2019.01.28.05.59.47; Mon, 28 Jan 2019 06:00:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WY88YdWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfA1N6L (ORCPT + 99 others); Mon, 28 Jan 2019 08:58:11 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36820 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbfA1N6L (ORCPT ); Mon, 28 Jan 2019 08:58:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CbSKuq8gbOVSeLddKe0qvIRvpEXxj8L97la8Qvn8jgo=; b=WY88YdWO8Y8JmXcrY81y+HAPs G3HyBzyOtTvYMy3+V4ycOvgdjitPJwXFi1VokoGoiEPSmq1PZ7J9nHwkEIs3TiKPMyjRLviKPY/PI A0Yx9niNkrX32YHvV/MdlBvYlWsyszyVWHbU9MpHOL3CfZuqZ6v+QezOmOUbhYgeggOP1cjI4RHCX 7adDwvPvL+EPKdAd52QOzl2qpnIXdAmMK/mRMYJGhObXY9p5uBFVrqEGCDqq87iplBOaBjl8iKSMI eBBUgglYhWe/WS0EE9ztxPbxzEnM5gMmwuBLl8vBBD1a6JOwjZ5x4hO5+tnU6KBLjAXaSqVGEfNnm Avk/DTWWg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1go7QN-0007PX-35; Mon, 28 Jan 2019 13:58:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D0C07201EC174; Mon, 28 Jan 2019 14:58:04 +0100 (CET) Date: Mon, 28 Jan 2019 14:58:04 +0100 From: Peter Zijlstra To: Heiko Carstens Cc: Thomas Gleixner , Ingo Molnar , Martin Schwidefsky , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Stefan Liebler Subject: Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggered Message-ID: <20190128135804.GB28878@hirez.programming.kicks-ass.net> References: <20181127081115.GB3625@osiris> <20181129112321.GB3449@osiris> <20190128134410.GA28485@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190128134410.GA28485@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 28, 2019 at 02:44:10PM +0100, Peter Zijlstra wrote: > On Thu, Nov 29, 2018 at 12:23:21PM +0100, Heiko Carstens wrote: > > > And indeed, if I run only this test case in an endless loop and do > > some parallel work (like kernel compile) it currently seems to be > > possible to reproduce the warning: > > > > while true; do time ./testrun.sh nptl/tst-robustpi8 --direct ; done > > > > within the build directory of glibc (2.28). > > Right; so that reproduces for me. > > After staring at all that for a while; trying to remember how it all > worked (or supposed to work rather), I became suspiscous of commit: > > 56222b212e8e ("futex: Drop hb->lock before enqueueing on the rtmutex") > > And indeed, when I revert that; the above reproducer no longer works (as > in, it no longer triggers in minutes and has -- so far -- held up for an > hour+ or so). > > That patch in particular allows futex_unlock_pi() to 'start' early: > > > futex_lock_pi() futex_unlock_pi() > lock hb > queue > lock wait_lock > unlock hb > lock hb > futex_top_waiter > get_pi_state > lock wait_lock > rt_mutex_proxy_start // fail > unlock wait_lock > // acquired wait_lock unlock hb > wake_futex_pi() > rt_mutex_next_owner() // whoops, no waiter > WARN and simply removing that WARN, would allow futex_unlock_pi() to spin on retry until the futex_lock_pi() CPU comes around to doing the lock hb below: > lock hb > unqueue_me_pi Which seems undesirable from a determinsm POV.