[Devel] Re: [PATCH 2/6] BC: beancounters core (API)

Alexey Dobriyan adobriyan at gmail.com
Wed Aug 23 06:53:11 PDT 2006


> >>+void __put_beancounter(struct beancounter *bc)
> >>+{
> >>+	unsigned long flags;
> >>+
> >>+	/* equivalent to atomic_dec_and_lock_irqsave() */
> >>+	local_irq_save(flags);
> >>+	if (likely(!atomic_dec_and_lock(&bc->bc_refcount, &bc_hash_lock))) {
> >>+		local_irq_restore(flags);
> >>+		if (unlikely(atomic_read(&bc->bc_refcount) < 0))
> >>+			printk(KERN_ERR "BC: Bad refcount: bc=%p, "
> >>+					"luid=%d, ref=%d\n",
> >>+					bc, bc->bc_id,
> >>+					atomic_read(&bc->bc_refcount));
> >
> >
> >Should this BUG_ON() ?
> BUG_ON doesn't print much information :)
> ok, will replace

but printk + BUG does ;-)




More information about the Devel mailing list