Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1930571yba; Fri, 10 May 2019 03:34:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfMuKgvrKavfbRy41KVsfYBgvvNgUiyvuNKrtxq+rXBWewM0nsMWENXf9BXqydAbnxo62c X-Received: by 2002:a17:902:9b83:: with SMTP id y3mr8382872plp.165.1557484473901; Fri, 10 May 2019 03:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557484473; cv=none; d=google.com; s=arc-20160816; b=pP9OzhO5yW6MAKwP5IPIR9qTomHX9sBSM4HVpjSgYqcoQWXPc2XwPqpC3/120SXJJ0 SBQD1kMJiqAKaB4IZdJpccApuchMyJfg5HxcNhDfhyWAjUA0xHitNHzb5VciQsnrhIJk AZD9AiWb5uEzvjr4MX3b0E3nt05xzB247K18ZV6rxIeqRwc1sLWplBrJynU2910uxYjE +91E+9UgxTlHQV1J/AuZsLflfvVjou2ESjJQWsIHA3JniTn+2icPqgPTh0IGGeWiSExp v8XEm1LMzzHyYy+YsxSKxALyKnMTePtPmN3BKbrnzHLcaQJL/d2ye2yKc/RyC9UX0Hqc jRWQ== 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; bh=cp5JVkgP306WSF7BZA1sU+C48Ck6cpCssAvKX9bwPmc=; b=ChvCnlyabHVBlaMG7xUWy14Ij88HxruQqwKOXLzqNsVzSCZYhuF7zJ40WMeVIEIKz1 YmH6Vl4spob0bwhrZtQ2vfrjbC88DKr4yYcirZ6AfaBZP5ZgJyE0dpEyquAjCa8VxgbA 092Tnt3yk6YRSGApI6j+xkrz1bje9kop95MhsZ3NyM/CRV8iIeJ+/RcN1Ci0PJnnPvjF KHxf2vTEhAHLBY+xhdiX4gei83QNgY+uz0qXWF8jVD1UqphkjW34ppdR3woKDCQqEaDw ewVpwyLQqnAqD1gtarHP/bjvbLzSR8JdqhbtTek8TXL63l/0f3mwYgs+heN12aesIwh3 m35A== ARC-Authentication-Results: i=1; mx.google.com; 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 i22si769201pfj.21.2019.05.10.03.34.17; Fri, 10 May 2019 03:34:33 -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; 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 S1727485AbfEJKd2 (ORCPT + 99 others); Fri, 10 May 2019 06:33:28 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53259 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbfEJKd1 (ORCPT ); Fri, 10 May 2019 06:33:27 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1hP2q7-0004jE-1i; Fri, 10 May 2019 12:33:19 +0200 Date: Fri, 10 May 2019 12:33:18 +0200 From: Sebastian Andrzej Siewior To: minyard@acm.org 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: <20190510103318.6cieoifz27eph4n5@linutronix.de> References: <20190509193320.21105-1-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190509193320.21105-1-minyard@acm.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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