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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to