2.4: BUG_ON (2/2)
Subsystems (6)
PATCH 1/1 2.4: BUG_ON (2/2)
Marcelo,
This patch, which requires the previous BUG_ON part 1 patch, changes a few uses of BUG -> BUG_ON in fast paths in the kernel.
Patch is against 2.4.19-pre4. Marcelo, please apply.
Robert Love
arch/i386/kernel/smp.c +1 -2
@@ -301,8 +301,7 @@*/ static void inline leave_mm (unsigned long cpu) { -if (cpu_tlbstate[cpu].state ==TLBSTATE_OK ) -BUG (); +BUG_ON (cpu_tlbstate[cpu].state ==TLBSTATE_OK );clear_bit (cpu, &cpu_tlbstate[cpu].active_mm->cpu_vm_mask); }
kernel/exit.c +1 -1
@@ -316,7 +316,7 @@mm_release ();if (mm) {atomic_inc (&mm->mm_count); -if (mm != tsk->active_mm)BUG (); +BUG_ON (mm != tsk->active_mm);/* more a memory barrier than a real lock */ task_lock (tsk); tsk->mm =NULL ;
kernel/fork.c +1 -1
@@ -251,7 +251,7 @@*/ inline void __mmdrop (struct mm_struct *mm) { -if (mm == &init_mm)BUG (); +BUG_ON (mm == &init_mm);pgd_free (mm->pgd);destroy_context (mm);free_mm (mm);
kernel/sched.c +3 -3
@@ -556,7 +556,7 @@spin_lock_prefetch (&runqueue_lock); -if (!current->active_mm)BUG (); +BUG_ON (!current->active_mm); need_resched_back: prev = current; this_cpu = prev->processor;
@@ -675,12 +675,12 @@struct mm_struct *mm = next->mm;struct mm_struct *oldmm = prev->active_mm;if (!mm) { -if (next->active_mm)BUG (); +BUG_ON (next->active_mm); next->active_mm = oldmm;atomic_inc (&oldmm->mm_count);enter_lazy_tlb (oldmm, next, this_cpu); }else { -if (next->active_mm != mm)BUG (); +BUG_ON (next->active_mm != mm);switch_mm (oldmm, mm, next, this_cpu); }
mm/slab.c +1 -2
@@ -666,8 +666,7 @@* Always checks flags, a caller might be expecting debug * support which isn't available. */ -if (flags & ~CREATE_MASK ) -BUG (); +BUG_ON (flags & ~CREATE_MASK );/* Get cache's description obj. */ cachep = (kmem_cache_t *)kmem_cache_alloc (&cache_cache,SLAB_KERNEL );
mm/vmscan.c +3 -6
@@ -234,8 +234,7 @@ pgdir =pgd_offset (mm, address); end = vma->vm_end; -if (address >= end) -BUG (); +BUG_ON (address >= end); do { count = swap_out_pgd(mm, vma, pgdir, address, end, count, classzone); if (!count)
@@ -354,10 +353,8 @@ page = list_entry(entry, struct page, lru); -if (unlikely (!PageLRU (page))) -BUG (); -if (unlikely (PageActive (page))) -BUG (); +BUG_ON (!PageLRU (page)); +BUG_ON (PageActive (page));list_del (entry);list_add (entry, &inactive_list);
Quoted 4 lines
This patch, which requires the previous
BUG_ONpart 1 patch, changes a few uses of BUG ->BUG_ONin fast paths in the kernel.Patch is against 2.4.19-pre4. Marcelo, please apply.
Can we get Andrew's "oh look my kernel is 100Kb smaller" changes in first, there are some clashes here and I think the 100K one is more important personally 8)
Quoted 3 lines · Alan Cox
Can we get Andrew's "oh look my kernel is 100Kb smaller" changes in first, there are some clashes here and I think the 100K one is more important personally 8)
If we must. :)
Robert Love