On Mon, Mar 8, 2021 at 4:51 AM Marco Elver <[email protected]> wrote:
> If we do __initconst change we need to manually remove the duplicate
> lines because we're asking the compiler to create a large array (and
> there's no more auto-dedup). If we do not remove the duplicate lines,
> the __initconst-only approach would create a larger image and result
> in subtly increased memory consumption during init. The additional
> code together with manual dedup should offset that. (I can split this
> patch as Andy suggests, but first need confirmation what people
> actually want.)
>
> I have no idea what the right trade-off is, and appeal to Geert to
> suggest what would be acceptable to him.

Maybe we can have only the message itself wrapped in an #ifdef CONFIG_
of some kind.  For example:

+#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
       pr_warn("**********************************************************\n");
       pr_warn("**   NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE   **\n");
       pr_warn("**                                                      **\n");
       pr_warn("** This system shows unhashed kernel memory addresses   **\n");
...
+#endif

       return 0;
}

In other words, if space is really constrained, then don't include the
message.  Or maybe just include part of the message.

Reply via email to