Performance Question: BUG_ON vs. WARN_ON_ONCE

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: LKML <linux-kernel@...>, Nick Piggin <nickpiggin@...>
Date: Sunday, July 13, 2008 - 7:57 pm

I was porting the -rt branch to the latest -mm kernel and encountered
a bug. The
replace-bugon-by-warn-on.patch patch make the following change:

diff --git a/18f7d025bb2e5762fd4063cce0b6e2342475c55c:arch/x86/mm/highmem_32.c
b/db090b52f9d2f9088a4ff9bce530e3c234c8e3af:arch/x86/mm/highmem_32.c
index 165c871ba9af0211e0c939e0bc2212750d4bf39f..402ecdd04d7818fd24e921c94b698faa19383b71
100644
--- a/18f7d025bb2e5762fd4063cce0b6e2342475c55c:arch/x86/mm/highmem_32.c
+++ b/db090b52f9d2f9088a4ff9bce530e3c234c8e3af:arch/x86/mm/highmem_32.c
@@ -84,7 +84,7 @@ void *kmap_atomic_prot(struct page *page, enum
km_type type, pgprot_t prot)

 	idx = type + KM_TYPE_NR*smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
-	BUG_ON(!pte_none(*(kmap_pte-idx)));
+	WARN_ON_ONCE(!pte_none(*(kmap_pte-idx)));
 	set_pte(kmap_pte-idx, mk_pte(page, prot));
 	arch_flush_lazy_mmu_mode();

However, this causes the kernel to crash or oops under certain loads.
Reverting this change makes the error go away. Is there any sort of
performance difference between BUG_ON and WARN_ON_ONCE, I figure the
change was for a reason so I am wondering what will result from this
change. Any info would be appreciated.

-Ryan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Performance Question: BUG_ON vs. WARN_ON_ONCE, Ryan Hope, (Sun Jul 13, 7:57 pm)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Eduard - Gabriel Munteanu..., (Sun Jul 13, 11:36 pm)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Ryan Hope, (Mon Jul 14, 12:10 am)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Eduard - Gabriel Munteanu..., (Mon Jul 14, 12:36 am)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Nick Piggin, (Mon Jul 14, 1:05 am)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Ryan Hope, (Mon Jul 14, 12:51 am)
Re: Performance Question: BUG_ON vs. WARN_ON_ONCE, Ryan Hope, (Mon Jul 14, 12:12 am)