Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6132693ybi; Wed, 29 May 2019 03:23:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBlNhI9aVYVOzsOrcnoH6JQ2siCJCpHtrs3AdDt07fvnCDWOex1AGoeaH7VUWGzMMVvsrY X-Received: by 2002:a17:90a:65c7:: with SMTP id i7mr11212638pjs.32.1559125415672; Wed, 29 May 2019 03:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559125415; cv=none; d=google.com; s=arc-20160816; b=T9Th7hWTKiezX1GsYrydUTxlLFA1926MDk81tdg9qhM0hVIt9k3N5rG5RInj3s4jO4 5op2B68RsyAzHCGY/1jaScja6uMAlC5rn1enZSzK1vauvFy/Rq5+l3+LCN5Db1qe7cNl ubBFLxJqbVe7JJPaxWDChCTsqf2GdkMIKkhNNU9u1lWtBHM+AVaA9BKvCxpxF8EijQK8 GwGlR3uezjOTFIE+v0MqKx8k/chgFUlB7VcYES9pjVIjJ32lyPOs3mtsnW6X2Mek7f5N Br4GUsiHjB3h6jxI8cibQkocAs+yTqz2JA13DF2Q6qopBiyV1Dge/Kv+RnoJpHnAzkzE MzrA== 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=eaEmReJoktuMTB5S11KlWyhQ5sxMXJSXYo6lfdIwCU0=; b=OJppLCiG2+wBuQ/lQcown15Uk1bpAXrDg9rNlCBha0LmismW3g+7462P57UOh3DEff M8BBV9fy1JIebCg13q4gx2kxpqAV+LVd+Rpj336wMSnOLt6tll2YyLf+aW6bJ8ajlr1S XqnKE2lVenx738OXCKWX50rcgErT3dLzaV49xzPwCLDRLiYul7rHvERHFm6UFv1HalD0 JHypLkSM6xgJFILOs2yobScJrA67N0Honsg5N6EK7YJPiG1t3+sR76UziJxPq1o6DQEn /Rb1w0vJpEShVOdwB3Zl+sLMuYRdCF3wyq4Ufo6GZPxBDalD/QJPCwopvxHgxI3gu990 u4Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jLRarsIR; 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 y9si24967877pgj.57.2019.05.29.03.23.16; Wed, 29 May 2019 03:23:35 -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=jLRarsIR; 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 S1726563AbfE2KV4 (ORCPT + 99 others); Wed, 29 May 2019 06:21:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48220 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfE2KV4 (ORCPT ); Wed, 29 May 2019 06:21:56 -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=eaEmReJoktuMTB5S11KlWyhQ5sxMXJSXYo6lfdIwCU0=; b=jLRarsIRHF5opjV03oHEIT31q L8F8AKqtF9E3O5dU3TYoZ2PkJVrTJxhCBB84PoR1ODhLVpvYh7h+xtdIoallzxZ4KfnH/rStJD6N1 PdR5Vw2uNE/QphhjaUUH48JadN3STvyKVw4oT0iKXOtqHSzh01xpAMiRNy3AarVAzoUgFbYiC5B0O BSQNFWU+nT8MlbD+Jl98kL6a7TynzXrP0Ovj9PacgMBo+wDbSIiraOhEoWxaBo38Ir50RSgbTsLkl BECzNv7lF2m6RMtySUzSzo3H8BUUacLlIB/PoCuDBj3XzNA8GNAl/w3H9KdxwwrexhRSVKVbJpYse gI4unhMAA==; 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 1hVvhI-0005BK-F2; Wed, 29 May 2019 10:20:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1D5E8207762A4; Wed, 29 May 2019 12:20:38 +0200 (CEST) Date: Wed, 29 May 2019 12:20:38 +0200 From: Peter Zijlstra To: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org, williams@redhat.com, daniel@bristot.me, "Steven Rostedt (VMware)" , 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: <20190529102038.GO2623@hirez.programming.kicks-ass.net> References: <20190529083357.GF2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 11:40:34AM +0200, Daniel Bristot de Oliveira wrote: > On 29/05/2019 10:33, Peter Zijlstra wrote: > > On Tue, May 28, 2019 at 05:16:23PM +0200, Daniel Bristot de Oliveira wrote: > >> The preempt_disable/enable tracepoint only traces in the disable <-> enable > >> case, which is correct. But think about this case: > >> > >> ---------------------------- %< ------------------------------ > >> THREAD IRQ > >> | | > >> preempt_disable() { > >> __preempt_count_add(1) > >> -------> smp_apic_timer_interrupt() { > >> preempt_disable() > >> do not trace (preempt count >= 1) > >> .... > >> preempt_enable() > >> do not trace (preempt count >= 1) > >> } > >> trace_preempt_disable(); > >> } > >> ---------------------------- >% ------------------------------ > >> > >> The tracepoint will be skipped. > > > > .... for the IRQ. But IRQs are not preemptible anyway, so what the > > problem? > > > right, they are. > > exposing my problem in a more specific way: > > To show in a model that an event always takes place with preemption disabled, > but not necessarily with IRQs disabled, it is worth having the preemption > disable events separated from IRQ disable ones. > > The main reason is that, although IRQs disabled postpone the execution of the > scheduler, it is more pessimistic, as it also delays IRQs. So the more precise > the model is, the less pessimistic the analysis will be. I'm not sure I follow, IRQs disabled fully implies !preemptible. I don't see how the model would be more pessimistic than reality if it were to use this knowledge. Any !0 preempt_count(), which very much includes (Hard)IRQ and SoftIRQ counts, means non-preemptible.