Received: by 10.213.65.68 with SMTP id h4csp75484imn; Mon, 12 Mar 2018 07:12:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELvpXKKvKCoa7fOsJainr6wo8tqoEkNuM39YKSY6lO2fKFCw8mMTprL9aYPi2D4cHywWUWEy X-Received: by 10.101.69.4 with SMTP id n4mr6789327pgq.184.1520863953980; Mon, 12 Mar 2018 07:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520863953; cv=none; d=google.com; s=arc-20160816; b=n6QK0fMpIuU0P2v3kqd2fuiqC7mT50a2kXXHltl7VaJjtTLj8zgLG954hCRJjtuL2J peOPg7CLFxpe2vMppXB7rxYujrF22ouUgwRXtvhJ2MaSX+gbboKEVr8V7e/EmYbynrW4 j1/xYAdsuLDzl2hquWipGUFlrFMgDwQfZTHvdzcS6/iLSVUMh+4Pbb0cFqWpyZIRbo0y +Xw8FHdQwKquGhEvG08gzyXan4WqYQuUvZlrC0kOq2lIkzQUdEjyhVaodsYi+i2Mx/ro 3SNVh4DwE2ic/g7f39Ixl0BjUKLk5ZRR56L1bdSKHG8hwb1nLzn2QorEf2shCrR34P4R j/Lg== 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:arc-authentication-results; bh=4d9RFGIs1sxBzRooiiy8TokHmYtHdgR9FTnD7QRzp20=; b=JQRJzJmfub/1CTVUpQZwDhPTJDWcUqGcYgy6YVsR6Fx+cec45UKhGkdKeTo63zGwt0 Zdf0923qunTeeBb32q2eKnuXikUpn4EM3+n5xJp0at5t3RY692gE51X4nqNz0hRWjuZg e5f1Ighn/ZJwvg3cl3I+6/Q6I/FalYrKbU4IbugpSF1UiPRwA9dN3wG4SNa8SANYpRIB 2u5YIHz5iil9OSiWTyfaSMbPFoxvB+LDKebLCGfhiSUYfo2j213YqhLB6BXKcyqIrjf8 R8sbAfF3nqLfFB52e6RgDqh36QjA2uvLY7QbqcsyZo2jVGggQJxEBQjIMJ07aRT0Z1kz tOGg== 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 w31-v6si6041290pla.315.2018.03.12.07.12.19; Mon, 12 Mar 2018 07:12: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 S1751999AbeCLOLP (ORCPT + 99 others); Mon, 12 Mar 2018 10:11:15 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:46247 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbeCLOLN (ORCPT ); Mon, 12 Mar 2018 10:11:13 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1evOAN-0007BX-J3; Mon, 12 Mar 2018 15:11:07 +0100 Date: Mon, 12 Mar 2018 15:11:07 +0100 From: Sebastian Andrzej Siewior To: Peter Zijlstra 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: <20180312141107.roveviectc6a75s7@linutronix.de> 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> <20180312132729.GI4064@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180312132729.GI4064@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-03-12 14:27:29 [+0100], Peter Zijlstra wrote: > 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. I know. We had this very same problem with clock_nanosleep() which got solved after timer rework. > 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. I assumed you complained about the unbounded list-walk with interrupts disabled (which is cheap but unbound is unbound). So here I suggested I move 20 entries off that list a time and enable interrupts again so an interrupt could set need_resched. But if we get invoked !preemptible then nothing changes. > > > 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. exactly. The irqsafe() was to guard non-RT config which uses the same code. So do I understand you correctly that irqsafe may remain for !RT config but that invocation with disabled preemption due to sched_rcu (on RT, too) must go? Sebastian