Re: [PATCH v2] consolidate WARN_...ONCE() static variables

From: Andrew Morton
Date: Tue Feb 28 2012 - 03:30:47 EST


On Tue, 28 Feb 2012 08:16:40 +0000 "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Oh, sorry - to carry static data the accesses to which are unlikely
> (i.e., as in the case given, fully contained in code sections inside
> conditionals which themselves use unlikely() on their primary/only
> clause - in other words, something that the compiler really could
> do on its own).

I think I just learned more about this patch than at any time since we
started discussing it.

Why add a new section, rather than using __read_mostly?

I suppose we should add and use a #define for this, like __read_mostly.
That would be a good site for documenting it ;)

And I come back to my old friend printk_once(). If I'm understanding
things correctly, we can/should make that test unlikely, then mark
__print_once as __this_new_section? Otherwise... help!

btw, I don't think there's a significant performance benefit here - if
the kernel is ever executing WARN_ON_ONCE(), WARN_ONCE() or
printk_once() with any frequency then it is already badly broken.

Which brings us down to saving a bit of space. And I don't think I see
how this saves space?

--
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/