Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2024676yba; Fri, 10 May 2019 05:13:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkGaQ3YTnDyxz2vZc30yxBde/Wczn1l1gMv1AIUPZw2lJOEGubtIxbTmlBu3Z878C8Pnh7 X-Received: by 2002:aa7:8458:: with SMTP id r24mr13367266pfn.231.1557490408443; Fri, 10 May 2019 05:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557490408; cv=none; d=google.com; s=arc-20160816; b=myJNVD34D783IRIGK36UZrLxXA6ISWvK6uiuENhGPFJLlayPDKEUoZHP5g4K6TZdUB FdsUkWC7yZP2uEaMmwAVghyNkQchjZlAY8iuHfv50YeEG63SEIHPNedVE9sOb9/i5zgl YFDlaB0y9kCbwRwySl7ImCNUaO8kDTILI/ZpMswk70C+DRuyucR2XhCqYhuLmIqU7NzY KPQi3ScIyobyqXuhgsko18tEdnMHb8KSukLCHR0NdZuMpKCfpNYUdGVMwYZevJUYDMTc NPwJ64q07rvbQttq0KkhMewTn1AzVyVAuzjk0BGj1gJkLCh+U8PIm2d3o095GHQLQPxX FRag== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=YbCl65MSgp87W10JhHwLPXqBtuU9y/s5j/l66J39gyM=; b=XnLF0hsxTMnxFPCMPjKzKHHSlifTY53wyJddLfs9iz+DhUeNbNZZAUWphaubXcJ1MA okqH32ztbcas2WUfaSP2A5yPYyJVXk11iEUwHsQNanV1aUjNBmRA/h75jzLGqiM8LLkz t0xBSwTlqIOvDM/J7L+TKJluQv7m1ZGcHTHf3rGk6fWlkizQUNx4TPEPdZ8RA7u+9Y3P DUOXIvS/JjsIWdAiK9hLDYzIdw4gEPkBtGZQ0hEJAWTh8VkXRWt+i8rvUm/eJmYWXkwZ c71pPFYyLk2sTSvVNMIUFmOOb5u2HvVJyKgUhlcSbLqiGe9ElLNbz1xuCfSs1uJRNQS7 OMDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ekAXYyXt; 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 f193si7635518pfc.134.2019.05.10.05.13.11; Fri, 10 May 2019 05:13:28 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=ekAXYyXt; 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 S1727267AbfEJMI2 (ORCPT + 99 others); Fri, 10 May 2019 08:08:28 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:33228 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbfEJMI2 (ORCPT ); Fri, 10 May 2019 08:08:28 -0400 Received: by mail-ot1-f68.google.com with SMTP id 66so5365972otq.0; Fri, 10 May 2019 05:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YbCl65MSgp87W10JhHwLPXqBtuU9y/s5j/l66J39gyM=; b=ekAXYyXt/rxl3zEoSfFTEhFySRcywqbuGR9RlhBScdj522Rlm7wyAnWQkBRug/L0l8 46EuskQ2aKaNacgVA1O/S1doQy2m54dB3krDkjbREtsvyqzozcmlizmrvrEE2ClQ6E8T LLbnl7Q74MXO7gVd0Z5YWe/Fu50wpl5RZaRC+QK9eaYIewqmflDYiT/fnUOLHfqoIVJp AAgFrzIZygUIBDKjgiWTcjca9HYyXHYtZ2aLtjOrnS4qfBZUBVGeUgOWPHALJK2z+rsW t8rDMjEUmuMmsC1jbA37+ZodGfmp30KLB9d1+5cwe5I1L8ODSA+oBaDkb4zoTsya13pI AjKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-disposition:in-reply-to :user-agent; bh=YbCl65MSgp87W10JhHwLPXqBtuU9y/s5j/l66J39gyM=; b=MVUOm5qkyEWmQJFuVQiQW6xQ2XflUihBWJMc3ScdUwszyIr+72ZUTKs32KOJ2uJ003 syFszKwatJopZUgyxJJY5R2hG/HGGv96d3BjN0Js+DqxlMCyUj8Qqat7EYMMhPteZYJP tyJC32Ydx0rpg6ckMtSp6mYWHrCugl/plgGaSFMlzOZEadsTLuiilNHfFamimThN2eEf B/RIER6bBtkqcjXLFh8l7PUUlbfORMGyu581qHh899et8tZtmRj4nnRzL/qjAMmHiTGh VOmHXYbdl7cr45zO9QqSkI4T6akXLIhQsd+2SDn8UDgRLA0pr0+RNkmUQ6yznewi8YqO Co+Q== X-Gm-Message-State: APjAAAUeVOm0bYSagHbqXXf4L1fqPvYX5/DTxL0KwKi9GIm7LxtMKAAu Ym0nCkxt9lyIY28Hav1kuA== X-Received: by 2002:a05:6830:150f:: with SMTP id k15mr295066otp.349.1557490107053; Fri, 10 May 2019 05:08:27 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id o5sm1877406otl.44.2019.05.10.05.08.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 May 2019 05:08:26 -0700 (PDT) Received: from minyard.net (unknown [IPv6:2001:470:b8f6:1b:d5e:aa5a:44d8:6907]) by serve.minyard.net (Postfix) with ESMTPSA id C43A618190F; Fri, 10 May 2019 12:08:25 +0000 (UTC) Date: Fri, 10 May 2019 07:08:24 -0500 From: Corey Minyard To: Sebastian Andrzej Siewior Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , tglx@linutronix.de, Steven Rostedt , Corey Minyard Subject: Re: [PATCH RT v2] Fix a lockup in wait_for_completion() and friends Message-ID: <20190510120824.GL16145@minyard.net> Reply-To: minyard@acm.org References: <20190509193320.21105-1-minyard@acm.org> <20190510103318.6cieoifz27eph4n5@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510103318.6cieoifz27eph4n5@linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 12:33:18PM +0200, Sebastian Andrzej Siewior wrote: > On 2019-05-09 14:33:20 [-0500], minyard@acm.org wrote: > > From: Corey Minyard > > > > The function call do_wait_for_common() has a race condition that > > can result in lockups waiting for completions. Adding the thread > > to (and removing the thread from) the wait queue for the completion > > is done outside the do loop in that function. However, if the thread > > is woken up, the swake_up_locked() function will delete the entry > > from the wait queue. If that happens and another thread sneaks > > in and decrements the done count in the completion to zero, the > > loop will go around again, but the thread will no longer be in the > > wait queue, so there is no way to wake it up. > > applied, thank you. > > Sebastian Thanks a bunch. Do I need to do anything for backports? I'm pretty sure this goes back to 4.4. -corey