Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp767911pxa; Thu, 27 Aug 2020 15:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfDNGXpM8T+tJ1B0swGlnoZq7vpmmkTlBfEuM/LD/dfW+ZwmUVsIHDKX7rnuvxVmB45gcF X-Received: by 2002:a17:906:bfcb:: with SMTP id us11mr13634412ejb.502.1598567469909; Thu, 27 Aug 2020 15:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598567469; cv=none; d=google.com; s=arc-20160816; b=RmHKcLPu3y2Gtqrf+mZ1+188otu23xKZaVM1rOUstlaN4+cejtQA8HYsgExcUVzEyZ zz49+wtIwAy/UzG+RaMgmKU+p+wMqAI7wgn1nv75czgTvwaLyyavb+PVU4l72OUyk+Gw 6IQMmDggwHTX71Pm4rJXZ+uII1hclv/QNuK5sSbf7cU7pVdfpe1dHS+ONGqtSJyUcVsS z3OzfwHRBc9Y8o/iTI/jI3bjtflnXoGOVm5b+og6jwUeoJVT9bJxXfbFji1ICOwxVuSd ibh9hc0jUSixmQaAb06YOvKDGJoTReRSjkSopnLBshsHzizcA6Fn5dQGA17nhHeScVW/ +WGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fJ9qJt6OX2+WeqcsogZiCHLA68aY3qughbK/gCdupAY=; b=sWEm8sZEwmswxKzm65EvxwvW/Q16SM5rWj2+JRw3f99nZ8OpwfNIen4/D6CGwl5KOY +X1Hmfdi16LwBWjIDoj+r5bVxcaXLXbqY5063BxnlTcXSKIl83Mr4BjppfkYDSfH8pnR nBMxSf+Uw58PytWKhnYK28/99DhapJZ23DFvo5negDUWPJfb+0hbCTRKn7fxJO1+TmeY isiJNn5WbG+5mHoBJVW4gRsA0qdIeT+mYRbPcgPduEAj967J1k2f+VM8BvqErjQfCj7a QbxJOaiEY9yOEkYMtBVfxpw4kJzFT/Jt9gHPEhimAb29qzK56oZ8Z8O8CsSwrX+uEM9M HxFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=oI+Xm2ET; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t27si2286367ejf.672.2020.08.27.15.30.47; Thu, 27 Aug 2020 15:31:09 -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=@joelfernandes.org header.s=google header.b=oI+Xm2ET; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727940AbgH0WaF (ORCPT + 99 others); Thu, 27 Aug 2020 18:30:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgH0WaF (ORCPT ); Thu, 27 Aug 2020 18:30:05 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9852C061264 for ; Thu, 27 Aug 2020 15:30:04 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id s16so5989880qtn.7 for ; Thu, 27 Aug 2020 15:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fJ9qJt6OX2+WeqcsogZiCHLA68aY3qughbK/gCdupAY=; b=oI+Xm2ETkWYOHEctXypXfT7xmzm3loPC9+zkZyJ1x8N7QeG6teMe1pDHazuXxRcTFY ZYxjJz39+DhuZnbhle0KciuXBsib5qGiX3vNJsVIhF8tE251m/BMEX7hxm8zamg0nunl SRsL7DL+qNDgmBpxdsibHt83qbee+fKlFWZ2g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fJ9qJt6OX2+WeqcsogZiCHLA68aY3qughbK/gCdupAY=; b=H8w76H1xyee2xmqC9dt0L261fz3x2tbu5CeMbDiylOKUM7qMsaUK5ZtGicnLlkCdZR tjOCpWCr6bmMlFDck2fXhpUjvOchiLVR0S09gQ3ptwUAy42JZfwI7qJyFZ9Tdyh709xW aWOV1sJ4l/OBQAwUPdP+ZFqlQkciJpEJPEPEBEHAtrdBWcqeNLvkinGxApZ8klYjF39o KtNNhZ0zNpb64cPRgWGNxbVuhbRyXGBkSlEq96+4g2JdJCs44sasFwVz1fovIUwyGNzx 51ELAxsd/Qn28vgsSQ3f9G/efqO2nTuJnylXqDr/NpJnShBG7qT4+eaxu1NxYVj31mXJ Oa2w== X-Gm-Message-State: AOAM532j8Y7M64HlE19BCYZQYoCgD96fPMtvK5vn6gX8Cq/4tvxQNkRq ogljLgIXUSQumyxT6a6h8Vyjog== X-Received: by 2002:ac8:7698:: with SMTP id g24mr20968039qtr.217.1598567402879; Thu, 27 Aug 2020 15:30:02 -0700 (PDT) Received: from localhost ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id w44sm3178673qtj.86.2020.08.27.15.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 15:30:02 -0700 (PDT) Date: Thu, 27 Aug 2020 18:30:01 -0400 From: Joel Fernandes To: peterz@infradead.org Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, will@kernel.org, npiggin@gmail.com, elver@google.com, jgross@suse.com, paulmck@kernel.org, rostedt@goodmis.org, rjw@rjwysocki.net, svens@linux.ibm.com, tglx@linutronix.de, mathieu.desnoyers@efficios.com Subject: Re: [PATCH v2 03/11] sched,idle,rcu: Push rcu_idle deeper into the idle path Message-ID: <20200827223001.GA3821640@google.com> References: <20200821084738.508092956@infradead.org> <20200821085348.310943801@infradead.org> <20200827011826.GA1942571@google.com> <20200827012419.GB1942571@google.com> <20200827074748.GY2674@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200827074748.GY2674@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 09:47:48AM +0200, peterz@infradead.org wrote: > On Wed, Aug 26, 2020 at 09:24:19PM -0400, Joel Fernandes wrote: > > On Wed, Aug 26, 2020 at 09:18:26PM -0400, Joel Fernandes wrote: > > > On Fri, Aug 21, 2020 at 10:47:41AM +0200, Peter Zijlstra wrote: > > > > Lots of things take locks, due to a wee bug, rcu_lockdep didn't notice > > > > that the locking tracepoints were using RCU. > > > > > > > > Push rcu_idle_{enter,exit}() as deep as possible into the idle paths, > > > > this also resolves a lot of _rcuidle()/RCU_NONIDLE() usage. > > > > > > > > Specifically, sched_clock_idle_wakeup_event() will use ktime which > > > > will use seqlocks which will tickle lockdep, and > > > > stop_critical_timings() uses lock. > > > > > > I was wondering if those tracepoints should just use _rcuidle variant of the > > > trace call. But that's a terrible idea considering that would add unwanted > > > overhead I think. > > > > > > Reviewed-by: Joel Fernandes (Google) > > > > BTW, if tracepoint is converted to use RCU-trace flavor, then these kinds of > > issues go away, no? That RCU flavor is always watching. > > All trace_*_rcuidle() and RCU_NONIDLE() usage is a bug IMO. > > Ideally RCU-trace goes away too. I was thinking that unless the rcu_idle_enter/exit calls coincide with points in the kernel where instrumentation is not allowed, there is always a chance somebody wants to use tracepoints after rcu_idle_enter or before exit. In this case, trace_*_rcuidle() is unavoidable unless you can move the rcu_idle_enter/exit calls deeper as you are doing. Maybe objtool can help with that? The other solution is RCU-trace if you can't push the rcu_idle_enter/exit calls any deeper and still want to get rid of trace_*_rcuidle thingies. Me and Mathieu were talking at LPC about tracepoint conversion to RCU-trace and we can work on it if that's the right direction. thanks, - Joel