13 Jan, 2012

1 commit


17 May, 2011

1 commit

  • The init and exit sections should not be traced and adding a call to
    mcount to them is a waste of text and instruction cache. Have the
    macro section attributes include notrace to ignore these functions
    for tracing from the build.

    Link: http://lkml.kernel.org/r/20110421023738.953028219@goodmis.org
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

23 Oct, 2010

1 commit

  • The __ref* tags may have been confusing for new kernel
    developers (I was confused by them for sure) so adding a few
    more sentences to comment to clear things up for people who
    see those for the first time.

    Signed-off-by: Michal Nazarewicz
    Acked-by: Uwe Kleine-König
    Acked-by: Sam Ravnborg
    Signed-off-by: Greg Kroah-Hartman

    Michal Nazarewicz
     

03 Mar, 2010

1 commit


16 Dec, 2009

1 commit

  • In order to diagnose overall suspend/resume times, we need
    basic instrumentation to break down the total time into per
    device timing, similar to initcall_debug.

    This patch adds the basic timing instrumentation, needed
    for a scritps/bootgraph.pl equivalent or humans.
    The bootgraph.pl program is still a work in progress, but
    is far enough along to know that this patch is sufficient.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Rafael J. Wysocki

    Arjan van de Ven
     

02 Oct, 2009

1 commit


22 Aug, 2009

1 commit

  • Some of the NOPs tables aren't used on 64-bits, quite some code and
    data is needed post-init for module loading only, and a couple of
    functions aren't used outside that file (i.e. can be static, and don't
    need to be exported).

    The change to __INITDATA/__INITRODATA is needed to avoid an assembler
    warning.

    Signed-off-by: Jan Beulich
    LKML-Reference:
    Acked-by: Sam Ravnborg
    Signed-off-by: H. Peter Anvin

    Jan Beulich
     

19 Jun, 2009

1 commit

  • Call constructors (gcc-generated initcall-like functions) during kernel
    start and module load. Constructors are e.g. used for gcov data
    initialization.

    Disable constructor support for usermode Linux to prevent conflicts with
    host glibc.

    Signed-off-by: Peter Oberparleiter
    Acked-by: Rusty Russell
    Acked-by: WANG Cong
    Cc: Sam Ravnborg
    Cc: Jeff Dike
    Cc: Andi Kleen
    Cc: Huang Ying
    Cc: Li Wei
    Cc: Michael Ellerman
    Cc: Ingo Molnar
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     

17 Jun, 2009

1 commit

  • Now we have __initconst, we can finally move the external declarations for
    the various Linux logo structures to .

    James' ack dates back to the previous submission (way to long ago), when the
    logos were still __initdata, which caused failures on some platforms with some
    toolchain versions.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: James Simmons
    Cc: Krzysztof Helt
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Geert Uytterhoeven
     

15 Jun, 2009

1 commit

  • Updated after review by Tim Abbott.
    - Use HEAD_TEXT_SECTION
    - Drop use of section-names.h and delete file
    - Introduce EXIT_CALL

    Deleting section-names.h required a few simple
    updates of init.h

    Signed-off-by: Sam Ravnborg
    Cc: Tim Abbott

    Sam Ravnborg
     

10 Jun, 2009

1 commit

  • - add .init.rodata to INIT_DATA, and group all initconst flavors
    together
    - move strings generated from __setup_param() into .init.rodata
    - add .*init.rodata to modpost's sets of init sections
    - make modpost warn about references between meminit and cpuinit
    as well as memexit and cpuexit sections (as CPU and memory
    hotplug are independently selectable features)

    Signed-off-by: Jan Beulich
    Signed-off-by: Sam Ravnborg

    Jan Beulich
     

28 Apr, 2009

1 commit

  • The old refok sections

    .text.init.refok
    .data.init.refok
    .exit.text.refok

    have been deprecated since commit
    312b1485fb509c9bc32eda28ad29537896658cb8. After the other patches in
    this patch series nothing is put in these sections, so clean things up
    by eliminating all the remaining references to them.

    Signed-off-by: Tim Abbott
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Tim Abbott
     

27 Apr, 2009

1 commit

  • This patch is preparation for replacing all uses of ".head.text" or
    ".text.head" in the kernel with macros, so that the section name can
    later be changed without having to touch a lot of the kernel.

    Since some linker scripts do more complex things than referencing
    HEAD_TEXT, we add a HEAD_TEXT_SECTION macro that just contains the
    actual name.

    I've defined HEAD_TEXT_SECTION in a new header,
    include/linux/section-names.h, so that this section name only needs to
    appear in one place. I anticipate creating similar macro structures
    for a number of other section names.

    The long-term goal here is to be able to change the kernel's magic
    section names to those that are compatible with -ffunction-sections
    -fdata-sections. This requires renaming all magic sections with names
    of the form ".text.foo".

    Signed-off-by: Tim Abbott
    Signed-off-by: Linus Torvalds

    Tim Abbott
     

17 Apr, 2009

1 commit

  • V3 of the early platform driver implementation.

    Platform drivers are great for embedded platforms because we can separate
    driver configuration from the actual driver. So base addresses,
    interrupts and other configuration can be kept with the processor or board
    code, and the platform driver can be reused by many different platforms.

    For early devices we have nothing today. For instance, to configure early
    timers and early serial ports we cannot use platform devices. This
    because the setup order during boot. Timers are needed before the
    platform driver core code is available. The same goes for early printk
    support. Early in this case means before initcalls.

    These early drivers today have their configuration either hard coded or
    they receive it using some special configuration method. This is working
    quite well, but if we want to support both regular kernel modules and
    early devices then we need to have two ways of configuring the same
    driver. A single way would be better.

    The early platform driver patch is basically a set of functions that allow
    drivers to register themselves and architecture code to locate them and
    probe. Registration happens through early_param(). The time for the
    probe is decided by the architecture code.

    See Documentation/driver-model/platform.txt for more details.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Magnus Damm
    Cc: Paul Mundt
    Cc: Kay Sievers
    Cc: David Brownell
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Magnus Damm
     

30 Oct, 2008

1 commit


21 Oct, 2008

1 commit

  • …l/git/tip/linux-2.6-tip

    * 'tracing-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (131 commits)
    tracing/fastboot: improve help text
    tracing/stacktrace: improve help text
    tracing/fastboot: fix initcalls disposition in bootgraph.pl
    tracing/fastboot: fix bootgraph.pl initcall name regexp
    tracing/fastboot: fix issues and improve output of bootgraph.pl
    tracepoints: synchronize unregister static inline
    tracepoints: tracepoint_synchronize_unregister()
    ftrace: make ftrace_test_p6nop disassembler-friendly
    markers: fix synchronize marker unregister static inline
    tracing/fastboot: add better resolution to initcall debug/tracing
    trace: add build-time check to avoid overrunning hex buffer
    ftrace: fix hex output mode of ftrace
    tracing/fastboot: fix initcalls disposition in bootgraph.pl
    tracing/fastboot: fix printk format typo in boot tracer
    ftrace: return an error when setting a nonexistent tracer
    ftrace: make some tracers reentrant
    ring-buffer: make reentrant
    ring-buffer: move page indexes into page headers
    tracing/fastboot: only trace non-module initcalls
    ftrace: move pc counter in irqtrace
    ...

    Manually fix conflicts:
    - init/main.c: initcall tracing
    - kernel/module.c: verbose level vs tracepoints
    - scripts/bootgraph.pl: fallout from cherry-picking commits.

    Linus Torvalds
     

17 Oct, 2008

1 commit


14 Oct, 2008

1 commit

  • When a mcount pointer is recorded into a table, it is used to add or
    remove calls to mcount (replacing them with nops). If the code is removed
    via removing a module, the pointers still exist. At modifying the code
    a check is always made to make sure the code being replaced is the code
    expected. In-other-words, the code being replaced is compared to what
    it is expected to be before being replaced.

    There is a very small chance that the code being replaced just happens
    to look like code that calls mcount (very small since the call to mcount
    is relative). To remove this chance, this patch adds ftrace_release to
    allow module unloading to remove the pointers to mcount within the module.

    Another change for init calls is made to not trace calls marked with
    __init. The tracing can not be started until after init is done anyway.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     

12 Aug, 2008

1 commit

  • 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: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Rusty Russell

    Arjan van de Ven
     

27 Jul, 2008

1 commit

  • Added early initcall (pre-SMP) support, using an identical interface to
    that of regular initcalls. Functions called from do_pre_smp_initcalls()
    could be converted to use this cleaner interface.

    This is required by CPU hotplug, because early users have to register
    notifiers before going SMP. One such CPU hotplug user is the relay
    interface with buffer-only channels, which needs to register such a
    notifier, to be usable in early code. This in turn is used by kmemtrace.

    Signed-off-by: Eduard - Gabriel Munteanu
    Cc: Tom Zanussi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eduard - Gabriel Munteanu
     

26 Jul, 2008

1 commit


29 Apr, 2008

1 commit


20 Feb, 2008

1 commit

  • 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: Sam Ravnborg

    Sam Ravnborg
     

07 Feb, 2008

1 commit


03 Feb, 2008

1 commit

  • Commit 312b1485fb509c9bc32eda28ad29537896658cb8 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: Ralf Baechle
    Signed-off-by: Sam Ravnborg

    Ralf Baechle
     

29 Jan, 2008

4 commits

  • 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: Sam Ravnborg

    Sam Ravnborg
     
  • Remove the deprecated __attribute_used__.

    [Introduce __section in a few places to silence checkpatch /sam]

    Signed-off-by: Adrian Bunk
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     
  • 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: Sam Ravnborg
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Adrian Bunk

    Sam Ravnborg
     
  • Add a new helper: __section() that makes a section definition
    much shorter and more readable.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     

17 Oct, 2007

2 commits

  • __setup_str_* are referenced only during boot, hence there's no need to
    waste image space for aligning these strings (with the aim of improving
    performance).

    Signed-off-by: Jan Beulich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Beulich
     
  • I need __INIT_REFOK to fix a MODPOST warning for a few MIPS configs which
    have to call init code from .text very early in the game due to bootloader
    issues. __INITDATA_REFOK is just for consistency.

    Signed-off-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     

11 Oct, 2007

1 commit

  • 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: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

12 Aug, 2007

1 commit


01 Aug, 2007

1 commit


22 Jul, 2007

1 commit

  • 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
    Signed-off-by: Andi Kleen
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

17 Jul, 2007

1 commit


19 May, 2007

1 commit

  • 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

    Signed-off-by: Sam Ravnborg
    Cc: Andrew Morton

    Sam Ravnborg
     

15 May, 2007

1 commit

  • After examining what was checked in and the code base I discovered that most
    of 86c0baf123e474b6eb404798926ecf62b426bf3a wasn't necessary anymore....

    So here's a patch that reverts the last part of that changeset:

    Revert part of 86c0baf123e474b6eb404798926ecf62b426bf3a.

    The kernel has moved forward to a state where the original change is not
    necessary. After porting forward, this final version of the patch was
    applied and broke non-x86 architectures.

    Signed-off-by: Prarit Bhargava
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prarit Bhargava
     

09 May, 2007

1 commit


08 May, 2007

1 commit

  • Remove software_suspend() and all its users since
    pm_suspend(PM_SUSPEND_DISK) should be equivalent and there's no point in
    having two interfaces for the same thing.

    The patch also changes the valid_state function to return 0 (false) for
    PM_SUSPEND_DISK when SOFTWARE_SUSPEND is not configured instead of
    accepting it and having the whole thing fail later.

    Signed-off-by: Johannes Berg
    Acked-by: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Berg