Re: NOHZ: WARNING: at arch/x86/kernel/smp.c:123native_smp_send_reschedule

From: Jiri Kosina
Date: Fri May 10 2013 - 11:42:21 EST


On Fri, 10 May 2013, Frederic Weisbecker wrote:

> In fact it would be nice to have DO_ONCE(something) and stuff whatever
> we want inside.
> All the printk_once() et. al could even be implemented using that.

Sounds nice, but if it's going to be used for something else than purely
debugging output, one has to keep in mind that printk_once() as currently
implemented is actually racy.

I.e. you'd need to have locking (or at least cmpxchg) protecting the
update of the static variable.

--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/