1. 25 Aug, 2008 1 commit
    • Linus Torvalds's avatar
      [module] Don't let gcc inline load_module() · ffb4ba76
      Linus Torvalds authored
      
      
      'load_module()' is a complex function that contains all the ELF section
      logic, and inlining it is utterly insane.  But gcc will do it, simply
      because there is only one call-site.  As a result, all the stack space
      that is allocated for all the work to load the module will still be
      active when we actually call the module init sequence, and the deep call
      chain makes stack overflows happen.
      
      And stack overflows are really hard to debug, because they not only
      corrupt random pages below the stack, but also corrupt the thread_info
      structure that is allocated under the stack.
      
      In this case, Alan Brunelle reported some crazy oopses at bootup, after
      loading the processor module that ends up doing complex ACPI stuff and
      has quite a deep callchain.  This should fix it, and is the sane thing
      to do regardless.
      
      Cc: Alan D. Brunelle <Alan.Brunelle@hp.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ffb4ba76
  2. 12 Aug, 2008 1 commit
    • Arjan van de Ven's avatar
      modules: extend initcall_debug functionality to the module loader · 59f9415f
      Arjan van de Ven authored
      
      
      The kernel has this really nice facility where if you put "initcall_debug"
      on the kernel commandline, it'll print which function it's going to
      execute just before calling an initcall, and then after the call completes
      it will
      
      1) print if it had an error code
      
      2) checks for a few simple bugs (like leaving irqs off)
      and
      
      3) print how long the init call took in milliseconds.
      
      While trying to optimize the boot speed of my laptop, I have been loving
      number 3 to figure out what to optimize...  ...  and then I wished that
      the same thing was done for module loading.
      
      This patch makes the module loader use this exact same functionality; it's
      a logical extension in my view (since modules are just sort of late
      binding initcalls anyway) and so far I've found it quite useful in finding
      where things are too slow in my boot.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      59f9415f
  3. 28 Jul, 2008 2 commits
  4. 22 Jul, 2008 5 commits
    • Rusty Russell's avatar
      modules: Take a shortcut for checking if an address is in a module · 3a642e99
      Rusty Russell authored
      
      
      This patch keeps track of the boundaries of module allocation, in
      order to speed up module_text_address().
      
      Inspired by Arjan's version, which required arch-specific defines:
      
      	Various pieces of the kernel (lockdep, latencytop, etc) tend
      	to store backtraces, sometimes at a relatively high
      	frequency. In itself this isn't a big performance deal (after
      	all you're using diagnostics features), but there have been
      	some complaints from people who have over 100 modules loaded
      	that this is a tad too slow.
      
      	This is due to the new backtracer code which looks at every
      	slot on the stack to see if it's a kernel/module text address,
      	so that's 1024 slots.  1024 times 100 modules... that's a lot
      	of list walking.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      3a642e99
    • Denys Vlasenko's avatar
      module: turn longs into ints for module sizes · 2f0f2a33
      Denys Vlasenko authored
      
      
      This shrinks module.o and each *.ko file.
      
      And finally, structure members which hold length of module
      code (four such members there) and count of symbols
      are converted from longs to ints.
      
      We cannot possibly have a module where 32 bits won't
      be enough to hold such counts.
      
      For one, module loading checks module size for sanity
      before loading, so such insanely big module will fail
      that test first.
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      2f0f2a33
    • Denys Vlasenko's avatar
      Shrink struct module: CONFIG_UNUSED_SYMBOLS ifdefs · f7f5b675
      Denys Vlasenko authored
      
      
      module.c and module.h conatains code for finding
      exported symbols which are declared with EXPORT_UNUSED_SYMBOL,
      and this code is compiled in even if CONFIG_UNUSED_SYMBOLS is not set
      and thus there can be no EXPORT_UNUSED_SYMBOLs in modules anyway
      (because EXPORT_UNUSED_SYMBOL(x) are compiled out to nothing then).
      
      This patch adds required #ifdefs.
      Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      f7f5b675
    • Rusty Russell's avatar
      module: generic each_symbol iterator function · dafd0940
      Rusty Russell authored
      
      
      Introduce an each_symbol() iterator to avoid duplicating the knowledge
      about the 5 different sections containing symbols.  Currently only
      used by find_symbol(), but will be used by symbol_put_addr() too.
      
      (Includes NULL ptr deref fix by Jiri Kosina <jkosina@suse.cz>)
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: Jiri Kosina <jkosina@suse.cz>
      dafd0940
    • Rusty Russell's avatar
      module: don't use stop_machine for waiting rmmod · da39ba5e
      Rusty Russell authored
      
      
      rmmod has a little-used "-w" option, meaning that instead of failing if the
      module is in use, it should block until the module becomes unused.
      
      In this case, we don't need to use stop_machine: Max Krasnyansky
      indicated that would be useful for SystemTap which loads/unloads new
      modules frequently.
      
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      da39ba5e
  5. 23 May, 2008 2 commits
  6. 09 May, 2008 2 commits
  7. 05 May, 2008 1 commit
    • Linus Torvalds's avatar
      Make forced module loading optional · 826e4506
      Linus Torvalds authored
      
      
      The kernel module loader used to be much too happy to allow loading of
      modules for the wrong kernel version by default.  For example, if you
      had MODVERSIONS enabled, but tried to load a module with no version
      info, it would happily load it and taint the kernel - whether it was
      likely to actually work or not!
      
      Generally, such forced module loading should be considered a really
      really bad idea, so make it conditional on a new config option
      (MODULE_FORCE_LOAD), and make it default to off.
      
      If somebody really wants to force module loads, that's their problem,
      but we should not encourage it.  Especially as it happened to me by
      mistake (ie regular unversioned Fedora modules getting loaded) causing
      lots of strange behavior.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      826e4506
  8. 01 May, 2008 6 commits
  9. 19 Apr, 2008 1 commit
  10. 11 Mar, 2008 2 commits
  11. 05 Mar, 2008 1 commit
  12. 21 Feb, 2008 1 commit
  13. 14 Feb, 2008 1 commit
    • Mathieu Desnoyers's avatar
      Linux Kernel Markers: support multiple probes · fb40bd78
      Mathieu Desnoyers authored
      
      
      RCU style multiple probes support for the Linux Kernel Markers.  Common case
      (one probe) is still fast and does not require dynamic allocation or a
      supplementary pointer dereference on the fast path.
      
      - Move preempt disable from the marker site to the callback.
      
      Since we now have an internal callback, move the preempt disable/enable to the
      callback instead of the marker site.
      
      Since the callback change is done asynchronously (passing from a handler that
      supports arguments to a handler that does not setup the arguments is no
      arguments are passed), we can safely update it even if it is outside the
      preempt disable section.
      
      - Move probe arm to probe connection. Now, a connected probe is automatically
        armed.
      
      Remove MARK_MAX_FORMAT_LEN, unused.
      
      This patch modifies the Linux Kernel Markers API : it removes the probe
      "arm/disarm" and changes the probe function prototype : it now expects a
      va_list * instead of a "...".
      
      If we want to have more than one probe connected to a marker at a given
      time (LTTng, or blktrace, ssytemtap) then we need this patch. Without it,
      connecting a second probe handler to a marker will fail.
      
      It allow us, for instance, to do interesting combinations :
      
      Do standard tracing with LTTng and, eventually, to compute statistics
      with SystemTAP, or to have a special trigger on an event that would call
      a systemtap script which would stop flight recorder tracing.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Mike Mason <mmlnx@us.ibm.com>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Cc: David Smith <dsmith@redhat.com>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fb40bd78
  14. 08 Feb, 2008 3 commits
  15. 30 Jan, 2008 1 commit
  16. 29 Jan, 2008 6 commits
  17. 27 Jan, 2008 1 commit
  18. 25 Jan, 2008 3 commits
    • Arjan van de Ven's avatar
      debug: track and print last unloaded module in the oops trace · e14af7ee
      Arjan van de Ven authored
      
      
      Based on a suggestion from Andi:
      
       In various cases, the unload of a module may leave some bad state around
       that causes a kernel crash AFTER a module is unloaded; and it's then hard
       to find which module caused that.
      
      This patch tracks the last unloaded module, and prints this as part of the
      module list in the oops trace.
      
      Right now, only the last 1 module is tracked; I expect that this is enough
      for the vast majority of cases where this information matters; if it turns
      out that tracking more is important, we can always extend it to that.
      
      [ mingo@elte.hu: build fix ]
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e14af7ee
    • Arjan van de Ven's avatar
      debug: show being-loaded/being-unloaded indicator for modules · 21aa9280
      Arjan van de Ven authored
      
      
      It's rather common that an oops/WARN_ON/BUG happens during the load or
      unload of a module. Unfortunatly, it's not always easy to see directly
      which module is being loaded/unloaded from the oops itself. Worse,
      it's not even always possible to ask the bug reporter, since there
      are so many components (udev etc) that auto-load modules that there's
      a good chance that even the reporter doesn't know which module this is.
      
      This patch extends the existing "show if it's tainting" print code,
      which is used as part of printing the modules in the oops/BUG/WARN_ON
      to include a "+" for "being loaded" and a "-" for "being unloaded".
      
      As a result this extension, the "taint_flags()" function gets renamed to
      "module_flags()" (and takes a module struct as argument, not a taint
      flags int).
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      21aa9280
    • Greg Kroah-Hartman's avatar
      Kobject: convert remaining kobject_unregister() to kobject_put() · 78a2d906
      Greg Kroah-Hartman authored
      
      
      There is no need for kobject_unregister() anymore, thanks to Kay's
      kobject cleanup changes, so replace all instances of it with
      kobject_put().
      
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      78a2d906