Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3648775ybd; Fri, 28 Jun 2019 12:24:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBytJtMIxZTCMcHuIhtITjOczzoxJNoZviEc/tcQ8CP1exU7aqyx8G3Ytybn7suHbCaDbP X-Received: by 2002:a17:902:e01:: with SMTP id 1mr13777685plw.268.1561749871798; Fri, 28 Jun 2019 12:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561749871; cv=none; d=google.com; s=arc-20160816; b=aAu4oqvoZdwquehvK0Na+gldrnuqhHfMlL5iuHzVjxBhPtmNc3Fj3YnXnBxIpFAljO tK9Lt8fg7ikNox/RqaVFDBKmb0J1W1xasaCJ+MyoxIqfDyy8uOYOWx79HLxydUqIlFYb gsARUNpUw1jlDsqaN5TlXV5cs9MLKeOGAIpoFUlWAQ1cqh8fXUoKyiKjoaWCtN3Zu9qe UAQFn5ubcOWCSkq/AYOrlmKO5hf9q7Hd3f3PgIvKd8zJPj7pmVk6CteBVaoLflDqJ5vD yIONqRYItFHRSRx6tuJDbKT0OSLhACygOvod+qU+/XTnWGYho1sVOBveDSLUifuQGl5O yl0g== 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=k5MirY9PvjvoYy2JYPX/EykDAkKOFRQV3e8B1ez3nZY=; b=bcQkzem00xcUWYy2tLzuJI2otMav2a3wHyz03caQsvrOBE8WOuIJjPxYLjvRLa8bFe FwsN4OoO7nU3X8xP/AFJ53wwCE5Cb6UGeLEQ911lSRvhnuoNAov+iB8+bvcH6kUO7dLB VqkWsDYDGAtQdgnRoK7SJjaCvmVUKv1G8U4oB6u1OrkG0IDai7M6CkEWcPt8wydvBiNj WC/gwYfxcF4Bt0wcQza3011Wz1O3SywMn/5bD9/1yHddDXB1aTrDZvFBowSQy5Od5Wns GeoXxZ5V8HxhMlMzW2KzYV2RTX8TaINnEseMDXQCcHveU1WNbkNrRroKjkz76JQA8pNy C4Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="R1bIEps/"; 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 l44si3048973pjb.23.2019.06.28.12.24.14; Fri, 28 Jun 2019 12:24:31 -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=pass header.i=@joelfernandes.org header.s=google header.b="R1bIEps/"; 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 S1726871AbfF1TYK (ORCPT + 99 others); Fri, 28 Jun 2019 15:24:10 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42925 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbfF1TYK (ORCPT ); Fri, 28 Jun 2019 15:24:10 -0400 Received: by mail-pf1-f193.google.com with SMTP id q10so3466210pff.9 for ; Fri, 28 Jun 2019 12:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k5MirY9PvjvoYy2JYPX/EykDAkKOFRQV3e8B1ez3nZY=; b=R1bIEps/kzzezmtJeA2smWl1IIsg/enV00IthiN0CW8o+juhmIZoBy0ETt0JXHc5rs g0L7kxMEn3MZH+jByHm/zYo5Xr5kgImfp+O6PGhSdHcKUT62g0MPFdNrka5u4JiStby/ zSSDgYBQheykD8GSSPPuo1JQJxur+bG2q71XM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=k5MirY9PvjvoYy2JYPX/EykDAkKOFRQV3e8B1ez3nZY=; b=BIu4M88pk10zeQ+PWKjh5e9WFr+yWIHRMiafCPMUYHP6pjJWti/Gt8DJSI3LlYu555 /mYoKHH30M+SmEzurqAfqX9BWlorRDoGb0YcXhrxTJNf+Wp5aEtuviPEOGMKm6nucpKE kELZlJZn+q01sGVR9UMFWfA5gzz9TKZluKEUOXnl/fY6EdQsNtlNpzOZnmtxUwpIQ2G1 4aGM44tf+BZHa9j69IEVFfSSs94O4kWHW6kqFQSDuF2NSfI2Zc6IlIyYCfEdBBzy+ol1 s6FnWGxoHLDk1SNfW78Aam8Ft44itgbjIYHK3IqCIGfZecyqv5sCndF3bccnK76/Itow uMMg== X-Gm-Message-State: APjAAAXgwI9IiUZfsAyWg/8w72TYZ18WuDpPi6aC8QZ5C4ZUmkbm8EuE dJ2LIhu6Y4gXWc7nf4tNgi2scA== X-Received: by 2002:a63:ec13:: with SMTP id j19mr10509941pgh.174.1561749849525; Fri, 28 Jun 2019 12:24:09 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id c83sm3872829pfb.111.2019.06.28.12.24.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 12:24:08 -0700 (PDT) Date: Fri, 28 Jun 2019 15:24:07 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: Sebastian Andrzej Siewior , Peter Zijlstra , Steven Rostedt , rcu , LKML , Thomas Gleixner , Ingo Molnar , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan Subject: Re: [RFC] Deadlock via recursive wakeup via RCU with threadirqs Message-ID: <20190628192407.GA89956@google.com> References: <20190627153031.GA249127@google.com> <20190627155506.GU26519@linux.ibm.com> <20190627173831.GW26519@linux.ibm.com> <20190627181638.GA209455@google.com> <20190627184107.GA26519@linux.ibm.com> <20190628135433.GE3402@hirez.programming.kicks-ass.net> <20190628153050.GU26519@linux.ibm.com> <20190628184026.fds6scgi2pnjnc5p@linutronix.de> <20190628185219.GA26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628185219.GA26519@linux.ibm.com> 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 Fri, Jun 28, 2019 at 11:52:19AM -0700, Paul E. McKenney wrote: > On Fri, Jun 28, 2019 at 08:40:26PM +0200, Sebastian Andrzej Siewior wrote: > > On 2019-06-28 08:30:50 [-0700], Paul E. McKenney wrote: > > > On Fri, Jun 28, 2019 at 03:54:33PM +0200, Peter Zijlstra wrote: > > > > On Thu, Jun 27, 2019 at 11:41:07AM -0700, Paul E. McKenney wrote: > > > > > Or just don't do the wakeup at all, if it comes to that. I don't know > > > > > of any way to determine whether rcu_read_unlock() is being called from > > > > > the scheduler, but it has been some time since I asked Peter Zijlstra > > > > > about that. > > > > > > > > There (still) is no 'in-scheduler' state. > > > > > > Well, my TREE03 + threadirqs rcutorture test ran for ten hours last > > > night with no problems, so we just might be OK. > > > > > > The apparent fix is below, though my approach would be to do backports > > > for the full set of related changes. > > > > > > Joel, Sebastian, how goes any testing from your end? Any reason > > > to believe that this does not represent a fix? (Me, I am still > > > concerned about doing raise_softirq() from within a threaded > > > interrupt, but am not seeing failures.) Are you concerned also about a regular process context executing in the scheduler and using RCU, having this issue? (not anything with threaded or not threaded IRQs, but just a path in the scheduler that uses RCU). I don't think Sebastian's lock up has to do with the fact that an interrupt is threaded or not, except that ksoftirqd is awakened in the case where threadirqs is passed. > > For some reason it does not trigger as good as it did yesterday. > > I swear that I wasn't watching!!! ;-) > > But I do know that feeling. :-) > > Commit > > - 23634ebc1d946 ("rcu: Check for wakeup-safe conditions in > > rcu_read_unlock_special()") does not trigger the bug within 94 > > attempts. > > > > - 48d07c04b4cc1 ("rcu: Enable elimination of Tree-RCU softirq > > processing") needed 12 attempts to trigger the bug. > > That matches my belief that 23634ebc1d946 ("rcu: Check for wakeup-safe > conditions in rcu_read_unlock_special()") will at least greatly decrease > the probability of this bug occurring. I was just typing a reply that I can't reproduce it with: rcu: Check for wakeup-safe conditions in rcu_read_unlock_special() I am trying to revert enough of this patch to see what would break things, however I think a better exercise might be to understand more what the patch does why it fixes things in the first place ;-) It is probably the deferred_qs thing. thanks!