From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339AbcIILfY (ORCPT ); Fri, 9 Sep 2016 07:35:24 -0400 Received: from foss.arm.com ([217.140.101.70]:39608 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754093AbcIILfW (ORCPT ); Fri, 9 Sep 2016 07:35:22 -0400 Date: Fri, 9 Sep 2016 12:35:08 +0100 From: Catalin Marinas To: Chunyan Zhang Cc: rostedt@goodmis.org, mingo@redhat.com, mark.yang@spreadtrum.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, takahiro.akashi@linaro.org Subject: Re: [PATCH] arm64: use preempt_disable_notrace in _percpu_read/write Message-ID: <20160909113508.GC19083@e104818-lin.cambridge.arm.com> References: <1473338802-18712-1-git-send-email-zhang.chunyan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473338802-18712-1-git-send-email-zhang.chunyan@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2016 at 08:46:42PM +0800, Chunyan Zhang wrote: > When debug preempt or preempt tracer is enabled, preempt_count_add/sub() > can be traced by function and function graph tracing, and > preempt_disable/enable() would call preempt_count_add/sub(), so in Ftrace > subsystem we should use preempt_disable/enable_notrace instead. > > In the commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap > like events do") the function this_cpu_read() was added to > trace_graph_entry(), and if this_cpu_read() calls preempt_disable(), graph > tracer will go into a recursive loop, even if the tracing_on is > disabled. > > So this patch change to use preempt_enable/disable_notrace instead in > this_cpu_read(). > > Since Yonghui Yang helped a lot to find the root cause of this problem, > so also add his SOB. > > Signed-off-by: Yonghui Yang > Signed-off-by: Chunyan Zhang Queued for 4.8-rc6. Thanks. -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Fri, 9 Sep 2016 12:35:08 +0100 Subject: [PATCH] arm64: use preempt_disable_notrace in _percpu_read/write In-Reply-To: <1473338802-18712-1-git-send-email-zhang.chunyan@linaro.org> References: <1473338802-18712-1-git-send-email-zhang.chunyan@linaro.org> Message-ID: <20160909113508.GC19083@e104818-lin.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Sep 08, 2016 at 08:46:42PM +0800, Chunyan Zhang wrote: > When debug preempt or preempt tracer is enabled, preempt_count_add/sub() > can be traced by function and function graph tracing, and > preempt_disable/enable() would call preempt_count_add/sub(), so in Ftrace > subsystem we should use preempt_disable/enable_notrace instead. > > In the commit 345ddcc882d8 ("ftrace: Have set_ftrace_pid use the bitmap > like events do") the function this_cpu_read() was added to > trace_graph_entry(), and if this_cpu_read() calls preempt_disable(), graph > tracer will go into a recursive loop, even if the tracing_on is > disabled. > > So this patch change to use preempt_enable/disable_notrace instead in > this_cpu_read(). > > Since Yonghui Yang helped a lot to find the root cause of this problem, > so also add his SOB. > > Signed-off-by: Yonghui Yang > Signed-off-by: Chunyan Zhang Queued for 4.8-rc6. Thanks. -- Catalin