Received: by 10.213.65.68 with SMTP id h4csp51867imn; Mon, 12 Mar 2018 06:28:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELtvfAICqYdipaXE4UFhKC5a/bElEfFXYlFuzKwiuO+bYa4TFZLGTU9CvPC0k03Kq3Pvy4ou X-Received: by 10.98.228.3 with SMTP id r3mr8015955pfh.77.1520861323510; Mon, 12 Mar 2018 06:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520861323; cv=none; d=google.com; s=arc-20160816; b=mvGDl+Uee7AdltSPwEL2Tj3AKfBR4jqWwImwY1HQsnoriTohXxNVY+7ZukNaxVjq0p s3oKr/1AKWrjHotgOvjLkPqHFWJEg4L0imNnHq3Z7EPvqrRINwFRE38KLNhkSz9wx2Sv fBED/u00/qFDBW1xF25rdwYs//YmPbawTF9MO8lj2NG41SCitTkQeiN5+oBraxM0jQXS 9kWt0WN9+qYxusrz2TQQCC/AFvl6TpJ/SQmTKGFcZ5u9a0RvDRNxyfnUQrN2ls6qAMym 1NXoTigwwhO4bHZB23weS/VLKOgydBU9oPrdGvqqmC1JWjzmrldP8ZF42/3BNS/Ie7Bf g24Q== 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:arc-authentication-results; bh=HzntSF9VoHWqLpsOfRMJhKB8MpEF4m0jl8zNew9YG4Q=; b=ZTH5nH04Duc+zXjpHUEZGT7EoKlwmsb5Zca5pc0shDr2n/chXpOLLjXtiM2J51lRtM +5yPAl7RE175FvcPeUYNGCFKVWllwsnRu2Nsp8P71BuaX/Jj+Y2CZ1FalupkbfcH8VPf mIjMk7AVaVn2fawTjkT305Ta1Wnz+wWEIyDIoP1TSjYH5WV8009v7/Uf8CV0LhqAM/7Z P3lp4LMCilEsCfkdeE3ZYPzWIxsAY5DKWte7uayH1xvy++BlvzOIkOWc0v3wVB2/8YUx O0nWAyB3IPGoVP1+6Tq8YaKzTrS5KBpK7NfsYBUH9Kj1otnEyHMD+DIH7bhph2JG8dpr 1BgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nEff7LTs; 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 x27si1689262pgc.4.2018.03.12.06.28.28; Mon, 12 Mar 2018 06:28:43 -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=bombadil.20170209 header.b=nEff7LTs; 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 S1751339AbeCLN1g (ORCPT + 99 others); Mon, 12 Mar 2018 09:27:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49018 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbeCLN1f (ORCPT ); Mon, 12 Mar 2018 09:27:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=HzntSF9VoHWqLpsOfRMJhKB8MpEF4m0jl8zNew9YG4Q=; b=nEff7LTs49JaWPLV7u2ZRcCZY jLGFwT6Vo3PJSe2XThErKUzpA7a8fZdqRdM+SDXg58JZxjylQQcGuVynoDGG5Ois5ni0WuKLGha09 woYYobDBN/Kon1eb8P0mljhJdPt5EskpABFPF73TC6l1TGYQM5A9c9sPcKBfC/Pixhd28kj34eqeK a4HbZewH9GH2fZWnNfAyhm4qP3eTmv2QljMqYmfjhWmQ6iGvlIxUU7ZccauV3PlmkXtKUOw6t5Ppm UKkmJ4dIvNUfKD7/NC5+DMdtvBMSkG9wJzx6GwbiDzWsFIW56AVCaVXUYMd1CX3AkgXCpt7lGAcBv Axre6R9Jw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1evNUA-0003oz-Vr; Mon, 12 Mar 2018 13:27:31 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 58B6A2029FA14; Mon, 12 Mar 2018 14:27:29 +0100 (CET) Date: Mon, 12 Mar 2018 14:27:29 +0100 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: Corey Minyard , Thomas Gleixner , Steven Rostedt , linux-rt-users , linux-kernel , Tejun Heo Subject: Re: Warning from swake_up_all in 4.14.15-rt13 non-RT Message-ID: <20180312132729.GI4064@hirez.programming.kicks-ass.net> References: <20180306174604.nta5rcvfvrfdfftz@linutronix.de> <1704d817-8fb9-ce8f-1aa1-fe6e8b0c3919@mvista.com> <20180308174103.mduy5qq2ttlcvig3@linutronix.de> <20180309110418.lwtennjqwqcxh422@linutronix.de> <20180309174605.GC4064@hirez.programming.kicks-ass.net> <20180309202550.j66qphz3txupt55u@linutronix.de> <20180309222643.GC5926@hirez.programming.kicks-ass.net> <20180312105113.p7jifhwdwbhpvxds@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312105113.p7jifhwdwbhpvxds@linutronix.de> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 11:51:13AM +0100, Sebastian Andrzej Siewior wrote: > On 2018-03-09 23:26:43 [+0100], Peter Zijlstra wrote: > > On Fri, Mar 09, 2018 at 09:25:50PM +0100, Sebastian Andrzej Siewior wrote: > > > Is it just about the irqsave() usage or something else? I doubt it is > > > the list walk. It is still unbound if not called from irq-off region. > > > > The current list walk is preemptible. You put the entire iteration (of > > unbound length) inside a single critical section which destroy RT. > > I considered that list walk as cheap. We don't do any wake ups with the > list walk - just mark the task for a later wake up. But if it is not I > could add an upper limit of 20 iterations or so. So the problem is that as soon as this is exposed to userspace you've lost. If a user can stack like 10000 tasks on the completion before triggering it, you've got yourself a giant !preempt section. Yes the wake_q stuff is cheaper, but unbound is still unbound. wake_all must not be used from !preemptible (IRQ or otherwise) sections. And I'm not seeing how waking just the top 20 helps. > > Why isn't this a problem on RT? > So we remain in the preempt_disable() section due to RCU-sched so we > have this, yes. But the "disabled interrupts" part is due to > spin_lock_irqsave() which is a non-issue on RT. So if we managed to get > rid of the rcu-sched then the swait can go and we can stick with the > wake_up_all() on RT, too. OK, so for RT we simply loose the IRQ-disable thing, but its still a !preemptible section.