Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3482318imu; Mon, 28 Jan 2019 05:44:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4zrqLLJpe556TNdeT2I2QiimwY4LVn2uEJ7GMTJF9KSa260Jh5pkB1gVYDA2zBozJP54oC X-Received: by 2002:a17:902:9b87:: with SMTP id y7mr22041490plp.336.1548683086183; Mon, 28 Jan 2019 05:44:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548683086; cv=none; d=google.com; s=arc-20160816; b=Jfkfn04I5CBGxvgoCZLmhnWRCRtEAnqhQTf5nB62e6stlpRBMtephQwFoJwCxyBWtj GsgyDP4WxVL9l83HtBodbKj+DUFafiw2F97z26oeo5GZ7yp/HfUBSjHCrIIYs9aPrHs2 uaamtYg107EII4UIyZsGyaPaMyi3bhwpJsZWq0uPTIOPfwC1mhjXV1KNjxmWUqC9k5sE oaJW149ICtEA07Hsj1rk+poRRHKoR/4blCU+jiXjymzBD9jgXrKmo7crzC4XGp6nW02o buTKIT1RtUt7F7Q7CkRDBF6eng+jBwFHIusCUNTf1g9Gxt75lrHNZN1f4fdhtfgcbqBN iE8Q== 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=t7sRyqFD8zaElsWAyTkdV/A/de2tWj31e5vDAsus3RY=; b=XjUlQCem+TQZfYATuS6Ssw838Q/Z9xcVWsGc7oMUaArF/A5G1onGEFqOrkoXUKR4F6 VTHHy2Ltvoju7EvQKQuB8f2osLyXzkHv2n+WznIGYLuwr1v7uAyZwC4wXNuGn3+8OO8I cc8S8nPUjT/H2LoaREQqa61NEQ1Yl0KfzNj5ESc2XVRvoLqB2Mz3SG7Y0L4KlcfZE/Hx S2riaNWM5hqQt75RccZKF26xD8EgDH1pKsu5EVepRqajTTVUPTshAMwIy/nAJ7F9lEyS y6NOumDQO6Jf9Hn0El/Wge30I2FA8lCuT8BfVbu3nzN9nLFF6fwzE+rsv35lSu5lLqZf Qzgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Gx3mesPg; 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 y18si31392888plp.269.2019.01.28.05.44.30; Mon, 28 Jan 2019 05:44:46 -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=bombadil.20170209 header.b=Gx3mesPg; 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 S1726805AbfA1NoP (ORCPT + 99 others); Mon, 28 Jan 2019 08:44:15 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:59112 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfA1NoP (ORCPT ); Mon, 28 Jan 2019 08:44:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=t7sRyqFD8zaElsWAyTkdV/A/de2tWj31e5vDAsus3RY=; b=Gx3mesPgnK5Ve3gM75gM5zcxn 3vpEoKJtIKjrFMtU13XkK3y5QTDnPAdoVpRBZGcNhwzJv4tZ61g9K1LkJkayc2n70E2C2GFYkLeSY b68vlLgcCbcZ1qkvdFJ5cEvE7PgmILWvXWC79izp+qn6BKvMm32a3/UXhIC8tyD4mBDVHOl6mPex9 FJQ5eLCVVpk+QlirSBNJL5S7OmvKpznA70GGDASvLsOsvLYKPx0WVugUCvJiTYqmbtUYh2eH79hCS kv4XDS55uV+Rgl2OaHXhUGXw5Dvel5qtPnTgQKp9HI21aLKsDK9Vvu8PzygRclCYXaASDGeuWe/PS 1sZeblWEQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1go7Cv-0004Lm-5e; Mon, 28 Jan 2019 13:44:13 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6530825E16E01; Mon, 28 Jan 2019 14:44:10 +0100 (CET) Date: Mon, 28 Jan 2019 14:44:10 +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: <20190128134410.GA28485@hirez.programming.kicks-ass.net> References: <20181127081115.GB3625@osiris> <20181129112321.GB3449@osiris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129112321.GB3449@osiris> 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 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 wake_futex_pi() rt_mutex_next_owner() // whoops, no waiter WARN lock hb unqueue_me_pi So reverting that patch should cure things, because then there is no hb lock break between queue/unqueue and futex_unlock_pi() cannot observe this half-arsed state. Now obviously reverting that makes RT unhappy; let me see what the options are. (concurrently tglx generated a trace that corroborates)