1. 16 10月, 2008 4 次提交
    • T
      genirq: revert dynarray · d6c88a50
      Thomas Gleixner 提交于
      Revert the dynarray changes. They need more thought and polishing.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      d6c88a50
    • Y
      x86: alloc dyn_array all together · 1f8ff037
      Yinghai Lu 提交于
      so could spare some memory with small alignment in bootmem
      
      also tighten the alignment checking, and make print out less debug info.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1f8ff037
    • Y
      add per_cpu_dyn_array support · 1f3fcd4b
      Yinghai Lu 提交于
      allow dyn-array in per_cpu area, allocated dynamically.
      
      usage:
      
      |  /* in .h */
      | struct kernel_stat {
      |        struct cpu_usage_stat   cpustat;
      |        unsigned int *irqs;
      | };
      |
      |  /* in .c */
      | DEFINE_PER_CPU(struct kernel_stat, kstat);
      |
      | DEFINE_PER_CPU_DYN_ARRAY_ADDR(per_cpu__kstat_irqs, per_cpu__kstat.irqs, sizeof(unsigned int), nr_irqs, sizeof(unsigned long), NULL);
      
      after setup_percpu()/per_cpu_alloc_dyn_array(), the dyn_array in
      per_cpu area is ready to use.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1f3fcd4b
    • Y
      generic: add dyn_array support · 3ddfda11
      Yinghai Lu 提交于
      Allow crazy big arrays via bootmem at init stage.
      Architectures use CONFIG_HAVE_DYN_ARRAY to enable it.
      
      usage:
      
      | static struct irq_desc irq_desc_init __initdata = {
      |        .status = IRQ_DISABLED,
      |        .chip = &no_irq_chip,
      |        .handle_irq = handle_bad_irq,
      |        .depth = 1,
      |        .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
      | #ifdef CONFIG_SMP
      |        .affinity = CPU_MASK_ALL
      | #endif
      | };
      |
      | static void __init init_work(void *data)
      | {
      |        struct dyn_array *da = data;
      |        struct  irq_desc *desc;
      |        int i;
      |
      |        desc = *da->name;
      |
      |        for (i = 0; i < *da->nr; i++)
      |                memcpy(&desc[i], &irq_desc_init, sizeof(struct irq_desc));
      | }
      |
      | struct irq_desc *irq_desc;
      | DEFINE_DYN_ARRAY(irq_desc, sizeof(struct irq_desc), nr_irqs, PAGE_SIZE, init_work);
      
      after pre_alloc_dyn_array() after setup_arch(), the array is ready to be
      used.
      
      Via this facility we can replace irq_desc[NR_IRQS] array with dyn_array
      irq_desc[nr_irqs].
      
      v2: remove _nopanic in pre_alloc_dyn_array()
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3ddfda11
  2. 12 8月, 2008 1 次提交
    • A
      modules: extend initcall_debug functionality to the module loader · 59f9415f
      Arjan van de Ven 提交于
      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: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      59f9415f
  3. 27 7月, 2008 1 次提交
  4. 26 7月, 2008 1 次提交
  5. 29 4月, 2008 1 次提交
  6. 20 2月, 2008 1 次提交
    • S
      Add missing init section definitions · 37c514e3
      Sam Ravnborg 提交于
      When adding __devinitconst etc. the __initconst variant
      were missed.
      Add this one and proper definitions for .head.text for use
      in .S files.
      The naming .head.text is preferred over .text.head as the
      latter will conflict for a function named head when introducing
      -ffunctions-sections.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      37c514e3
  7. 07 2月, 2008 1 次提交
  8. 03 2月, 2008 1 次提交
    • R
      Remove __INIT_REFOK and __INITDATA_REFOK · 470a81ae
      Ralf Baechle 提交于
      Commit 312b1485 made __INIT_REFOK expand
      into .section .section ".ref.text", "ax".  Since the assembler doesn't
      tolerate stuttering in the source that broke all MIPS builds.
      
      Since with this change Sam downgraded __INIT_REFOK to just a backward
      compat thing and there being only a single use in the MIPS arch code the
      best solution is to delete both of __INIT_REFOK and __INITDATA_REFOK (which
      was equally broken) being unused anyway these can be deleted.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      470a81ae
  9. 29 1月, 2008 4 次提交
    • S
      Introduce new section reference annotations tags: __ref, __refdata, __refconst · 312b1485
      Sam Ravnborg 提交于
      Today we have the following annotations for functions/data
      referencing __init/__exit functions / data:
      
      __init_refok     => for init functions
      __initdata_refok => for init data
      __exit_refok     => for exit functions
      
      There is really no difference between the __init and __exit
      versions and simplify it and to introduce a shorter annotation
      the following new annotations are introduced:
      
      __ref      => for functions (code) that
                    references __*init / __*exit
      __refdata  => for variables
      __refconst => for const variables
      
      Whit this annotation is it more obvious what the annotation
      is for and there is no longer the arbitary division
      between __init and __exit code.
      
      The mechanishm is the same as before - a special section
      is created which is made part of the usual sections
      in the linker script.
      
      We will start to see annotations like this:
      
      -static struct pci_serial_quirk pci_serial_quirks[] = {
      +static const struct pci_serial_quirk pci_serial_quirks[] __refconst = {
      -----------------
      -static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
      +static struct notifier_block cpuid_class_cpu_notifier __refdata =
      ----------------
      -static int threshold_cpu_callback(struct notifier_block *nfb,
      +static int __ref threshold_cpu_callback(struct notifier_block *nfb,
      
      [The above is just random samples].
      
      Note: No modifications were needed in modpost
      to support the new sections due to the newly introduced
      blacklisting.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      312b1485
    • A
      remove __attribute_used__ · 3ff6eecc
      Adrian Bunk 提交于
      Remove the deprecated __attribute_used__.
      
      [Introduce __section in a few places to silence checkpatch /sam]
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      3ff6eecc
    • S
      Use separate sections for __dev/__cpu/__mem code/data · eb8f6890
      Sam Ravnborg 提交于
      Introducing separate sections for __dev* (HOTPLUG),
      __cpu* (HOTPLUG_CPU) and __mem* (MEMORY_HOTPLUG)
      allows us to do a much more reliable Section mismatch
      check in modpost. We are no longer dependent on the actual
      configuration of for example HOTPLUG.
      
      This has the effect that all users see much more
      Section mismatch warnings than before because they
      were almost all hidden when HOTPLUG was enabled.
      The advantage of this is that when building a piece
      of code then it is much more likely that the Section
      mismatch errors are spotted and the warnings will be
      felt less random of nature.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Greg KH <greg@kroah.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Adrian Bunk <bunk@kernel.org>
      eb8f6890
    • S
      compiler.h: introduce __section() · f3fe866d
      Sam Ravnborg 提交于
      Add a new helper: __section() that makes a section definition
      much shorter and more readable.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      f3fe866d
  10. 17 10月, 2007 2 次提交
  11. 11 10月, 2007 1 次提交
    • P
      [NETNS]: Move some code into __init section when CONFIG_NET_NS=n · 4665079c
      Pavel Emelyanov 提交于
      With the net namespaces many code leaved the __init section,
      thus making the kernel occupy more memory than it did before.
      Since we have a config option that prohibits the namespace
      creation, the functions that initialize/finalize some netns
      stuff are simply not needed and can be freed after the boot.
      
      Currently, this is almost not noticeable, since few calls
      are no longer in __init, but when the namespaces will be
      merged it will be possible to free more code. I propose to
      use the __net_init, __net_exit and __net_initdata "attributes"
      for functions/variables that are not used if the CONFIG_NET_NS
      is not set to save more space in memory.
      
      The exiting functions cannot just reside in the __exit section,
      as noticed by David, since the init section will have
      references on it and the compilation will fail due to modpost
      checks. These references can exist, since the init namespace
      never dies and the exit callbacks are never called. So I
      introduce the __exit_refok attribute just like it is already
      done with the __init_refok.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4665079c
  12. 12 8月, 2007 1 次提交
  13. 01 8月, 2007 1 次提交
  14. 22 7月, 2007 1 次提交
    • A
      x86: Support __attribute__((__cold__)) in gcc 4.3 · a586df06
      Andi Kleen 提交于
      gcc 4.3 supports a new __attribute__((__cold__)) to mark functions cold. Any
      path directly leading to a call of this function will be unlikely. And gcc
      will try to generate smaller code for the function itself.
      
      Please use with care. The code generation advantage isn't large and in most
      cases it is not worth uglifying code with this.
      
      This patch marks some common error functions like panic(), printk()
      as cold.  This will longer term make many unlikely()s unnecessary, although
      we can keep them for now for older compilers.
      
      BUG is not marked cold because there is currently no way to tell
      gcc to mark a inline function told.
      
      Also all __init and __exit functions are marked cold. With a non -Os
      build this will tell the compiler to generate slightly smaller code
      for them. I think it currently only uses less alignments for labels,
      but that might change in the future.
      
      One disadvantage over *likely() is that they cannot be easily instrumented
      to verify them.
      
      Another drawback is that only the latest gcc 4.3 snapshots support this.
      Unfortunately we cannot detect this using the preprocessor. This means older
      snapshots will fail now. I don't think that's a problem because they are
      unreleased compilers that nobody should be using.
      
      gcc also has a __hot__ attribute, but I don't see any sense in using
      this in the kernel right now. But someday I hope gcc will be able
      to use more aggressive optimizing for hot functions even in -Os,
      if that happens it should be added.
      
      Includes compile fix from Thomas Gleixner.
      
      Cc: Jan Hubicka <jh@suse.cz>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a586df06
  15. 17 7月, 2007 1 次提交
  16. 19 5月, 2007 1 次提交
    • S
      kbuild: introduce __init_refok/__initdata_refok to supress section mismatch warnings · 0e0d314e
      Sam Ravnborg 提交于
      Throughout the kernel there are a few legitimite references
      to init or exit sections. Most of these are covered by the
      patterns included in modpost but a few nees special attention.
      To avoid hardcoding a lot of function names in modpost introduce
      a marker so relevant function/data can be marked.
      When modpost see a reference to a init/exit function from
      a function/data marked no warning will be issued.
      
      Idea from: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      0e0d314e
  17. 15 5月, 2007 1 次提交
  18. 09 5月, 2007 1 次提交
  19. 08 5月, 2007 1 次提交
  20. 03 5月, 2007 1 次提交
    • P
      [PATCH] i386: Change sysenter_setup to __cpuinit & improve __INIT, __INITDATA · 86c0baf1
      Prarit Bhargava 提交于
      Change sysenter_setup to __cpuinit.
      Change __INIT & __INITDATA to be cpu hotplug aware.
      
      Resolve MODPOST warnings similar to:
      
      WARNING: vmlinux - Section mismatch: reference to .init.text:sysenter_setup from
       .text between 'identify_cpu' (at offset 0xc040a380) and 'detect_ht'
      
      and
      
      WARNING: vmlinux - Section mismatch: reference to .init.data:vsyscall_int80_end
      from .text between 'sysenter_setup' (at offset 0xc041a269) and 'enable_sep_cpu'
      WARNING: vmlinux - Section mismatch: reference to
      .init.data:vsyscall_int80_start from .text between 'sysenter_setup' (at offset
      0xc041a26e) and 'enable_sep_cpu'
      WARNING: vmlinux - Section mismatch: reference to
      .init.data:vsyscall_sysenter_end from .text between 'sysenter_setup' (at offset
      0xc041a275) and 'enable_sep_cpu'
      WARNING: vmlinux - Section mismatch: reference to
      .init.data:vsyscall_sysenter_start from .text between 'sysenter_setup' (at
      offset 0xc041a27a) and 'enable_sep_cpu'
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      86c0baf1
  21. 13 2月, 2007 1 次提交
    • A
      [PATCH] Dynamic kernel command-line: common · 30d7e0d4
      Alon Bar-Lev 提交于
      Current implementation stores a static command-line buffer allocated to
      COMMAND_LINE_SIZE size.  Most architectures stores two copies of this buffer,
      one for future reference and one for parameter parsing.
      
      Current kernel command-line size for most architecture is much too small for
      module parameters, video settings, initramfs paramters and much more.  The
      problem is that setting COMMAND_LINE_SIZE to a grater value, allocates static
      buffers.
      
      In order to allow a greater command-line size, these buffers should be
      dynamically allocated or marked as init disposable buffers, so unused memory
      can be released.
      
      This patch renames the static saved_command_line variable into
      boot_command_line adding __initdata attribute, so that it can be disposed
      after initialization.  This rename is required so applications that use
      saved_command_line will not be affected by this change.
      
      It reintroduces saved_command_line as dynamically allocated buffer to match
      the data in boot_command_line.
      
      It also mark secondary command-line buffer as __initdata, and copies it to
      dynamically allocated static_command_line buffer components may hold reference
      to it after initialization.
      
      This patch is for linux-2.6.20-rc4-mm1 and is divided to target each
      architecture.  I could not check this in any architecture so please forgive me
      if I got it wrong.
      
      The per-architecture modification is very simple, use boot_command_line in
      place of saved_command_line.  The common code is the change into dynamic
      command-line.
      
      This patch:
      
      1. Rename saved_command_line into boot_command_line, mark as init
         disposable.
      
      2. Add dynamic allocated saved_command_line.
      
      3. Add dynamic allocated static_command_line.
      
      4. During startup copy: boot_command_line into saved_command_line.  arch
         command_line into static_command_line.
      
      5. Parse static_command_line and not arch command_line, so arch
         command_line may be freed.
      Signed-off-by: NAlon Bar-Lev <alon.barlev@gmail.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Ian Molton <spyro@f2s.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
      Cc: Richard Curnow <rc@rc0.org.uk>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      30d7e0d4
  22. 12 2月, 2007 1 次提交
  23. 12 12月, 2006 1 次提交
  24. 21 11月, 2006 1 次提交
    • L
      Add "pure_initcall" for static variable initialization · b3438f82
      Linus Torvalds 提交于
      This is a quick hack to overcome the fact that SRCU currently does not
      allow static initializers, and we need to sometimes initialize those
      things before any other initializers (even "core" ones) can do so.
      
      Currently we don't allow this at all for modules, and the only user that
      needs is right now is cpufreq. As reported by Thomas Gleixner:
      
         "Commit b4dfdbb3 ("[PATCH] cpufreq:
          make the transition_notifier chain use SRCU breaks cpu frequency
          notification users, which register the callback > on core_init
          level."
      
      Cc: Thomas Gleixner <tglx@timesys.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Andrew Morton <akpm@osdl.org>,
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b3438f82
  25. 28 10月, 2006 1 次提交
    • A
      [PATCH] drivers: wait for threaded probes between initcall levels · 735a7ffb
      Andrew Morton 提交于
      The multithreaded-probing code has a problem: after one initcall level (eg,
      core_initcall) has been processed, we will then start processing the next
      level (postcore_initcall) while the kernel threads which are handling
      core_initcall are still executing.  This breaks the guarantees which the
      layered initcalls previously gave us.
      
      IOW, we want to be multithreaded _within_ an initcall level, but not between
      different levels.
      
      Fix that up by causing the probing code to wait for all outstanding probes at
      one level to complete before we start processing the next level.
      
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      735a7ffb
  26. 27 9月, 2006 1 次提交
  27. 26 4月, 2006 1 次提交
  28. 10 4月, 2006 1 次提交
  29. 26 3月, 2006 1 次提交
  30. 17 1月, 2006 1 次提交
  31. 26 6月, 2005 1 次提交
  32. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4