Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1972422ybi; Mon, 1 Jul 2019 03:53:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPziMH+yzRUqj3+hHZGP+NpsSiJp74tbk76vtyeInSf7qlSmKAWZXLad7jk9YV09h2guT0 X-Received: by 2002:a63:500e:: with SMTP id e14mr13330271pgb.11.1561978418976; Mon, 01 Jul 2019 03:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561978418; cv=none; d=google.com; s=arc-20160816; b=09AvCdEUUGh4zrML/bpyZJYXZWr4OuWbBeE+zb3bGx+pK6fi5K4cYHN+VlPcTqstbm t93mVNZvr3k5U4PUK/fvvBqG3p5CGNYNAQyvxLOOegGEmG3EM42bTr33TlCukOCEuBjL oYEhjl/2IXqNtK8H14IUuvTTgRjY3gu47fKJXNIQJinJ/cGDrXie+FNtkW6hIDAwC68r OWhwiHvy5F08njv1M687gAXFDU9Baa2FGkMojqWJSefZUJHn1XOagd4PQ+Mvb8Rb0Qzq xTICvdjbigTABnbF2VWwHU6Pbjqe/fYjL5CdZCm67dYXXg5Qrtc7uzospnGDNBY6AwQ6 f+9Q== 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=l8mrCiCp/0xRvJWtJijHHG/E/g8+XGDQbgPrBgivMT8=; b=uMQCKQMiRTtoTjUiTV9Sb7ZjG/U39M8L28Yfi4M5x8TBFxWKpSZx3q7zqFwwjyvz7b jsHO/RHrv7yCqcaH9xROIMdYXjKAOaffeNAX8RIUtXDAhaa3Jh2Yeh2Ag0E5njQzH9yt 8B4Xaw69w68RtQgrH+p41tj4J6Ke1J/XL6zK0IiPeJaQIl1e2E+0mBAU3x33pv98phw1 2O7KKZY01rRx5Ka9qIv9NH99bmI37fMi++NnJrKaFY9c/ZZ0G4x0Db3XgU53VxdqU2il BOpmaGVWc+BN+DcsD1ABaW8YkTCi8MXoWbcLmifwhihdK5rtWpx5DavBCZ052+vP/Bvc qYCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FrxEHL1Z; 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 d18si11212852pfn.202.2019.07.01.03.53.23; Mon, 01 Jul 2019 03:53:38 -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=FrxEHL1Z; 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 S1728453AbfGAJmw (ORCPT + 99 others); Mon, 1 Jul 2019 05:42:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33704 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727332AbfGAJmv (ORCPT ); Mon, 1 Jul 2019 05:42:51 -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=l8mrCiCp/0xRvJWtJijHHG/E/g8+XGDQbgPrBgivMT8=; b=FrxEHL1Z5IWGkU/zpXIKtrltQ 7qDc2lmCOtOVGTRBysa9LaTqTjAf5CSuwuJHTiyxTtTE2ZBnyY5GTjfOMZMhZ5sBzNenKvu0TaU7n EaVGPR+JYI3PfdY/mskcKxrIXJD14ehMylRny7jvrbLyyL7+0aRWiS9/6TZp1B/dHtUmXpLFk1kg0 e19275DQT6SxinPN4x1yHkBg3Uj18tPs50RFbjXsOL3yZpTmC34Aw6GZnP32hK7aFutcCLgwubTSR y/IyLp3ukjIv4w/vKJUdHKU++wtqe5f3JcQ/53AUvTNFrKwSvJjzAhnGmjpCzYRQBJqpzghcrhPKQ 6RXVmO1jA==; 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 1hhspF-0005HO-Ls; Mon, 01 Jul 2019 09:42:17 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 38D4F20A710F7; Mon, 1 Jul 2019 11:42:15 +0200 (CEST) Date: Mon, 1 Jul 2019 11:42:15 +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: <20190701094215.GR3402@hirez.programming.kicks-ass.net> References: <20190627173831.GW26519@linux.ibm.com> <20190627181638.GA209455@google.com> <20190627184107.GA26519@linux.ibm.com> <13761fee4b71cc004ad0d6709875ce917ff28fce.camel@redhat.com> <20190627203612.GD26519@linux.ibm.com> <20190628141522.GF3402@hirez.programming.kicks-ass.net> <20190628155404.GV26519@linux.ibm.com> <20190628160408.GH32547@worktop.programming.kicks-ass.net> <20190628172056.GW26519@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628172056.GW26519@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 10:20:56AM -0700, Paul E. McKenney wrote: > On Fri, Jun 28, 2019 at 06:04:08PM +0200, Peter Zijlstra wrote: > > On Fri, Jun 28, 2019 at 08:54:04AM -0700, Paul E. McKenney wrote: > > > Thank you! Plus it looks like scheduler_ipi() takes an early exit if > > > ->wake_list is empty, regardless of TIF_NEED_RESCHED, right? > > > > Yes, TIF_NEED_RESCHED is checked in the interrupt return path. > > OK, got it. So the following sequence would be a valid way to get the > scheduler's attention on the current CPU shortly after interrupts > are re-enabled, even if the current CPU is already holding some > rq or pi locks, correct? > > set_tsk_need_resched(current); > set_preempt_need_resched(); > smp_send_reschedule(smp_processor_id()); I'm not sure if smp_send_reschedule() can be used as self-IPI, some hardware doesn't particularly like that IIRC. That is, hardware might only have interfaces to IPI _other_ CPUs, but not self. The normal scheduler code takes care to not call smp_send_reschedule() to self.