29 Oct, 2005

2 commits


28 Oct, 2005

1 commit


24 Oct, 2005

1 commit

  • Fix a bug which was reported and diagnosed by
    Stefan Jones

    IDR trees include a cache of idr_layer objects. There's no way to destroy
    this cache, so when we discard an overall idr tree we end up leaking some
    memory.

    Add and use idr_destroy() for this. v9fs and infiniband also need to use
    idr_destroy() to avoid leaks.

    Or, we make the cache global, like radix_tree_preload(). Which is probably
    better. Later.

    Cc: Eric Van Hensbergen
    Cc: Roland Dreier
    Cc: Robert Love
    Cc: John McCutchan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

18 Oct, 2005

1 commit


09 Oct, 2005

1 commit

  • - added typedef unsigned int __nocast gfp_t;

    - replaced __nocast uses for gfp flags with gfp_t - it gives exactly
    the same warnings as far as sparse is concerned, doesn't change
    generated code (from gcc point of view we replaced unsigned int with
    typedef) and documents what's going on far better.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

05 Oct, 2005

1 commit


15 Sep, 2005

1 commit

  • Several implementations were essentialy a common piece of C code using
    the cmpxchg() macro. Put the implementation in one spot that everyone
    can share, and convert sparc64 over to using this.

    Alpha is the lone arch-specific implementation, which codes up a
    special fast path for the common case in order to avoid GP reloading
    which a pure C version would require.

    Signed-off-by: David S. Miller

    David S. Miller
     

13 Sep, 2005

1 commit


11 Sep, 2005

3 commits

  • This patch contains the following small cleanups:
    - make two needlessly global functions static
    - every file should #include the header files containing the prototypes
    of it's global functions

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Fix the sparse warning "implicit cast to nocast type"

    Signed-off-by: Victor Fusco
    Signed-off-by: Domen Puncer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Victor Fusco
     
  • This patch (written by me and also containing many suggestions of Arjan van
    de Ven) does a major cleanup of the spinlock code. It does the following
    things:

    - consolidates and enhances the spinlock/rwlock debugging code

    - simplifies the asm/spinlock.h files

    - encapsulates the raw spinlock type and moves generic spinlock
    features (such as ->break_lock) into the generic code.

    - cleans up the spinlock code hierarchy to get rid of the spaghetti.

    Most notably there's now only a single variant of the debugging code,
    located in lib/spinlock_debug.c. (previously we had one SMP debugging
    variant per architecture, plus a separate generic one for UP builds)

    Also, i've enhanced the rwlock debugging facility, it will now track
    write-owners. There is new spinlock-owner/CPU-tracking on SMP builds too.
    All locks have lockup detection now, which will work for both soft and hard
    spin/rwlock lockups.

    The arch-level include files now only contain the minimally necessary
    subset of the spinlock code - all the rest that can be generalized now
    lives in the generic headers:

    include/asm-i386/spinlock_types.h | 16
    include/asm-x86_64/spinlock_types.h | 16

    I have also split up the various spinlock variants into separate files,
    making it easier to see which does what. The new layout is:

    SMP | UP
    ----------------------------|-----------------------------------
    asm/spinlock_types_smp.h | linux/spinlock_types_up.h
    linux/spinlock_types.h | linux/spinlock_types.h
    asm/spinlock_smp.h | linux/spinlock_up.h
    linux/spinlock_api_smp.h | linux/spinlock_api_up.h
    linux/spinlock.h | linux/spinlock.h

    /*
    * here's the role of the various spinlock/rwlock related include files:
    *
    * on SMP builds:
    *
    * asm/spinlock_types.h: contains the raw_spinlock_t/raw_rwlock_t and the
    * initializers
    *
    * linux/spinlock_types.h:
    * defines the generic type and initializers
    *
    * asm/spinlock.h: contains the __raw_spin_*()/etc. lowlevel
    * implementations, mostly inline assembly code
    *
    * (also included on UP-debug builds:)
    *
    * linux/spinlock_api_smp.h:
    * contains the prototypes for the _spin_*() APIs.
    *
    * linux/spinlock.h: builds the final spin_*() APIs.
    *
    * on UP builds:
    *
    * linux/spinlock_type_up.h:
    * contains the generic, simplified UP spinlock type.
    * (which is an empty structure on non-debug builds)
    *
    * linux/spinlock_types.h:
    * defines the generic type and initializers
    *
    * linux/spinlock_up.h:
    * contains the __raw_spin_*()/etc. version of UP
    * builds. (which are NOPs on non-debug, non-preempt
    * builds)
    *
    * (included on UP-non-debug builds:)
    *
    * linux/spinlock_api_up.h:
    * builds the _spin_*() APIs.
    *
    * linux/spinlock.h: builds the final spin_*() APIs.
    */

    All SMP and UP architectures are converted by this patch.

    arm, i386, ia64, ppc, ppc64, s390/s390x, x64 was build-tested via
    crosscompilers. m32r, mips, sh, sparc, have not been tested yet, but should
    be mostly fine.

    From: Grant Grundler

    Booted and lightly tested on a500-44 (64-bit, SMP kernel, dual CPU).
    Builds 32-bit SMP kernel (not booted or tested). I did not try to build
    non-SMP kernels. That should be trivial to fix up later if necessary.

    I converted bit ops atomic_hash lock to raw_spinlock_t. Doing so avoids
    some ugly nesting of linux/*.h and asm/*.h files. Those particular locks
    are well tested and contained entirely inside arch specific code. I do NOT
    expect any new issues to arise with them.

    If someone does ever need to use debug/metrics with them, then they will
    need to unravel this hairball between spinlocks, atomic ops, and bit ops
    that exist only because parisc has exactly one atomic instruction: LDCW
    (load and clear word).

    From: "Luck, Tony"

    ia64 fix

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Grant Grundler
    Cc: Matthew Wilcox
    Signed-off-by: Hirokazu Takata
    Signed-off-by: Mikael Pettersson
    Signed-off-by: Benoit Boissinot
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

09 Sep, 2005

1 commit


08 Sep, 2005

4 commits

  • The problem is that klists claim to provide semantics for safe traversal of
    lists which are being modified. The failure case is when traversal of a
    list causes element removal (a fairly common case). The issue is that
    although the list node is refcounted, if it is embedded in an object (which
    is universally the case), then the object will be freed regardless of the
    klist refcount leading to slab corruption because the klist iterator refers
    to the prior element to get the next.

    The solution is to make the klist take and release references to the
    embedding object meaning that the embedding object won't be released until
    the list relinquishes the reference to it.

    (akpm: fast-track this because it's needed for the 2.6.13 scsi merge)

    Signed-off-by: James Bottomley
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Bottomley
     
  • Simple patch to radix_tree_tag_get() to return different values for non
    present node and tag unset.

    The function is not used by any in-kernel callers (yet), but this
    information is definitely useful.

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

    Marcelo Tosatti
     
  • - There is frequent use of indirections in the radix code. This patch
    removes those indirections, makes the code more readable and allows
    the compilers to generate better code.

    - Removing indirections allows the removal of several casts.

    - Removing indirections allows the reduction of the radix_tree_path
    size from 3 to 2 words.

    - Use pathp-> consistently.

    - Remove unnecessary tmp variable in radix_tree_insert

    - Separate the upper layer processing from the lowest layer in __lookup()
    in order to make it easier to understand what is going on and allow
    compilers to generate better code for the loop.

    Signed-off-by: Christoph Lameter
    Cc: Nick Piggin
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     
  • This patch adds a new kernel debug feature: CONFIG_DETECT_SOFTLOCKUP.

    When enabled then per-CPU watchdog threads are started, which try to run
    once per second. If they get delayed for more than 10 seconds then a
    callback from the timer interrupt detects this condition and prints out a
    warning message and a stack dump (once per lockup incident). The feature
    is otherwise non-intrusive, it doesnt try to unlock the box in any way, it
    only gets the debug info out, automatically, and on all CPUs affected by
    the lockup.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Nishanth Aravamudan
    Signed-Off-By: Matthias Urlichs
    Signed-off-by: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

06 Sep, 2005

1 commit


05 Sep, 2005

1 commit

  • This patch moves the common code in x86 and x86-64's semaphore.c into a
    single file in lib/semaphore-sleepers.c. The arch specific asm stubs are
    left in the arch tree (in semaphore.c for i386 and in the asm for x86-64).
    There should be no changes in code/functionality with this patch.

    Signed-off-by: Benjamin LaHaise
    Cc: Andi Kleen
    Signed-off-by: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin LaHaise
     

30 Aug, 2005

6 commits


27 Aug, 2005

1 commit

  • There is an off by one problem with idr_get_new_above.

    The comment and function name suggest that it will return an id >
    starting_id, but it actually returned an id >= starting_id, and kernel
    callers other than inotify treated it as such.

    The patch below fixes the comment, and fixes inotifys usage. The
    function name still doesn't match the behaviour, but it never did.

    Signed-off-by: John McCutchan
    Signed-off-by: Linus Torvalds

    John McCutchan
     

24 Aug, 2005

1 commit


18 Aug, 2005

1 commit

  • It turns out that empty distance code tables are not an error, and that
    a compressed block with only literals can validly have an empty table
    and should not be flagged as a data error.

    Some old versions of gzip had problems with this case, but it does not
    affect the zlib code in the kernel.

    Analysis and explanations thanks to Sergey Vlasov

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

08 Aug, 2005

1 commit


06 Aug, 2005

1 commit

  • These bugs have been fixed in the standard zlib for a while.

    See for example

    a) http://sources.redhat.com/ml/bug-gnu-utils/1999-06/msg00183.html
    b) http://bugs.gentoo.org/show_bug.cgi?id=94584

    Signed-off-by: Tim Yamin
    Signed-off-by: Tavis Ormandy
    Signed-off-by: Linus Torvalds

    Tim Yamin
     

30 Jul, 2005

1 commit

  • CONFIG_DEBUG_FS=y and CONFIG_SYSFS=n results in the following compile
    error:

    ...
    LD vmlinux
    fs/built-in.o: In function `debugfs_init':
    inode.c:(.init.text+0x31be): undefined reference to `kernel_subsys'
    make: *** [vmlinux] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

28 Jul, 2005

1 commit


08 Jul, 2005

1 commit

  • Add a new section called ".data.read_mostly" for data items that are read
    frequently and rarely written to like cpumaps etc.

    If these maps are placed in the .data section then these frequenly read
    items may end up in cachelines with data is is frequently updated. In that
    case all processors in an SMP system must needlessly reload the cachelines
    again and again containing elements of those frequently used variables.

    The ability to share these cachelines will allow each cpu in an SMP system
    to keep local copies of those shared cachelines thereby optimizing
    performance.

    Signed-off-by: Alok N Kataria
    Signed-off-by: Shobhit Dayal
    Signed-off-by: Christoph Lameter
    Signed-off-by: Shai Fultheim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

26 Jun, 2005

2 commits


25 Jun, 2005

1 commit


24 Jun, 2005

4 commits

  • It exports symbols.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • A finite state machine consists of n states (struct ts_fsm_token)
    representing the pattern as a finite automation. The data is read
    sequentially on a octet basis. Every state token specifies the number
    of recurrences and the type of value accepted which can be either a
    specific character or ctype based set of characters. The available
    type of recurrences include 1, (0|1), [0 n], and [1 n].

    The algorithm differs between strict/non-strict mode specyfing
    whether the pattern has to start at the first octect. Strict mode
    is enabled by default and can be disabled by inserting
    TS_FSM_HEAD_IGNORE as the first token in the chain.

    The runtime performance of the algorithm should be around O(n),
    however while in strict mode the average runtime can be better.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Implements a linear-time string-matching algorithm due to Knuth,
    Morris, and Pratt [1]. Their algorithm avoids the explicit
    computation of the transition function DELTA altogether. Its
    matching time is O(n), for n being length(text), using just an
    auxiliary function PI[1..m], for m being length(pattern),
    precomputed from the pattern in time O(m). The array PI allows
    the transition function DELTA to be computed efficiently
    "on the fly" as needed. Roughly speaking, for any state
    "q" = 0,1,...,m and any character "a" in SIGMA, the value
    PI["q"] contains the information that is independent of "a" and
    is needed to compute DELTA("q", "a") [2]. Since the array PI
    has only m entries, whereas DELTA has O(m|SIGMA|) entries, we
    save a factor of |SIGMA| in the preprocessing time by computing
    PI rather than DELTA.

    [1] Cormen, Leiserson, Rivest, Stein
    Introdcution to Algorithms, 2nd Edition, MIT Press
    [2] See finite automation theory

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • The textsearch infrastructure provides text searching
    facitilies for both linear and non-linear data.
    Individual search algorithms are implemented in modules
    and chosen by the user.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf