1. 02 2月, 2006 1 次提交
    • B
      [PATCH] Introduce __iowrite32_copy · c27a0d75
      Bryan O'Sullivan 提交于
      This arch-independent routine copies data to a memory-mapped I/O region,
      using 32-bit accesses.  The naming is double-underscored to make it clear
      that it does not guarantee write ordering, nor does it perform a memory
      barrier afterwards; the kernel doc also explicitly states this.  This style
      of access is required by some devices.
      
      This change also introduces include/linux/io.h, at Andrew's suggestion.  It
      only has one occupant at the moment, but is a logical destination for
      oft-replicated contents of include/asm-*/{io,iomap}.h to migrate to.
      Signed-off-by: NBryan O'Sullivan <bos@pathscale.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c27a0d75
  2. 30 9月, 2005 1 次提交
  3. 11 9月, 2005 1 次提交
    • I
      [PATCH] spinlock consolidation · fb1c8f93
      Ingo Molnar 提交于
      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 <grundler@parisc-linux.org>
      
        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" <tony.luck@intel.com>
      
         ia64 fix
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NArjan van de Ven <arjanv@infradead.org>
      Signed-off-by: NGrant Grundler <grundler@parisc-linux.org>
      Cc: Matthew Wilcox <willy@debian.org>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NMikael Pettersson <mikpe@csd.uu.se>
      Signed-off-by: NBenoit Boissinot <benoit.boissinot@ens-lyon.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fb1c8f93
  4. 09 9月, 2005 1 次提交
  5. 05 9月, 2005 1 次提交
  6. 30 8月, 2005 1 次提交
  7. 28 7月, 2005 1 次提交
  8. 24 6月, 2005 4 次提交
    • D
      [LIB]: textsearch.o needs to be obj-y not lib-y. · 65df877a
      David S. Miller 提交于
      It exports symbols.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65df877a
    • T
      [LIB]: Naive finite state machine based textsearch · 6408f79c
      Thomas Graf 提交于
      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: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6408f79c
    • T
      [LIB]: Knuth-Morris-Pratt textsearch algorithm · df3fb93a
      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: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df3fb93a
    • T
      [LIB]: Textsearch infrastructure. · 2de4ff7b
      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: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2de4ff7b
  9. 22 6月, 2005 2 次提交
    • J
      [PATCH] ia64 uncached alloc · f14f75b8
      Jes Sorensen 提交于
      This patch contains the ia64 uncached page allocator and the generic
      allocator (genalloc).  The uncached allocator was formerly part of the SN2
      mspec driver but there are several other users of it so it has been split
      off from the driver.
      
      The generic allocator can be used by device driver to manage special memory
      etc.  The generic allocator is based on the allocator from the sym53c8xx_2
      driver.
      
      Various users on ia64 needs uncached memory.  The SGI SN architecture requires
      it for inter-partition communication between partitions within a large NUMA
      cluster.  The specific user for this is the XPC code.  Another application is
      large MPI style applications which use it for synchronization, on SN this can
      be done using special 'fetchop' operations but it also benefits non SN
      hardware which may use regular uncached memory for this purpose.  Performance
      of doing this through uncached vs cached memory is pretty substantial.  This
      is handled by the mspec driver which I will push out in a seperate patch.
      
      Rather than creating a specific allocator for just uncached memory I came up
      with genalloc which is a generic purpose allocator that can be used by device
      drivers and other subsystems as they please.  For instance to handle onboard
      device memory.  It was derived from the sym53c7xx_2 driver's allocator which
      is also an example of a potential user (I am refraining from modifying sym2
      right now as it seems to have been under fairly heavy development recently).
      
      On ia64 memory has various properties within a granule, ie.  it isn't safe to
      access memory as uncached within the same granule as currently has memory
      accessed in cached mode.  The regular system therefore doesn't utilize memory
      in the lower granules which is mixed in with device PAL code etc.  The
      uncached driver walks the EFI memmap and pulls out the spill uncached pages
      and sticks them into the uncached pool.  Only after these chunks have been
      utilized, will it start converting regular cached memory into uncached memory.
      Hence the reason for the EFI related code additions.
      Signed-off-by: NJes Sorensen <jes@wildopensource.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f14f75b8
    • I
      [PATCH] smp_processor_id() cleanup · 39c715b7
      Ingo Molnar 提交于
      This patch implements a number of smp_processor_id() cleanup ideas that
      Arjan van de Ven and I came up with.
      
      The previous __smp_processor_id/_smp_processor_id/smp_processor_id API
      spaghetti was hard to follow both on the implementational and on the
      usage side.
      
      Some of the complexity arose from picking wrong names, some of the
      complexity comes from the fact that not all architectures defined
      __smp_processor_id.
      
      In the new code, there are two externally visible symbols:
      
       - smp_processor_id(): debug variant.
      
       - raw_smp_processor_id(): nondebug variant. Replaces all existing
         uses of _smp_processor_id() and __smp_processor_id(). Defined
         by every SMP architecture in include/asm-*/smp.h.
      
      There is one new internal symbol, dependent on DEBUG_PREEMPT:
      
       - debug_smp_processor_id(): internal debug variant, mapped to
                                   smp_processor_id().
      
      Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new
      lib/smp_processor_id.c file.  All related comments got updated and/or
      clarified.
      
      I have build/boot tested the following 8 .config combinations on x86:
      
       {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT}
      
      I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT.  (Other
      architectures are untested, but should work just fine.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NArjan van de Ven <arjan@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      39c715b7
  10. 21 6月, 2005 1 次提交
    • M
      [PATCH] Add initial implementation of klist helpers. · 9a19fea4
      mochel@digitalimplant.org 提交于
      This klist interface provides a couple of structures that wrap around
      struct list_head to provide explicit list "head" (struct klist) and
      list "node" (struct klist_node) objects. For struct klist, a spinlock
      is included that protects access to the actual list itself. struct
      klist_node provides a pointer to the klist that owns it and a kref
      reference count that indicates the number of current users of that node
      in the list.
      
      The entire point is to provide an interface for iterating over a list
      that is safe and allows for modification of the list during the
      iteration (e.g. insertion and removal), including modification of the
      current node on the list.
      
      It works using a 3rd object type - struct klist_iter - that is declared
      and initialized before an iteration. klist_next() is used to acquire the
      next element in the list. It returns NULL if there are no more items.
      This klist interface provides a couple of structures that wrap around
      struct list_head to provide explicit list "head" (struct klist) and
      list "node" (struct klist_node) objects. For struct klist, a spinlock
      is included that protects access to the actual list itself. struct
      klist_node provides a pointer to the klist that owns it and a kref
      reference count that indicates the number of current users of that node
      in the list.
      
      The entire point is to provide an interface for iterating over a list
      that is safe and allows for modification of the list during the
      iteration (e.g. insertion and removal), including modification of the
      current node on the list.
      
      It works using a 3rd object type - struct klist_iter - that is declared
      and initialized before an iteration. klist_next() is used to acquire the
      next element in the list. It returns NULL if there are no more items.
      Internally, that routine takes the klist's lock, decrements the reference
      count of the previous klist_node and increments the count of the next
      klist_node. It then drops the lock and returns.
      
      There are primitives for adding and removing nodes to/from a klist.
      When deleting, klist_del() will simply decrement the reference count.
      Only when the count goes to 0 is the node removed from the list.
      klist_remove() will try to delete the node from the list and block
      until it is actually removed. This is useful for objects (like devices)
      that have been removed from the system and must be freed (but must wait
      until all accessors have finished).
      
      Internally, that routine takes the klist's lock, decrements the reference
      count of the previous klist_node and increments the count of the next
      klist_node. It then drops the lock and returns.
      
      There are primitives for adding and removing nodes to/from a klist.
      When deleting, klist_del() will simply decrement the reference count.
      Only when the count goes to 0 is the node removed from the list.
      klist_remove() will try to delete the node from the list and block
      until it is actually removed. This is useful for objects (like devices)
      that have been removed from the system and must be freed (but must wait
      until all accessors have finished).
      Signed-off-by: NPatrick Mochel <mochel@digitalimplant.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      diff -Nru a/include/linux/klist.h b/include/linux/klist.h
      9a19fea4
  11. 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