Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3357184ybd; Fri, 28 Jun 2019 07:16:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKQM7ieyKZ6dmOlzxbKKWw59lsxF/kurpIem22HgW1J27Y8mmG8inu9R91n/it0ChP6HdM X-Received: by 2002:a63:ff20:: with SMTP id k32mr2518757pgi.445.1561731380040; Fri, 28 Jun 2019 07:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561731380; cv=none; d=google.com; s=arc-20160816; b=g1i1meXYyF9k1ykaI/m0i6H1ptJmAh0x7CTh2xRGnzqdDleIkIAfJk99kOptC4KF4g t7MP3sgdOPzvePpUM9zIYkQ+gF3WMEaSBxUfkeeY18IJCOTjDqcIzwKWwo6C4HF7aaXE +3D7CuOkIS2CiEZ6S8pSHEkhyIq0BZJ4n8FX2qJubZgZ6uI3bPKcbbcRUmoykKDl5yJq 72QaFkbyeBDnrwNXCwmQc7faiIU7y0yIwpgUCs5ly4GhFjLle3fzn84trI84gkyXKQ4Z zEylMaFjXnqNa0nHjHRc6uGEzZ1r3AsnqRbN3GEiNSMz0iA557UybM+4BoXHB51a5HKy QU+g== 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=KGyxyb6C9C36jd3MUag3X49JqaizbydoeqxFEKojv6k=; b=c/L0JkxrNFPXuoQ4zz72qIwUtbN1l8zsUtDwLIT6/Q12eKgckGDSwfLTTZ7vGuNKun e8tU/gCC9fU4Jdu4IPHexFS7vlRU0t7GUabOijD/cvdfRM9C/JJGiwpA3SNsS9m2Ypm8 XzXWC14COqPKCT87wMAF4zxZUmqXBuJuO7KM4YNQi1AipGGfV7fAM2aepz6Z16ODhNO3 YN9zMk43JZidssivGBNmQDQh5pC+ttEFNBpZZBuex5SD9VBJel/+rxJl9z4PqOSa/Iwq rfd0THRleIzM+J58KE+jCSDDdEAaq8ikDTzwvrS7Sa0dEBVLK6JZ/3QvRNxbzR/2JzXH hY3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=shIOtJ5Q; 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 x21si2080756pgh.400.2019.06.28.07.15.58; Fri, 28 Jun 2019 07:16:20 -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=@infradead.org header.s=merlin.20170209 header.b=shIOtJ5Q; 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 S1726762AbfF1OPr (ORCPT + 99 others); Fri, 28 Jun 2019 10:15:47 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43644 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbfF1OPr (ORCPT ); Fri, 28 Jun 2019 10:15:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=KGyxyb6C9C36jd3MUag3X49JqaizbydoeqxFEKojv6k=; b=shIOtJ5Qnv0SN0BmGMmEU85BH SOLnXtGR4diAGHxmbXBVtYWSTszrr6hEE5zK9mDNqOjaWnbqydFVS8NyWGUPL//1ZDl+nBAnROyFx lJqT4dwEH3BsOwh3ULkv16SXLb/g31gaRS8EJ7/xCtVPU7nEAlYtgTUx2a5SnXUla3TAwkLnAMaWm D9pFMkH8vCiqJICV/G2UN/a2gA1jkDj8cVb8kjwdiOuJDsyvnlFhs14H3adUVTPFcMRSnQ6uaUEvk XPJzJm51Uf3+DdMkdwK3hu10u/3gdEKrk867Ro5T1wlY878pBWemvPWjC6OjMJBso+HFftng2Y/he /8hKJmSFQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hgreu-0000wl-B2; Fri, 28 Jun 2019 14:15:24 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 69AF620215B79; Fri, 28 Jun 2019 16:15:22 +0200 (CEST) Date: Fri, 28 Jun 2019 16:15:22 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Scott Wood , Joel Fernandes , Steven Rostedt , Sebastian Andrzej Siewior , 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: <20190628141522.GF3402@hirez.programming.kicks-ass.net> References: <20190627142436.GD215968@google.com> <20190627103455.01014276@gandalf.local.home> <20190627153031.GA249127@google.com> <20190627155506.GU26519@linux.ibm.com> <20190627173831.GW26519@linux.ibm.com> <20190627181638.GA209455@google.com> <20190627184107.GA26519@linux.ibm.com> <13761fee4b71cc004ad0d6709875ce917ff28fce.camel@redhat.com> <20190627203612.GD26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190627203612.GD26519@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 Thu, Jun 27, 2019 at 01:36:12PM -0700, Paul E. McKenney wrote: > On Thu, Jun 27, 2019 at 03:17:27PM -0500, Scott Wood wrote: > > On Thu, 2019-06-27 at 11:41 -0700, Paul E. McKenney wrote: > > > On Thu, Jun 27, 2019 at 02:16:38PM -0400, Joel Fernandes wrote: > > > > > > > > I think the fix should be to prevent the wake-up not based on whether we > > > > are > > > > in hard/soft-interrupt mode but that we are doing the rcu_read_unlock() > > > > from > > > > a scheduler path (if we can detect that) > > > > > > 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. > > > > > > Of course, unconditionally refusing to do the wakeup might not be happy > > > thing for NO_HZ_FULL kernels that don't implement IRQ work. > > > > Couldn't smp_send_reschedule() be used instead? > > Good point. If current -rcu doesn't fix things for Sebastian's case, > that would be well worth looking at. But there must be some reason > why Peter Zijlstra didn't suggest it when he instead suggested using > the IRQ work approach. > > Peter, thoughts? I've not exactly kept up with the thread; but irq_work allows you to run some actual code on the remote CPU which is often useful and it is only a little more expensive than smp_send_reschedule(). Also, just smp_send_reschedule() doesn't really do anything without first poking TIF_NEED_RESCHED (or other scheduler state) and if you want to do both, there's other helpers you should use, like resched_cpu().