From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758297AbcIWCxL (ORCPT ); Thu, 22 Sep 2016 22:53:11 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:45726 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbcIWCxJ (ORCPT ); Thu, 22 Sep 2016 22:53:09 -0400 Date: Fri, 23 Sep 2016 10:48:29 +0800 From: Jisheng Zhang To: Steven Rostedt CC: Thomas Gleixner , , LKML , LAK Subject: Re: [PATCH] clocksource/drivers/ti-32k: Prevent ftrace recursion Message-ID: <20160923104829.29a3b68b@xhacker> In-Reply-To: <20160922224514.696ae61b@gandalf.local.home> References: <20160922075621.3725-1-jszhang@marvell.com> <20160923100431.6cf2c88f@xhacker> <20160922224514.696ae61b@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-23_01:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609230049 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Sep 2016 22:45:14 -0400 Steven Rostedt wrote: > On Fri, 23 Sep 2016 10:04:31 +0800 > Jisheng Zhang wrote: > > > Hi Thomas, > > > > On Thu, 22 Sep 2016 15:58:03 +0200 Thomas Gleixner wrote: > > > > > On Thu, 22 Sep 2016, Jisheng Zhang wrote: > > > > > > > Currently ti-32k can be used as a scheduler clock. We properly marked > > > > omap_32k_read_sched_clock() as notrace but we then call another > > > > function ti_32k_read_cycles() that _wasn't_ notrace. > > > > > > > > Having a traceable function in the sched_clock() path leads to a > > > > recursion within ftrace and a kernel crash. > > > > > > Kernel crash? Doesn't ftrace core prevent recursion? > > > > a recent similar issue: > > > > http://www.spinics.net/lists/arm-kernel/msg533480.html > > Right. But Thomas brought up recursion detection. And I said that would > be the fix, but now thinking about it, I've updated the recursion > protection so that timer issues should not cause a crash. > Got it. Thanks for the clarification