Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6365970ybi; Wed, 29 May 2019 06:52:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUCbjwk8tia4USzBD42baLJc0wX6ve+Lp1TnKrrGEKDZfphZkBaEOqOXRiw1tAPmYXDhQs X-Received: by 2002:a17:90a:e17:: with SMTP id v23mr12198573pje.139.1559137959294; Wed, 29 May 2019 06:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559137959; cv=none; d=google.com; s=arc-20160816; b=04ue1U14DgLgwtJlkwiCMqkvHRp9A1W9Vz64kuWxQTSj9A29hjNLISNpBHiOg9Sjp4 Om0QaKWV4NCClin4ZuY/ce9JETrH1pydZlXMuwoA8rf54CDEPIiPXIqeKa9kmuzEqnyx vtkw7qKMjsF6b/6vNSnCt88zl/0vGFkfTZ8j0BYdmyqG5dg0tpX4qeMrz6Vt/oHj6kso gaq1Kt1fC4QhMp96AWAMbUwsQIxh9WF3M9/xbx65vRSKMauy2ehsfhlb8xW1UA6fmcgI PlnSHNfwqDccW3sRbYX/9sWW4NWTUOPKV8NaxX7Bz0Z/GK61c2xAigcRp+ZtSNX0EoPW Ju+w== 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=IpEYYRtOcuoBCe0NJPft5Tkz/UAzt+RuLMsB2MN2GaE=; b=d3UhUIz+zjQLCc2Ug0gwup7ZQChvcSN43RWbfQ3QFlVFVk+9OBdC2Mp5tB5s7/w9f8 JB7C0LwHwfY+WD1zuMrzFXgs5Woa/50ivGDKzdomdxKKcj1zQ0oMhP7ji64/P1ZyzT1c epTj6dneuNOX9T0fSz+/vITWYg6Bg+nzpuC8q/EcdnzVRGGwJAa99UqKjvMJjivrINHU ucMgZ8RCTQ65XYWobIIjPgaSb0ZhTxov54qPQKOCLJW0CSFn+MxkToHPE4CORxUKgvOm jWh9JuPy7h9PT5xLCojlv6E3QtUWCM8FSaIr+vJ74mc62WEEiL9J0+IoafeiTjFMQPvZ JKFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="H0/es3dS"; 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 r127si26329564pgr.359.2019.05.29.06.52.22; Wed, 29 May 2019 06:52:39 -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="H0/es3dS"; 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 S1727443AbfE2NvE (ORCPT + 99 others); Wed, 29 May 2019 09:51:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41142 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfE2NvE (ORCPT ); Wed, 29 May 2019 09:51:04 -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=IpEYYRtOcuoBCe0NJPft5Tkz/UAzt+RuLMsB2MN2GaE=; b=H0/es3dSmh57wK1K3O8+kBAg3 ChXfTK85OzhoOPfgTevzcNUrAqF6pQpqmybER+BZc+AVcUbvYZpA8jiqqYbcgy/Ixvs/EXzVCBKuL gWbl33SyM+tWo/GpkuFb9/pJWPfbVYxYvZE5dyEpx6SY+BfMCidVAlyRjZf1/htQPJ20px3gEuHzd PNI6EPxn01Ft3nIv//XLyAPLpH2i8bxEJ3lkzj3fLxr4KeLindTwHAFIl6fUh+VnkWSIb6DURsTEa N1IRGMF+BF96BbGkldDqaqslVHn8XV2FOcH4RYBCSvu4OxxuhWfMzGibLOdXGqBwD3jU8iQtW+k8Z LQ1T6AKBQ==; 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.90_1 #2 (Red Hat Linux)) id 1hVyxf-0004uF-Rj; Wed, 29 May 2019 13:49:48 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2EC04201CF1B6; Wed, 29 May 2019 15:49:46 +0200 (CEST) Date: Wed, 29 May 2019 15:49:46 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, williams@redhat.com, daniel@bristot.me, Ingo Molnar , Thomas Gleixner , "Paul E. McKenney" , Matthias Kaehlcke , "Joel Fernandes (Google)" , Frederic Weisbecker , Yangtao Li , Tommaso Cucinotta Subject: Re: [RFC 2/3] preempt_tracer: Disable IRQ while starting/stopping due to a preempt_counter change Message-ID: <20190529134946.GY2623@hirez.programming.kicks-ass.net> References: <20190529083357.GF2623@hirez.programming.kicks-ass.net> <20190529102038.GO2623@hirez.programming.kicks-ass.net> <20190529083930.5541130e@oasis.local.home> <20190529131957.GV2623@hirez.programming.kicks-ass.net> <20190529094213.3e344965@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190529094213.3e344965@oasis.local.home> 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 Wed, May 29, 2019 at 09:42:13AM -0400, Steven Rostedt wrote: > > And the preempt_irqoff tracer had better also consume the IRQ events, > > and if it does that it can DTRT without extra bits on, even with that > > race. > > > > Consider: > > > > preempt_disable() > > preempt_count += 1; > > > > trace_irq_enter(); > > > > trace_irq_exit(); > > > > trace_preempt_disable(); > > > > /* does stuff */ > > > > preempt_enable() > > preempt_count -= 1; > > trace_preempt_enable(); > > > > You're saying preempt_irqoff() fails to connect the two because of the > > hole between trace_irq_exit() and trace_preempt_disable() ? > > > > But trace_irq_exit() can see the raised preempt_count and set state > > for trace_preempt_disable() to connect. > > That's basically what I was suggesting as the solution to this ;-) You were wanting changes to preempt_disable() and task_struct, neither of which is required. The above only needs some per-cpu storage in the tracer implementation.