Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6682832ybi; Wed, 29 May 2019 11:24:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLJt7jWrckhxs4lf9Dw7HSm1fYn1aAxXR0K0ZsbYG6x96+1RRnq3J6k3GYaoLv4uxJc4VW X-Received: by 2002:a62:ea04:: with SMTP id t4mr148109967pfh.47.1559154292493; Wed, 29 May 2019 11:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559154292; cv=none; d=google.com; s=arc-20160816; b=Vh3JXhnpoP01nWS/orOOnPtjpOXq3T9nli33O4NwHKxKRIEfGl6LkAxN4yCcR6l+Vm gmhCuBbxgNpQcC5pcMH5Rn0fUodSbMnDN1CkWZnHpKtz5ZuYhjPiO8+VhORa3Xzl7Jl2 teAr+44h8ncvX4fMjAd+Szm0Onq8JWR03APK2BclHKC2uGfKw0UNvwcO7C+dl3lgAL83 NEa2TKxG+4AVcyrbIUTFn9dkBsl9SMVmGWEE2IjkJiXXfH3BLEKMNbuy9T3LMKjJ1Lw4 XFUFoF8c7HX142le30RaQ8YHy1vILgWzZ6NhLo3QoFy3ZGKBa3zugUOX8SMdhGS9hKzi BD6w== 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=46u7yWH7SEbkA+LGUDG+c1CeWmaboYlcCKtUzEnRpo8=; b=G+65eGLiusFrvvy+/vMgY531aQE/YDFEEr9s+HADs+zcXmQUNGXYl9rMvwZ8Qlf2va rmfeMfR6pjOvllHqGysYZLS3+2qETzkWty7oMP4usqqFFzI5DCgdn+64GKY4p/hScg9o iow50Q4yY+oDYgYQmc65tiQT6gUeL0Q0qtolTkd6+mv7VFqxa4nBpIhi6QLbzpSZMaJ7 t6btcVT4O1GbBJeX7AQdyKkcFrmcT+9GXxgSOJaMgTE09FRDZ56559kZiCp9JnlcQJ0A 9rF+LimA8w7+e59xeumW/OHcECkJS4lD/fhO7fb7fOc1LgFxF84eOuIdar9zVdAkjhBF HCqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=YIfCt4yr; 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 m21si396437pls.48.2019.05.29.11.24.35; Wed, 29 May 2019 11:24:52 -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=merlin.20170209 header.b=YIfCt4yr; 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 S1727477AbfE2SWw (ORCPT + 99 others); Wed, 29 May 2019 14:22:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38610 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfE2SWv (ORCPT ); Wed, 29 May 2019 14:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=46u7yWH7SEbkA+LGUDG+c1CeWmaboYlcCKtUzEnRpo8=; b=YIfCt4yrE3A4keXkYIi7JRIyx DIgQER+VsVxJJ0t+VdSGG6VF0tK5H87d+mbDQYY7AzUdJK3zGlBl/1jWQ41sDtNqQmkwRDdyJgkyZ Sjp/L/jB8y2DFH0nTYWSiJ9X+goO9gGWW/HirZu+iT/ufJdU/BitgcUik6T3/D+APf8LdmemSFnB0 LsvI4AJ7OtILMHg4O8Q7c0XLb0A6sr1UVAwhvRK5GFMjo00KZwdKGdk8tO6UqbqvAsSNMWrAXf+81 ckcngmi+jYUFgs3mMddy/Q3Y+7oxDixoE+OAPeR3AHX083gVTIU2TkIjSUWXeLe1ZRW8SbIZx7q/p DLuA+3JHw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hW3Cp-0000m8-Va; Wed, 29 May 2019 18:21:44 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A1B03201B3992; Wed, 29 May 2019 20:21:42 +0200 (CEST) Date: Wed, 29 May 2019 20:21:42 +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: <20190529182142.GF2623@hirez.programming.kicks-ass.net> References: <20190529083357.GF2623@hirez.programming.kicks-ass.net> <20190529102038.GO2623@hirez.programming.kicks-ass.net> <94669b5a-06dd-e9bf-cfb6-b5d507a90946@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94669b5a-06dd-e9bf-cfb6-b5d507a90946@redhat.com> 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 03:51:31PM +0200, Daniel Bristot de Oliveira wrote: > On 29/05/2019 12:20, Peter Zijlstra wrote: > > 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. > > Maybe I did not expressed myself well... and the example was not good either. > > "IRQs disabled fully implies !preemptible" is a "to big" step. In modeling (or > mathematical reasoning?), a good practice is to break the properties into small > piece, and then build more complex reasoning/implications using these "small > properties." > > Doing "big steps" makes you prone "miss interpretations", creating ambiguity. > Then, -RT people are prone to be pessimist, non-RT optimistic, and so on... and > that is what models try to avoid. You already construct the big model out of small generators, this is just one more of those little generators. > For instance, explaining this using words is contradictory:> > > Any !0 preempt_count(), which very much includes (Hard)IRQ and SoftIRQ > > counts, means non-preemptible. > > One might argue that, the preemption of a thread always takes place with > preempt_count() != 0, because __schedule() is always called with preemption > disabled, so the preemption takes place while in non-preemptive. Yeah, I know about that one; you've used it in your talks. Also, you've modeled the schedule preempt disable as a special state. If you want we can actually make it a special bit in the preempt_count word too, the patch shouldn't be too hard, although it would make no practical difference. > - WAIT But you (daniel) wants to fake the atomicity between preempt_disable and > its tracepoint! > > Yes, I do, but this is a very straightforward step/assumption: the atomicity is > about the real-event and the tracepoint that notifies it. It is not about two > different events. > > That is why it is worth letting the modeling rules to clarify the behavior of > system, without doing non-obvious implication in the code part, so we can have a > model that fits better in the Linux actions/events to avoid ambiguity. You can easily build a little shim betwen the model and the tracehooks that fix this up if you don't want to stick it in the model proper. All the information is there. Heck you can even do that 3/3 thing internally I think.