1. 22 10月, 2008 10 次提交
    • H
      stop_machine: use workqueues instead of kernel threads · c9583e55
      Heiko Carstens 提交于
      Convert stop_machine to a workqueue based approach. Instead of using kernel
      threads for stop_machine we now use a an rt workqueue to synchronize all
      cpus.
      This has the advantage that all needed per cpu threads are already created
      when stop_machine gets called. And therefore a call to stop_machine won't
      fail anymore. This is needed for s390 which needs a mechanism to synchronize
      all cpus without allocating any memory.
      As Rusty pointed out free_module() needs a non-failing stop_machine interface
      as well.
      
      As a side effect the stop_machine code gets simplified.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c9583e55
    • H
      workqueue: introduce create_rt_workqueue · 0d557dc9
      Heiko Carstens 提交于
      create_rt_workqueue will create a real time prioritized workqueue.
      This is needed for the conversion of stop_machine to a workqueue based
      implementation.
      This patch adds yet another parameter to __create_workqueue_key to tell
      it that we want an rt workqueue.
      However it looks like we rather should have something like "int type"
      instead of singlethread, freezable and rt.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@elte.hu>
      0d557dc9
    • H
      Call init_workqueues before pre smp initcalls. · a802dd0e
      Heiko Carstens 提交于
      This allows to create workqueues from within the context of
      a pre smp initcall (aka early_initcall).
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a802dd0e
    • R
      Make panic= and panic_on_oops into core_params · f44dd164
      Rusty Russell 提交于
      This allows them to be examined and set after boot, plus means they
      actually give errors if they are misused (eg. panic=yes).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      f44dd164
    • R
      Make initcall_debug a core_param · d0ea3d7d
      Rusty Russell 提交于
      This is the one I really wanted: now it effects module loading, it
      makes sense to be able to flip it after boot.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NArjan van de Ven <arjan@linux.intel.com>
      d0ea3d7d
    • R
      core_param() for genuinely core kernel parameters · 67e67cea
      Rusty Russell 提交于
      There are a lot of one-liner uses of __setup() in the kernel: they're
      cumbersome and not queryable (definitely not settable) via /sys.  Yet
      it's ugly to simplify them to module_param(), because by default that
      inserts a prefix of the module name (usually filename).
      
      So, introduce a "core_param".  The parameter gets no prefix, but
      appears in /sys/module/kernel/parameters/ (if non-zero perms arg).  I
      thought about using the name "core", but that's more common than
      "kernel".  And if you create a module called "kernel", you will die
      a horrible death.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      67e67cea
    • 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 30 次提交