1. 22 10月, 2008 4 次提交
    • R
      param: Fix duplicate module prefixes · 9b473de8
      Rusty Russell 提交于
      Instead of insisting each new module_param sysfs entry is unique,
      handle the case where it already exists (for builtin modules).
      
      The current code assumes that all identical prefixes are together in
      the section: true for normal uses, but not necessarily so if someone
      overrides MODULE_PARAM_PREFIX.  More importantly, it's not true with
      the new "core_param()" code which uses "kernel" as a prefix.
      
      This simplifies the caller for the builtin case, at a slight loss of
      efficiency (we do the lookup every time to see if the directory
      exists).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      9b473de8
    • R
      module: check kernel param length at compile time, not runtime · 730b69d2
      Rusty Russell 提交于
      The kparam code tries to handle over-length parameter prefixes at
      runtime.  Not only would I bet this has never been tested, it's not
      clear that truncating names is a good idea either.
      
      So let's check at compile time.  We need to move the #define to
      moduleparam.h to do this, though.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      730b69d2
    • A
      Remove stop_machine during module load v2 · d72b3751
      Andi Kleen 提交于
      Remove stop_machine during module load v2
      
      module loading currently does a stop_machine on each module load to insert
      the module into the global module lists.  Especially on larger systems this
      can be quite expensive.
      
      It does that to handle concurrent lock lessmodule list readers
      like kallsyms.
      
      I don't think stop_machine() is actually needed to insert something
      into a list though. There are no concurrent writers because the
      module mutex is taken. And the RCU list functions know how to insert
      a node into a list with the right memory ordering so that concurrent
      readers don't go off into the wood.
      
      So remove the stop_machine for the module list insert and just
      do a list_add_rcu() instead.
      
      Module removal will still do a stop_machine of course, it needs
      that for other reasons.
      
      v2: Revised readers based on Paul's comments. All readers that only
          rely on disabled preemption need to be changed to list_for_each_rcu().
          Done that. The others are ok because they have the modules mutex.
          Also added a possible missing preempt disable for print_modules().
      
      [cc Paul McKenney for review. It's not RCU, but quite similar.]
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      d72b3751
    • R
      module: simplify load_module. · 5e458cc0
      Rusty Russell 提交于
      Linus' recent catch of stack overflow in load_module lead me to look
      at the code.  A couple of helpers to get a section address and get
      objects from a section can help clean things up a little.
      
      (And in case you're wondering, the stack size also dropped from 328 to
      284 bytes).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5e458cc0
  2. 21 10月, 2008 36 次提交