Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp569602ybm; Wed, 27 May 2020 02:35:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsngCdBtWIDUdJbhR53AXtxuFZNGs8AG9kjSAKPXgTqtJnrQzOvxf5CpVFCtkX3ac+/Itl X-Received: by 2002:a17:906:9243:: with SMTP id c3mr603626ejx.400.1590572115227; Wed, 27 May 2020 02:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590572115; cv=none; d=google.com; s=arc-20160816; b=v0JlRg3AJcnbikKToMTJT40wY67rQKKWIQ+sXekGSSgQyDU6j/RGR2HyIdOsMzD9km pqQv/DBX0vrH/ytqDt3S9h91rVluHFTYSv8+5ilaz8+Exr09zTUH2/MLJy2lgDNDYK6J Y0VmGzeR4u4eQL1Xr8H6YzBUUktKTsh+z+QgqNOxINSdaJ8qpUCoL6U0Uyy6+MFC7Cch 6YF2sA7B/lxy30SsRrWbpL6GAisQrgMBVnNlr0nTZ7WdeX2vHMlL+2x5nCzWjEe3vOSV By4GtEGmEvtvzf7deOrdJ5ubRgVtGcX6pv+rlE2Q1wU4tpHNrpRyr09ixCBPB34KhDOP OFeA== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ClLs07xA6e1uFtaBIWRfOPDvvHLhRP/0WIPt8M+VUDc=; b=nYPlOk+ZxrP/nSnra1ULfZ3ieRPJx6Omv6F0iKkwVUpCSBS7k6EDyuHG35czHspdX5 bHfJArdhbemEwNI9bK9HdW4EYgJIOE+W4b2A7jpSbINrCW71SPVJFTSo3sjnzJKuiEvu UDQi2YW33Gc65ctqHkIuVti8N7rmCItCbE224uHTUFGjeb7sq2+R3ukaogyOagnX6j84 NQ9qKVHwoy/DVsXFFHHdZU98vp83GymCJVeVNzimy8t7akshoV/QfBOzD68Emco6atwH 2Pm571SjhQLoQz0EU67slhkLzUIOFSawQXzw6jrtY430IZb4S+9d+ulkpjyXzEfiaiTG ldiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xQexO1Xu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si1614009edg.77.2020.05.27.02.34.49; Wed, 27 May 2020 02:35:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xQexO1Xu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbgE0A6I (ORCPT + 99 others); Tue, 26 May 2020 20:58:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbgE0A6H (ORCPT ); Tue, 26 May 2020 20:58:07 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2BAB20888; Wed, 27 May 2020 00:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590541087; bh=s1vKcZ8fL6cirhrfsNXQiB0jbuV/0UBSm4x3lyaMVpU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=xQexO1Xu7MnTwC5t7Qq/LGbxB0cRzDR2ocDd6LPL+Ihto0koV9M6CltRsZeIjVjAk pZLKkqTyqYxxDWqQvm5Pf+WniiI25h+PUdyLPvX5fBvleeS4FT8YoZF8eXKGhez/MK 5M1/4+Fb8/daG9rOUJSW8jsfsUYw9LGAY0cVRM2c= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D5D86352283D; Tue, 26 May 2020 17:58:06 -0700 (PDT) Date: Tue, 26 May 2020 17:58:06 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Frederic Weisbecker , LKML , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Josh Triplett Subject: Re: [PATCH 01/10] rcu: Directly lock rdp->nocb_lock on nocb code entrypoints Message-ID: <20200527005806.GR2869@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200513164714.22557-2-frederic@kernel.org> <20200520122949.GB16672@google.com> <20200522175739.GM2869@paulmck-ThinkPad-P72> <20200526152137.GB76276@google.com> <20200526162946.GK2869@paulmck-ThinkPad-P72> <20200526201840.GC76276@google.com> <20200526210947.GP2869@paulmck-ThinkPad-P72> <20200526212756.GF76276@google.com> <20200526222900.GQ2869@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 08:45:42PM -0400, Joel Fernandes wrote: > Hi Paul, > > On Tue, May 26, 2020 at 6:29 PM Paul E. McKenney wrote: > > > > On Tue, May 26, 2020 at 05:27:56PM -0400, Joel Fernandes wrote: > > > On Tue, May 26, 2020 at 02:09:47PM -0700, Paul E. McKenney wrote: > > > [...] > > > > > > > BTW, I'm really itching to give it a try to make the scheduler more deadlock > > > > > > > resilient (that is, if the scheduler wake up path detects a deadlock, then it > > > > > > > defers the wake up using timers, or irq_work on its own instead of passing > > > > > > > the burden of doing so to the callers). Thoughts? > > > > > > > > > > > > I have used similar approaches within RCU, but on the other hand the > > > > > > scheduler often has tighter latency constraints than RCU does. So I > > > > > > think that is a better question for the scheduler maintainers than it > > > > > > is for me. ;-) > > > > > > > > > > Ok, it definitely keeps coming up in my radar first with the > > > > > rcu_read_unlock_special() stuff, and now the nocb ;-). Perhaps it could also > > > > > be good for a conference discussion! > > > > > > > > Again, please understand that RCU has way looser latency constraints > > > > than the scheduler does. Adding half a jiffy to wakeup latency might > > > > not go over well, especially in the real-time application area. > > > > > > Yeah, agreed that the "deadlock detection" code should be pretty light weight > > > if/when it is written. > > > > In addition, to even stand a chance, you would need to use hrtimers. > > The half-jiffy (at a minimum) delay from any other deferral mechanism > > that I know of would be the kiss of death, especially from the viewpoint > > of the real-time guys. > > Just to make sure we are talking about the same kind of overhead - the > deferring is only needed if the rq lock is already held (detected by > trylocking). So there's no overhead in the common case other than the > trylock possibly being slightly more expensive than the regular > locking. Also, once the scheduler defers it, it uses the same kind of > mechanism that other deferral mechanisms use to overcome this deadlock > (timers, irq_work etc), so the overhead then would be no different > than what he have now - the RT users would already have the wake up > latency in current kernels without this idea implemented. Did I miss > something? Aggressive real-time applications care deeply about the uncommon case. Thanx, Paul > > > > But what did the scheduler maintainers say about this idea? > > > > > > Last I remember when it came up during the rcu_read_unlock_special() deadlock > > > discussions, there's no way to know for infra like RCU to know that it was > > > invoked from the scheduler. > > > > > > The idea I am bringing up now (about the scheduler itself detecting a > > > recursion) was never brought up (not yet) with the sched maintainers (at > > > least not by me). > > > > It might be good to bounce if off of them sooner rather than later. > > Ok, I did that now over IRC. Thank you! > > - Joel