From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753512AbcCUJ3T (ORCPT ); Mon, 21 Mar 2016 05:29:19 -0400 Received: from [198.137.202.9] ([198.137.202.9]:33181 "EHLO bombadil.infradead.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751421AbcCUJ3G (ORCPT ); Mon, 21 Mar 2016 05:29:06 -0400 Date: Mon, 21 Mar 2016 10:27:46 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: LKML , Ingo Molnar , Thomas Gleixner Subject: Re: [PATCH] sched: Add preempt checks in preempt_schedule() code Message-ID: <20160321092746.GR6344@twins.programming.kicks-ass.net> References: <20160318130602.25f6c9cd@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160318130602.25f6c9cd@gandalf.local.home> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 18, 2016 at 01:06:02PM -0400, Steven Rostedt wrote: > Now by breaking out the preempt off/on tracing into their own code: > preempt_disable_check() and preempt_enable_check(), we can add these to > the preempt_schedule() code. As preemption would then be disabled, even > if they were to be traced by the function tracer, the disabled > preemption would prevent the recursion. > +static inline void preempt_disable_check(int val) > +{ > + if (preempt_count() == val) { > + unsigned long ip = get_parent_ip(CALLER_ADDR1); > +#ifdef CONFIG_DEBUG_PREEMPT > + current->preempt_disable_ip = ip; > +#endif > + trace_preempt_off(CALLER_ADDR0, ip); > + } > +} > +static inline void preempt_enable_check(int val) > +{ > + if (preempt_count() == val) > + trace_preempt_on(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); > +} So no real objection to the patch except this naming. It doesn't 'check', it does preempt-latency tracing. So could we rename this to something like: preempt_{dis,en}able_latency() or somesuch?