lkml.org 
[lkml]   [2019]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] include/linux/module.h: mark init/cleanup_module aliases as __cold
On Wed, Feb 6, 2019 at 5:31 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Feb 4, 2019 at 4:08 PM Jessica Yu <jeyu@kernel.org> wrote:
> >
> > IMHO I think annotating with __init is more straightforward, instead
> > of cherry-picking attributes (we wouldn't know at first glance why the
> > aliases are specifically annotated with __cold without looking at git
> > history). Plus the actual module init function and alias declarations
> > would be consistent. Just looking at the __init attributes:
> >
> > #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline

By the way, note that we also need to annotate the exit ones. To do
something similar, for __exit we have:

#define __exit __section(.exit.text) __exitused __cold notrace

__exitused expands to nothing when MODULE is defined.

notrace is either hotpatch(0,0) or no_instrument_function; and they
shouldn't matter in the alias since we are not generating code (and
anyway they disable the extra code, instead of enabling).

So I will also use __exit there instead of only __cold too.

Cheers,
Miguel

\
 
 \ /
  Last update: 2019-02-06 18:29    [W:0.057 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site