Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1298412pxb; Wed, 4 Nov 2020 05:30:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz7/zdl3/y/p3bG72vgsXsbodNlFqhV6+Grodw7P8lPk89yhRIFp28gx9noRuLW1fJiceB X-Received: by 2002:a17:906:c43:: with SMTP id t3mr24358519ejf.219.1604496601660; Wed, 04 Nov 2020 05:30:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604496601; cv=none; d=google.com; s=arc-20160816; b=QrFvmpnZwyXYXNkht2S6wHNLby/wlL+miZQv/thgpyG4Zm6909yf/GuqUwCEqCm2Nv 2eA1WmjCLeVTdLtx1A7rrdbDuazYx5tlHmpjiPd3pJ/jL+O96sr349HrIxdqA0/cxdjj opCqlQVq69JsJKCcQpjSYwj9C0J+zaqePuEwMv7/CSWHBk8y/9dZjaw2FVuRQoa8ksBl 5CEif9R5zhurcGyrnUPVhbFw4tgBP9RGZg+E2mAxKW9jr3cH1gsJgIQTBXbXqcZFa6tJ CYAxG942z8IyjQykzAFHghxvXFUvLQ0qhC4BUF5P5WA591paP0gH9TNqeL87g4jj6JFt GtRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=X/y979eVJRsQpBS3uTHsEVTLszhMzUjou+ruEut+S9s=; b=oBuex14sOLvEemZwP0kF6vftKZWomCFZDJS+eepJokyp7ey4X5g/aI3oD2FUTv5XwA OKnkF1DuenqoJXGOsxsFwSZ79bjPzkDhtzEJl2sCZYBUOGh+eRbhgLX4kF8QEo6H+Nyh LYkEDUlyUfKz6lK7n+kwaknS8lYyzOcZxM6w20nPvaGxBvEOROyCvgiSTphuWG3N9x7o 06vh6HWLK0a8xb3TplsemT1NizCbooiO9gg05bfkjsQFIhRqf6TBrNpztLUR8Q2Dy43v fDmtfwv3YG2zOnFmSi017fR390yQWMIHBXtzu1ONsTwKtWps0PDnK8VC+cHwlob7LXNI j+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=keRKoXlK; dkim=neutral (no key) header.i=@linutronix.de header.b=H703sIwu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si1303991edp.497.2020.11.04.05.29.37; Wed, 04 Nov 2020 05:30:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=keRKoXlK; dkim=neutral (no key) header.i=@linutronix.de header.b=H703sIwu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729916AbgKDN0T (ORCPT + 99 others); Wed, 4 Nov 2020 08:26:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729198AbgKDN0S (ORCPT ); Wed, 4 Nov 2020 08:26:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96ECEC0613D3; Wed, 4 Nov 2020 05:26:18 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604496377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X/y979eVJRsQpBS3uTHsEVTLszhMzUjou+ruEut+S9s=; b=keRKoXlK9BNK4il+KjFMvHwcVKtTQAY5CIRfZMZWu3ZBdswM7KDnajE9B+yNzy2ySIxPXD pdljSMaFwptkjkOOBzUx9Gm5IgeVJ7ygNXzpJpdDsyqzbk5Z+aWn97NeWfgT97TNgjXP+z LvypjSCXj/76tsMNJRFcRSzF9psbA5CwqfmoXdZIbSJyqCycHD3kl6YG3q4yQI25jkCyt4 2m/wDfJn5yVXzBNijo3v3XkJfXvBlq/xGEhHeDeUxURYqiWnmR3fB88WsjmlsJKlQVD6Wo Fqde30u9/tju2tJVTlcBCuLUb95zvoFWFn8Qe3L30QU6UmB9B8vGvLkuIrp0Uw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604496377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X/y979eVJRsQpBS3uTHsEVTLszhMzUjou+ruEut+S9s=; b=H703sIwu528AJqL8IC960f6xJ+Ji5K2/HvtrgPmB92y34aE2d4Kut122s6Mh/SiaC2ssWn jmCRIJMDlPFcHBCA== To: Mike Galbraith , Gratian Crisan , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Brandon Streiff , Ingo Molnar , Darren Hart , James Minor , Sebastian Andrzej Siewior Subject: Re: BUG_ON(!newowner) in fixup_pi_state_owner() In-Reply-To: <871rh9mkvr.fsf@nanos.tec.linutronix.de> References: <87a6w6x7bb.fsf@ni.com> <878sbixbk4.fsf@ni.com> <2376f4e71c638aee215a4911e5efed14c5adf56e.camel@gmx.de> <5f536491708682fc3b86cb5b7bc1e05ffa3521e7.camel@gmx.de> <874km5mnbf.fsf@nanos.tec.linutronix.de> <871rh9mkvr.fsf@nanos.tec.linutronix.de> Date: Wed, 04 Nov 2020 14:26:16 +0100 Message-ID: <87v9ell0cn.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04 2020 at 12:17, Thomas Gleixner wrote: > On Wed, Nov 04 2020 at 11:24, Thomas Gleixner wrote: >> On Wed, Nov 04 2020 at 08:42, Mike Galbraith wrote: >>> On Wed, 2020-11-04 at 01:56 +0100, Mike Galbraith wrote: >>> --- a/kernel/futex.c >>> +++ b/kernel/futex.c >>> @@ -2383,7 +2383,18 @@ static int fixup_pi_state_owner(u32 __us >>> * Since we just failed the trylock; there must be an owner. >>> */ >>> newowner = rt_mutex_owner(&pi_state->pi_mutex); >>> - BUG_ON(!newowner); >>> + >>> + /* >>> + * Why? Because I know what I'm doing with these beasts? Nope, >>> + * but what the hell, a busy restart loop let f_boosted become >>> + * owner, so go for it. Box still boots, works, no longer makes >>> + * boom with fbomb_v2, and as an added bonus, didn't even blow >>> + * futextests all up. Maybe it'll help... or not, we'll see. >>> + */ >>> + if (unlikely(!newowner)) { >>> + err = -EAGAIN; >>> + goto handle_err; >> >> Yes, that cures it, but does not really explain why newowner is >> NULL. Lemme stare more. > > Aside of that it's going to create inconsistent state in the worst > case. There is something really fishy in the trace Gratian provided.... Ok. With some more info added to the trace I could convince myself, that Gratians trace is not so fishy at all and that Mike's fix is actually the right thing to do. I'll post that with a proper comment and changelog. Mike, can I add your Signed-off-by to the thing?