Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215993 > unrolled thread

timing of module MODULE_STATE_COMING notifier

Started by"Frank Ch. Eigler" <fche@redhat.com>
First post2015-08-31 02:10 +0200
Last post2015-09-02 08:20 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  timing of module MODULE_STATE_COMING notifier "Frank Ch. Eigler" <fche@redhat.com> - 2015-08-31 02:10 +0200
    Re: timing of module MODULE_STATE_COMING notifier Rusty Russell <rusty@rustcorp.com.au> - 2015-08-31 03:40 +0200
      Re: timing of module MODULE_STATE_COMING notifier "Frank Ch. Eigler" <fche@redhat.com> - 2015-08-31 15:00 +0200
        Re: timing of module MODULE_STATE_COMING notifier "Frank Ch. Eigler" <fche@redhat.com> - 2015-08-31 22:50 +0200
          Re: timing of module MODULE_STATE_COMING notifier Rusty Russell <rusty@rustcorp.com.au> - 2015-09-02 08:20 +0200

#1215993 — timing of module MODULE_STATE_COMING notifier

From"Frank Ch. Eigler" <fche@redhat.com>
Date2015-08-31 02:10 +0200
Subjecttiming of module MODULE_STATE_COMING notifier
Message-ID<q3kPD-7SX-9@gated-at.bofh.it>
Hi, Rusty -

We just [1] came across your patch [2] from last year (merged into
3.17), wherein the RO/NX mapping settings for module sections were
moved to an earlier point in the module-loading sequence.

That patch also moved the MODULE_STATE_COMING notifier call to
complete_formation(), which is relatively early to its former
do_init_module() call site.  It now precedes the parse_args(),
mod_sysfs_setup(), and trace_module_load() steps.

Was the latter part of the change intended & necessary?  It is
negatively impacting systemtap, which was relying on
MODULE_STATE_COMING being called from a fairly complete module state -
just before the actual initializer function call.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=18889

[2] commit 4982223e51e8ea9d09bb33c8323b5ec1877b2b51
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Wed May 14 10:54:19 2014 +0930


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

[toc] | [next] | [standalone]


#1215996

FromRusty Russell <rusty@rustcorp.com.au>
Date2015-08-31 03:40 +0200
Message-ID<q3meJ-1lj-13@gated-at.bofh.it>
In reply to#1215993
"Frank Ch. Eigler" <fche@redhat.com> writes:
> Hi, Rusty -
>
> We just [1] came across your patch [2] from last year (merged into
> 3.17), wherein the RO/NX mapping settings for module sections were
> moved to an earlier point in the module-loading sequence.
>
> That patch also moved the MODULE_STATE_COMING notifier call to
> complete_formation(), which is relatively early to its former
> do_init_module() call site.  It now precedes the parse_args(),
> mod_sysfs_setup(), and trace_module_load() steps.

Yes, parse_args() can enter the module, so you really want it before
then.

> Was the latter part of the change intended & necessary?  It is
> negatively impacting systemtap, which was relying on
> MODULE_STATE_COMING being called from a fairly complete module state -
> just before the actual initializer function call.

Notifiers suck for stuff like this :(

Module state has many steps, so my preference has been to open-code
explicit hooks.  This would seem to reinforce that preference...

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

[toc] | [prev] | [next] | [standalone]


#1216166

From"Frank Ch. Eigler" <fche@redhat.com>
Date2015-08-31 15:00 +0200
Message-ID<q3wQO-89h-15@gated-at.bofh.it>
In reply to#1215996
Hi, Rusty -

Thanks for your response!

> [...]
> > That patch also moved the MODULE_STATE_COMING notifier call to
> > complete_formation(), which is relatively early to its former
> > do_init_module() call site.  It now precedes the parse_args(),
> > mod_sysfs_setup(), and trace_module_load() steps.
> 
> Yes, parse_args() can enter the module, so you really want it before
> then.

Understood.  (Perhaps mod_sysfs_setup() could sneak in ahead.)


> > Was the latter part of the change intended & necessary?  It is
> > negatively impacting systemtap, which was relying on
> > MODULE_STATE_COMING being called from a fairly complete module
> > state - just before the actual initializer function call.

> Notifiers suck for stuff like this :( Module state has many steps,
> so my preference has been to open-code explicit hooks.  [...]

You mean something like the trace_module_load()?  (We will probably
experiment with hooking into that tracepoint instead of the notifier.)
A more hard-coded one with an in-kernel callee probably wouldn't help
module-resident clients like us.


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

[toc] | [prev] | [next] | [standalone]


#1216441

From"Frank Ch. Eigler" <fche@redhat.com>
Date2015-08-31 22:50 +0200
Message-ID<q3EbF-1Wt-29@gated-at.bofh.it>
In reply to#1216166
Hi, Rusty -


I wrote:

> [...]
> > Notifiers suck for stuff like this :( Module state has many steps,
> > so my preference has been to open-code explicit hooks.  [...]
> 
> You mean something like the trace_module_load()?  (We will probably
> experiment with hooking into that tracepoint instead of the notifier.)
> [...]

It turns out this works OK, except for EXPORT_TRACEPOINT_SYMBOL_GPL.
Could we get a set of EXPORT_TRACEPOINT_SYMBOL_GPL's for the
trace/events/module.h tracepoints (at least module_load and
module_free)?


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

[toc] | [prev] | [next] | [standalone]


#1217335

FromRusty Russell <rusty@rustcorp.com.au>
Date2015-09-02 08:20 +0200
Message-ID<q49yN-5ba-1@gated-at.bofh.it>
In reply to#1216441
"Frank Ch. Eigler" <fche@redhat.com> writes:
> Hi, Rusty -
>
>
> I wrote:
>
>> [...]
>> > Notifiers suck for stuff like this :( Module state has many steps,
>> > so my preference has been to open-code explicit hooks.  [...]
>> 
>> You mean something like the trace_module_load()?  (We will probably
>> experiment with hooking into that tracepoint instead of the notifier.)
>> [...]
>
> It turns out this works OK, except for EXPORT_TRACEPOINT_SYMBOL_GPL.
> Could we get a set of EXPORT_TRACEPOINT_SYMBOL_GPL's for the
> trace/events/module.h tracepoints (at least module_load and
> module_free)?

Sure, patch welcome.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web