From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339AbbCBBoo (ORCPT ); Sun, 1 Mar 2015 20:44:44 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:37187 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbbCBBok convert rfc822-to-8bit (ORCPT ); Sun, 1 Mar 2015 20:44:40 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Subject: preempt in kprobe From: gmail In-Reply-To: <4EC4716B-53DA-4D32-8D64-F08C4CE536AA@gmail.com> Date: Mon, 2 Mar 2015 09:44:36 +0800 Cc: "linux-kernel@vger.kernel.org" , srostedt@redhat.com Content-Transfer-Encoding: 8BIT Message-Id: <34A24768-2683-4C81-ACB1-F197043B4103@gmail.com> References: <813D1B5D-3D06-4EEF-AA2A-B0B9F8A81154@gmail.com> <13900FF3-780D-4AAF-BF92-3637F7FB8934@gmail.com> <4EC4716B-53DA-4D32-8D64-F08C4CE536AA@gmail.com> To: masami X-Mailer: Apple Mail (2.1993) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, masami: I have read your post at https://lkml.org/lkml/2011/7/1/185 , which remove the preempt disable code in kprobe. Does it safe on arm(32) ? In my scenario I (have to) write some sleep code which may cause reschedule in the probe handler. Then I got schedule bug report like below: <4>[ 369.000535] [] (unwind_backtrace+0x0/0x158) from [] (dump_stack+0x20/0x24) <4>[ 369.000609] [] (dump_stack+0x20/0x24) from [] (__schedule_bug+0x58/0x64) <4>[ 369.000654] [] (__schedule_bug+0x58/0x64) from [] (__schedule+0x764/0x8e0) <4>[ 369.000730] [] (__schedule+0x764/0x8e0) from [] (schedule+0x40/0x80) <4>[ 369.000806] [] (schedule+0x40/0x80) from [] (schedule_timeout+0x230/0x3dc) <4>[ 369.000884] [] (schedule_timeout+0x230/0x3dc) from [] (wait_for_common+0x100/0x184) <4>[ 369.000929] [] (wait_for_common+0x100/0x184) from [] (wait_for_completion+0x24/0x28) <4>[ 369.001007] [] (wait_for_completion+0x24/0x28) from [] (call_usermodehelper_exec+0x150/0x168) <4>[ 369.001083] [] (call_usermodehelper_exec+0x150/0x168) from [] (log_to_user.constprop.1+0x11c/0x16 The bug was triggered by call_usermodehelper with UMH_WAIT_PROC argument , then the schedule function will read the preempt_count. It should be 1, but here it is 2. Is it legal to sleep in kprobe handler? Is there is way to walkaroud this problem? Thanks !!