Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755373AbYFLGb1 (ORCPT ); Thu, 12 Jun 2008 02:31:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751509AbYFLGbS (ORCPT ); Thu, 12 Jun 2008 02:31:18 -0400 Received: from rv-out-0506.google.com ([209.85.198.235]:46064 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbYFLGbQ (ORCPT ); Thu, 12 Jun 2008 02:31:16 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JDgMu57JTaWsEC51dB3yUeqfJn8NfasV9K7okQprzQpRuvGBTxtNbgsXAIy78lrwOz BxuloyqVwa0yQz4p+JKnhJAzem3jGMRSvafqw4ujZMymbH7CuXdoIDK9ukc6dgd1E1Hp skFZtDBXE9jI/0P60ZVMTaE64KyjPeegUiqRY= Message-ID: Date: Thu, 12 Jun 2008 15:31:04 +0900 From: "junjie cai" To: linux-kernel Subject: [rt] __reacquire_lock_kernel bug? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3940 Lines: 110 Hi, List We get a BUG_ON during some tests on a 2.6.22.19-rt9, the message is pasted at the end of this mail. It seems that preemption happened in __reacquire_kernel_lock() that kernel_lock in released twice. int __lockfunc __reacquire_kernel_lock(void) { local_irq_enable(); >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> preempted here _raw_spin_lock(&kernel_flag); local_irq_disable(); preempt_disable(); } After checking the 2.6.25.4-rt6, I think that same problem exist. Isn't that lock_depth should be set to -1 before local_irq_enable() ? int __lockfunc __reacquire_kernel_lock(void) { struct task_struct *task = current; int saved_lock_depth = task->lock_depth; local_irq_enable(); BUG_ON(saved_lock_depth < 0); >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>preempted here task->lock_depth = -1; down(&kernel_sem); task->lock_depth = saved_lock_depth; local_irq_disable(); return 0; } OOPS message: --------------------------------------------------------------------------------------------------------------------------------------------------- [] (dump_stack+0x0/0x24) from [] (__schedule_bug +0x48/0x54) [] (__schedule_bug+0x0/0x54) from [] (__schedule +0x9c/0x510) r6:000003ff r5:f70d0100 r4:c0199868 [] (__schedule+0x0/0x510) from [] (preempt_schedule_irq+0x48/0x70) [] (preempt_schedule_irq+0x0/0x70) from [] (svc_preempt+0x8/0x20) r4:ffffffff [] (__lock_text_start+0x0/0x2c) from [] (__schedule +0x48c/0x510) [] (__schedule+0x0/0x510) from [] (schedule +0xc8/0x108) [] (schedule+0x0/0x108) from [] (nfs_wait_schedule +0x34/0x40) r4:00000000 [] (nfs_wait_schedule+0x0/0x40) from [] (__wait_on_bit_lock+0x64/0x98) r4:cb65bacc [] (__wait_on_bit_lock+0x0/0x98) from [] (out_of_line_wait_on_bit_lock+0x7c/0x88) r8:cb8172ec r7:00000002 r6:c00ce454 r5:c0000490 r4:cb65bae0 [] (out_of_line_wait_on_bit_lock+0x0/0x88) from [] (__nfs_revalidate_inode+0xe8/0x2f4) [] (__nfs_revalidate_inode+0x0/0x2f4) from [] (nfs_lookup_revalidate+0x1b8/0x430) [] (nfs_lookup_revalidate+0x0/0x430) from [] (do_lookup+0x13c/0x184) [] (do_lookup+0x0/0x184) from [] (__link_path_walk +0x6fc/0x8cc) [] (__link_path_walk+0x0/0x8cc) from [] (link_path_walk+0x80/0x13c) [] (link_path_walk+0x0/0x13c) from [] (path_walk +0x24/0x28) r8:cb656000 r7:cb65bf08 r6:00000001 r5:00000001 r4:cb9f22e0 [] (path_walk+0x0/0x28) from [] (do_path_lookup +0x2b4/0x2e0) [] (do_path_lookup+0x0/0x2e0) from [] (__path_lookup_intent_open+0x54/0x94) r8:00000001 r7:cb65bf08 r6:00000001 r5:ffffffe9 r4:ffffff9c [] (__path_lookup_intent_open+0x0/0x94) from [] (path_lookup_open+0x24/0x2c) r7:00000000 r6:cb656000 r5:cb65bf08 r4:00000000 [] (path_lookup_open+0x0/0x2c) from [] (open_namei +0x60/0x4d4) [] (open_namei+0x0/0x4d4) from [] (do_filp_open +0x2c/0x4c) [] (do_filp_open+0x0/0x4c) from [] (do_sys_open +0x54/0x98) r5:00000003 r4:00000000 [] (do_sys_open+0x0/0x98) from [] (sys_open +0x24/0x28) r8:c0020f04 r7:00000005 r6:00009bfd r5:00070060 r4:00000004 [] (sys_open+0x0/0x28) from [] (ret_fast_syscall +0x0/0x2c) -- /*********************************************/ /* Junjie Cai (junjiec@gmail.com) */ /*********************************************/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/