1. 09 Jan, 2006 40 commits
    • Paul Jackson's avatar
      [PATCH] cpuset: remove test for null cpuset from alloc code path · c417f024
      Paul Jackson authored
      Remove a couple of more lines of code from the cpuset hooks in the page
      allocation code path.
      
      There was a check for a NULL cpuset pointer in the routine
      cpuset_update_task_memory_state() that was only needed during system boot,
      after the memory subsystem was initialized, before the cpuset subsystem was
      initialized, to catch a NULL task->cpuset pointer.
      
      Add a cpuset_init_early() routine, just before the mem_init() call in
      init/main.c, that sets up just enough of the init tasks cpuset structure to
      render cpuset_update_task_memory_state() calls harmless.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c417f024
    • Paul Jackson's avatar
      [PATCH] cpuset: migrate all tasks in cpuset at once · 04c19fa6
      Paul Jackson authored
      Given the mechanism in the previous patch to handle rebinding the per-vma
      mempolicies of all tasks in a cpuset that changes its memory placement, it is
      now easier to handle the page migration requirements of such tasks at the same
      time.
      
      The previous code didn't actually attempt to migrate the pages of the tasks in
      a cpuset whose memory placement changed until the next time each such task
      tried to allocate memory.  This was undesirable, as users invoking memory page
      migration exected to happen when the placement changed, not some unspecified
      time later when the task needed more memory.
      
      It is now trivial to handle the page migration at the same time as the per-vma
      rebinding is done.
      
      The routine cpuset.c:update_nodemask(), which handles changing a cpusets
      memory placement ('mems') now checks for the special case of being asked to
      write a placement that is the same as before.  It was harmless enough before
      to just recompute everything again, even though nothing had changed.  But page
      migration is a heavy weight operation - moving pages about.  So now it is
      worth avoiding that if asked to move a cpuset to its current location.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      04c19fa6
    • Paul Jackson's avatar
      [PATCH] cpuset: rebind vma mempolicies fix · 4225399a
      Paul Jackson authored
      Fix more of longstanding bug in cpuset/mempolicy interaction.
      
      NUMA mempolicies (mm/mempolicy.c) are constrained by the current tasks cpuset
      to just the Memory Nodes allowed by that cpuset.  The kernel maintains
      internal state for each mempolicy, tracking what nodes are used for the
      MPOL_INTERLEAVE, MPOL_BIND or MPOL_PREFERRED policies.
      
      When a tasks cpuset memory placement changes, whether because the cpuset
      changed, or because the task was attached to a different cpuset, then the
      tasks mempolicies have to be rebound to the new cpuset placement, so as to
      preserve the cpuset-relative numbering of the nodes in that policy.
      
      An earlier fix handled such mempolicy rebinding for mempolicies attached to a
      task.
      
      This fix rebinds mempolicies attached to vma's (address ranges in a tasks
      address space.) Due to the need to hold the task->mm->mmap_sem semaphore while
      updating vma's, the rebinding of vma mempolicies has to be done when the
      cpuset memory placement is changed, at which time mmap_sem can be safely
      acquired.  The tasks mempolicy is rebound later, when the task next attempts
      to allocate memory and notices that its task->cpuset_mems_generation is
      out-of-date with its cpusets mems_generation.
      
      Because walking the tasklist to find all tasks attached to a changing cpuset
      requires holding tasklist_lock, a spinlock, one cannot update the vma's of the
      affected tasks while doing the tasklist scan.  In general, one cannot acquire
      a semaphore (which can sleep) while already holding a spinlock (such as
      tasklist_lock).  So a list of mm references has to be built up during the
      tasklist scan, then the tasklist lock dropped, then for each mm, its mmap_sem
      acquired, and the vma's in that mm rebound.
      
      Once the tasklist lock is dropped, affected tasks may fork new tasks, before
      their mm's are rebound.  A kernel global 'cpuset_being_rebound' is set to
      point to the cpuset being rebound (there can only be one; cpuset modifications
      are done under a global 'manage_sem' semaphore), and the mpol_copy code that
      is used to copy a tasks mempolicies during fork catches such forking tasks,
      and ensures their children are also rebound.
      
      When a task is moved to a different cpuset, it is easier, as there is only one
      task involved.  It's mm->vma's are scanned, using the same
      mpol_rebind_policy() as used above.
      
      It may happen that both the mpol_copy hook and the update done via the
      tasklist scan update the same mm twice.  This is ok, as the mempolicies of
      each vma in an mm keep track of what mems_allowed they are relative to, and
      safely no-op a second request to rebind to the same nodes.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      4225399a
    • Paul Jackson's avatar
      [PATCH] cpuset: number_of_cpusets optimization · 202f72d5
      Paul Jackson authored
      Easy little optimization hack to avoid actually having to call
      cpuset_zone_allowed() and check mems_allowed, in the main page allocation
      routine, __alloc_pages().  This saves several CPU cycles per page allocation
      on systems not using cpusets.
      
      A counter is updated each time a cpuset is created or removed, and whenever
      there is only one cpuset in the system, it must be the root cpuset, which
      contains all CPUs and all Memory Nodes.  In that case, when the counter is
      one, all allocations are allowed.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      202f72d5
    • Paul Jackson's avatar
      [PATCH] cpuset: numa_policy_rebind cleanup · 74cb2155
      Paul Jackson authored
      Cleanup, reorganize and make more robust the mempolicy.c code to rebind
      mempolicies relative to the containing cpuset after a tasks memory placement
      changes.
      
      The real motivator for this cleanup patch is to lay more groundwork for the
      upcoming patch to correctly rebind NUMA mempolicies that are attached to vma's
      after the containing cpuset memory placement changes.
      
      NUMA mempolicies are constrained by the cpuset their task is a member of.
      When either (1) a task is moved to a different cpuset, or (2) the 'mems'
      mems_allowed of a cpuset is changed, then the NUMA mempolicies have embedded
      node numbers (for MPOL_BIND, MPOL_INTERLEAVE and MPOL_PREFERRED) that need to
      be recalculated, relative to their new cpuset placement.
      
      The old code used an unreliable method of determining what was the old
      mems_allowed constraining the mempolicy.  It just looked at the tasks
      mems_allowed value.  This sort of worked with the present code, that just
      rebinds the -task- mempolicy, and leaves any -vma- mempolicies broken,
      referring to the old nodes.  But in an upcoming patch, the vma mempolicies
      will be rebound as well.  Then the order in which the various task and vma
      mempolicies are updated will no longer be deterministic, and one can no longer
      count on the task->mems_allowed holding the old value for as long as needed.
      It's not even clear if the current code was guaranteed to work reliably for
      task mempolicies.
      
      So I added a mems_allowed field to each mempolicy, stating exactly what
      mems_allowed the policy is relative to, and updated synchronously and reliably
      anytime that the mempolicy is rebound.
      
      Also removed a useless wrapper routine, numa_policy_rebind(), and had its
      caller, cpuset_update_task_memory_state(), call directly to the rewritten
      policy_rebind() routine, and made that rebind routine extern instead of
      static, and added a "mpol_" prefix to its name, making it
      mpol_rebind_policy().
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      74cb2155
    • Paul Jackson's avatar
      [PATCH] cpuset: implement cpuset_mems_allowed · 909d75a3
      Paul Jackson authored
      Provide a cpuset_mems_allowed() method, which the sys_migrate_pages() code
      needed, to obtain the mems_allowed vector of a cpuset, and replaced the
      workaround in sys_migrate_pages() to call this new method.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      909d75a3
    • Paul Jackson's avatar
      [PATCH] cpuset: combine refresh_mems and update_mems · cf2a473c
      Paul Jackson authored
      The important code paths through alloc_pages_current() and alloc_page_vma(),
      by which most kernel page allocations go, both called
      cpuset_update_current_mems_allowed(), which in turn called refresh_mems().
      -Both- of these latter two routines did a tasklock, got the tasks cpuset
      pointer, and checked for out of date cpuset->mems_generation.
      
      That was a silly duplication of code and waste of CPU cycles on an important
      code path.
      
      Consolidated those two routines into a single routine, called
      cpuset_update_task_memory_state(), since it updates more than just
      mems_allowed.
      
      Changed all callers of either routine to call the new consolidated routine.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      cf2a473c
    • Paul Jackson's avatar
      [PATCH] cpuset: fork hook fix · b4b26418
      Paul Jackson authored
      Fix obscure, never seen in real life, cpuset fork race.  The cpuset_fork()
      call in fork.c was setting up the correct task->cpuset pointer after the
      tasklist_lock was dropped, which briefly exposed the newly forked process with
      an unsafe (copied from parent without locks or usage counter increment) cpuset
      pointer.
      
      In theory, that exposed cpuset pointer could have been pointing at a cpuset
      that was already freed and removed, and in theory another task that had been
      sitting on the tasklist_lock waiting to scan the task list could have raced
      down the entire tasklist, found our new child at the far end, and dereferenced
      that bogus cpuset pointer.
      
      To fix, setup up the correct cpuset pointer in the new child by calling
      cpuset_fork() before the new task is linked into the tasklist, and with that,
      add a fork failure case, to dereference that cpuset, if the fork fails along
      the way, after cpuset_fork() was called.
      
      Had to remove a BUG_ON() from cpuset_exit(), because it was no longer valid -
      the call to cpuset_exit() from a failed fork would not have PF_EXITING set.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b4b26418
    • Paul Jackson's avatar
      [PATCH] cpuset: update_nodemask code reformat · 59dac16f
      Paul Jackson authored
      Restructure code layout of the kernel/cpuset.c update_nodemask() routine,
      removing embedded returns and nested if's in favor of goto completion labels.
      This is being done in anticipation of adding more logic to this routine, which
      will favor the goto style structure.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      59dac16f
    • Paul Jackson's avatar
      [PATCH] cpuset: minor spacing initializer fixes · c5b2aff8
      Paul Jackson authored
      Four trivial cpuset fixes: remove extra spaces, remove useless initializers,
      mark one __read_mostly.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c5b2aff8
    • Paul Jackson's avatar
      [PATCH] cpuset: remove marker_pid documentation · 90c9cc40
      Paul Jackson authored
      Remove documentation for the cpuset 'marker_pid' feature, that was in the
      patch "cpuset: change marker for relative numbering" That patch was previously
      pulled from *-mm at my (pj) request.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      90c9cc40
    • Paul Jackson's avatar
      [PATCH] cpuset: document additional features · bd5e09cf
      Paul Jackson authored
      Document the additional cpuset features:
      	notify_on_release
      	marker_pid
      	memory_pressure
      	memory_pressure_enabled
      
      Rearrange and improve formatting of existing documentation for
      cpu_exclusive and mem_exclusive features.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      bd5e09cf
    • Paul Jackson's avatar
      [PATCH] cpuset: memory pressure meter · 3e0d98b9
      Paul Jackson authored
      Provide a simple per-cpuset metric of memory pressure, tracking the -rate-
      that the tasks in a cpuset call try_to_free_pages(), the synchronous
      (direct) memory reclaim code.
      
      This enables batch managers monitoring jobs running in dedicated cpusets to
      efficiently detect what level of memory pressure that job is causing.
      
      This is useful both on tightly managed systems running a wide mix of
      submitted jobs, which may choose to terminate or reprioritize jobs that are
      trying to use more memory than allowed on the nodes assigned them, and with
      tightly coupled, long running, massively parallel scientific computing jobs
      that will dramatically fail to meet required performance goals if they
      start to use more memory than allowed to them.
      
      This patch just provides a very economical way for the batch manager to
      monitor a cpuset for signs of memory pressure.  It's up to the batch
      manager or other user code to decide what to do about it and take action.
      
      ==> Unless this feature is enabled by writing "1" to the special file
          /dev/cpuset/memory_pressure_enabled, the hook in the rebalance
          code of __alloc_pages() for this metric reduces to simply noticing
          that the cpuset_memory_pressure_enabled flag is zero.  So only
          systems that enable this feature will compute the metric.
      
      Why a per-cpuset, running average:
      
          Because this meter is per-cpuset, rather than per-task or mm, the
          system load imposed by a batch scheduler monitoring this metric is
          sharply reduced on large systems, because a scan of the tasklist can be
          avoided on each set of queries.
      
          Because this meter is a running average, instead of an accumulating
          counter, a batch scheduler can detect memory pressure with a single
          read, instead of having to read and accumulate results for a period of
          time.
      
          Because this meter is per-cpuset rather than per-task or mm, the
          batch scheduler can obtain the key information, memory pressure in a
          cpuset, with a single read, rather than having to query and accumulate
          results over all the (dynamically changing) set of tasks in the cpuset.
      
      A per-cpuset simple digital filter (requires a spinlock and 3 words of data
      per-cpuset) is kept, and updated by any task attached to that cpuset, if it
      enters the synchronous (direct) page reclaim code.
      
      A per-cpuset file provides an integer number representing the recent
      (half-life of 10 seconds) rate of direct page reclaims caused by the tasks
      in the cpuset, in units of reclaims attempted per second, times 1000.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3e0d98b9
    • Paul Jackson's avatar
      [PATCH] cpuset: mempolicy one more nodemask conversion · 5966514d
      Paul Jackson authored
      Finish converting mm/mempolicy.c from bitmaps to nodemasks.  The previous
      conversion had left one routine using bitmaps, since it involved a
      corresponding change to kernel/cpuset.c
      
      Fix that interface by replacing with a simple macro that calls nodes_subset(),
      or if !CONFIG_CPUSET, returns (1).
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Cc: Christoph Lameter <christoph@lameter.com>
      Cc: Andi Kleen <ak@muc.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5966514d
    • Paul Jackson's avatar
      [PATCH] cpuset: better bitmap remap defaults · 96b7f341
      Paul Jackson authored
      Fix the default behaviour for the remap operators in bitmap, cpumask and
      nodemask.
      
      As previously submitted, the pair of masks <A, B> defined a map of the
      positions of the set bits in A to the corresponding bits in B.  This is still
      true.
      
      The issue is how to map the other positions, corresponding to the unset (0)
      bits in A.  As previously submitted, they were all mapped to the first set bit
      position in B, a constant map.
      
      When I tried to code per-vma mempolicy rebinding using these remap operators,
      I realized this was wrong.
      
      This patch changes the default to map all the unset bit positions in A to the
      same positions in B, the identity map.
      
      For example, if A has bits 4-7 set, and B has bits 9-12 set, then the map
      defined by the pair <A, B> maps each bit position in the first 32 bits as
      follows:
      
      	0 ==> 0
      	  ...
      	3 ==> 3
      	4 ==> 9
      	  ...
      	7 ==> 12
      	8 ==> 8
      	9 ==> 9
      	  ...
      	31 ==> 31
      
      This now corresponds to the typical behaviour desired when migrating pages and
      policies from one cpuset to another.
      
      The pages on nodes within the original cpuset, and the references in memory
      policies to nodes within the original cpuset, are migrated to the
      corresponding cpuset-relative nodes in the destination cpuset.  Other pages
      and node references are left untouched.
      Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      96b7f341
    • Matt Mackall's avatar
      [PATCH] slob: introduce the SLOB allocator · 10cef602
      Matt Mackall authored
      configurable replacement for slab allocator
      
      This adds a CONFIG_SLAB option under CONFIG_EMBEDDED.  When CONFIG_SLAB is
      disabled, the kernel falls back to using the 'SLOB' allocator.
      
      SLOB is a traditional K&R/UNIX allocator with a SLAB emulation layer,
      similar to the original Linux kmalloc allocator that SLAB replaced.  It's
      signicantly smaller code and is more memory efficient.  But like all
      similar allocators, it scales poorly and suffers from fragmentation more
      than SLAB, so it's only appropriate for small systems.
      
      It's been tested extensively in the Linux-tiny tree.  I've also
      stress-tested it with make -j 8 compiles on a 3G SMP+PREEMPT box (not
      recommended).
      
      Here's a comparison for otherwise identical builds, showing SLOB saving
      nearly half a megabyte of RAM:
      
      $ size vmlinux*
         text    data     bss     dec     hex filename
      3336372  529360  190812 4056544  3de5e0 vmlinux-slab
      3323208  527948  190684 4041840  3dac70 vmlinux-slob
      
      $ size mm/{slab,slob}.o
         text    data     bss     dec     hex filename
        13221     752      48   14021    36c5 mm/slab.o
         1896      52       8    1956     7a4 mm/slob.o
      
      /proc/meminfo:
                        SLAB          SLOB      delta
      MemTotal:        27964 kB      27980 kB     +16 kB
      MemFree:         24596 kB      25092 kB    +496 kB
      Buffers:            36 kB         36 kB       0 kB
      Cached:           1188 kB       1188 kB       0 kB
      SwapCached:          0 kB          0 kB       0 kB
      Active:            608 kB        600 kB      -8 kB
      Inactive:          808 kB        812 kB      +4 kB
      HighTotal:           0 kB          0 kB       0 kB
      HighFree:            0 kB          0 kB       0 kB
      LowTotal:        27964 kB      27980 kB     +16 kB
      LowFree:         24596 kB      25092 kB    +496 kB
      SwapTotal:           0 kB          0 kB       0 kB
      SwapFree:            0 kB          0 kB       0 kB
      Dirty:               4 kB         12 kB      +8 kB
      Writeback:           0 kB          0 kB       0 kB
      Mapped:            560 kB        556 kB      -4 kB
      Slab:             1756 kB          0 kB   -1756 kB
      CommitLimit:     13980 kB      13988 kB      +8 kB
      Committed_AS:     4208 kB       4208 kB       0 kB
      PageTables:         28 kB         28 kB       0 kB
      VmallocTotal:  1007312 kB    1007312 kB       0 kB
      VmallocUsed:        48 kB         48 kB       0 kB
      VmallocChunk:  1007264 kB    1007264 kB       0 kB
      
      (this work has been sponsored in part by CELF)
      
      From: Ingo Molnar <mingo@elte.hu>
      
         Fix 32-bitness bugs in mm/slob.c.
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      10cef602
    • Matt Mackall's avatar
      [PATCH] slob: introduce mm/util.c for shared functions · 30992c97
      Matt Mackall authored
      Add mm/util.c for functions common between SLAB and SLOB.
      Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      30992c97
    • Ingo Molnar's avatar
      [PATCH] DEBUG_SLAB depends on SLAB · 50dd26ba
      Ingo Molnar authored
      Make DEBUG_SLAB depend on SLAB.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      50dd26ba
    • Nick Piggin's avatar
      [PATCH] radix-tree: reduce tree height upon partial truncation · a5f51c96
      Nick Piggin authored
      Shrink the height of a radix tree when it is partially truncated - we only do
      shrinkage of full truncation at present.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a5f51c96
    • Nick Piggin's avatar
      [PATCH] radix tree: early termination of tag clearing · d5274261
      Nick Piggin authored
      Correctly determine the tags to be cleared in radix_tree_delete() so we
      don't keep moving up the tree clearing tags that we don't need to.  For
      example, if a tag is simply not set in the deleted item, nor anywhere up
      the tree, radix_tree_delete() would attempt to clear it up the entire
      height of the tree.
      
      Also, tag_set() was made conditional so as not to dirty too many cachelines
      high up in the radix tree.  Instead, put this logic into
      radix_tree_tag_set().
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d5274261
    • Nick Piggin's avatar
      [PATCH] radix tree: code consolidation · 6e954b9e
      Nick Piggin authored
      Introduce helper any_tag_set() rather than repeat the same code sequence 4
      times.
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6e954b9e
    • Paul E. McKenney's avatar
      [PATCH] remove get_task_struct_rcu() · d4829cd5
      Paul E. McKenney authored
      The latest set of signal-RCU patches does not use get_task_struct_rcu().
      Attached is a patch that removes it.
      Signed-off-by: default avatar"Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d4829cd5
    • Paul E. McKenney's avatar
      [PATCH] Simpler signal-exit concurrency handling · 2d89c929
      Paul E. McKenney authored
      Some simplification in checking signal delivery against concurrent exit.
      Instead of using get_task_struct_rcu(), which increments the task_struct
      reference count, check the reference count after acquiring sighand lock.
      Signed-off-by: default avatar"Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      2d89c929
    • Ingo Molnar's avatar
      [PATCH] RCU signal handling · e56d0903
      Ingo Molnar authored
      RCU tasklist_lock and RCU signal handling: send signals RCU-read-locked
      instead of tasklist_lock read-locked.  This is a scalability improvement on
      SMP and a preemption-latency improvement under PREEMPT_RCU.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@us.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarWilliam Irwin <wli@holomorphy.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      e56d0903
    • Paul E. McKenney's avatar
      [PATCH] Make RCU task_struct safe for oprofile · 4369ef3c
      Paul E. McKenney authored
      Applying RCU to the task structure broke oprofile, because
      free_task_notify() can now be called from softirq.  This means that the
      task_mortuary lock must be acquired with irq disabled in order to avoid
      intermittent self-deadlock.  Since irq is now disabled, the critical
      section within process_task_mortuary() has been restructured to be O(1) in
      order to maximize scalability and minimize realtime latency degradation.
      
      Kudos to Wu Fengguang for finding this problem!
      
      CC: Wu Fengguang <wfg@mail.ustc.edu.cn>
      Cc: Philippe Elie <phil.el@wanadoo.fr>
      Cc: John Levon <levon@movementarian.org>
      Signed-off-by: default avatar"Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      4369ef3c
    • Adrian Bunk's avatar
      [PATCH] uml: prevent MODE_SKAS=n and MODE_TT=n · eafbaa94
      Adrian Bunk authored
      If MODE_TT=n, MODE_SKAS must be y.
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Acked-by: default avatarJeff Dike <jdike@addtoit.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      eafbaa94
    • Jeff Dike's avatar
      [PATCH] uml: whitespace cleanup · c0a689d0
      Jeff Dike authored
      This fixes some mangled whitespace added by the earlier trap_user.c patch.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c0a689d0
    • Jeff Dike's avatar
      [PATCH] consolidate asm/futex.h · f8aaeace
      Jeff Dike authored
      Most of the architectures have the same asm/futex.h.  This consolidates them
      into asm-generic, with the arches including it from their own asm/futex.h.
      
      In the case of UML, this reverts the old broken futex.h and goes back to using
      the same one as almost everyone else.
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f8aaeace
    • Gennady Sharapov's avatar
      [PATCH] uml: merge trap_user.c and trap_kern.c · c66fdd5e
      Gennady Sharapov authored
      The serial UML OS-abstraction layer patch (um/kernel dir).
      
      This joins trap_user.c and trap_kernel.c files.
      Signed-off-by: default avatarGennady Sharapov <Gennady.V.Sharapov@intel.com>
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c66fdd5e
    • Gennady Sharapov's avatar
      [PATCH] uml: move libc-dependent code from trap_user.c · ea2ba7dc
      Gennady Sharapov authored
      The serial UML OS-abstraction layer patch (um/kernel dir).
      
      This moves all systemcalls from trap_user.c file under os-Linux dir
      Signed-off-by: default avatarGennady Sharapov <Gennady.V.Sharapov@intel.com>
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      ea2ba7dc
    • Gennady Sharapov's avatar
      [PATCH] uml: move libc-dependent code from signal_user.c · 0805d89c
      Gennady Sharapov authored
      The serial UML OS-abstraction layer patch (um/kernel dir).
      
      This moves all systemcalls from signal_user.c file under os-Linux dir
      Signed-off-by: default avatarGennady Sharapov <Gennady.V.Sharapov@intel.com>
      Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      0805d89c
    • Woody Suwalski's avatar
      [PATCH] ARM: Netwinder ds1620 driver needs an export to be built as module · b2de464f
      Woody Suwalski authored
      ds1620 module is using gpio_read symbol, so works only if "built-in" symbol
      needs to be exported from the kernel image
      Signed-off-by: default avatarWoody Suwalski <woodys@xandros.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b2de464f
    • Ravikiran G Thirumalai's avatar
      [PATCH] Kill L1_CACHE_SHIFT_MAX · 1fd73c6b
      Ravikiran G Thirumalai authored
      Kill L1_CACHE_SHIFT from all arches.  Since L1_CACHE_SHIFT_MAX is not used
      anymore with the introduction of INTERNODE_CACHE, kill L1_CACHE_SHIFT_MAX.
      Signed-off-by: default avatarRavikiran Thirumalai <kiran@scalex86.org>
      Signed-off-by: default avatarShai Fultheim <shai@scalex86.org>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      1fd73c6b
    • Ravikiran G Thirumalai's avatar
      [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros · 22fc6ecc
      Ravikiran G Thirumalai authored
      ____cacheline_maxaligned_in_smp is currently used to align critical structures
      and avoid false sharing.  It uses per-arch L1_CACHE_SHIFT_MAX and people find
      L1_CACHE_SHIFT_MAX useless.
      
      However, we have been using ____cacheline_maxaligned_in_smp to align
      structures on the internode cacheline size.  As per Andi's suggestion,
      following patch kills ____cacheline_maxaligned_in_smp and introduces
      INTERNODE_CACHE_SHIFT, which defaults to L1_CACHE_SHIFT for all arches.
      Arches needing L3/Internode cacheline alignment can define
      INTERNODE_CACHE_SHIFT in the arch asm/cache.h.  Patch replaces
      ____cacheline_maxaligned_in_smp with ____cacheline_internodealigned_in_smp
      
      With this patch, L1_CACHE_SHIFT_MAX can be killed
      Signed-off-by: default avatarRavikiran Thirumalai <kiran@scalex86.org>
      Signed-off-by: default avatarShai Fultheim <shai@scalex86.org>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      22fc6ecc
    • David Howells's avatar
      [PATCH] frv: fix uninitialised variable in serverworks driver · 6d524aed
      David Howells authored
      Fix an uninitialised variable warning in the serverworks driver.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      6d524aed
    • David Howells's avatar
      [PATCH] frv: fix uninitialised variable in atm nicstar driver · 2087ff3e
      David Howells authored
      Fix an uninitialised variable warning in the atm nicstar driver.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      2087ff3e
    • David Howells's avatar
      [PATCH] frv: miscellaneous changes · 41be6aef
      David Howells authored
      Fix a number of miscellanous items:
      
       (1) Declare lock sections in the linker script.
      
       (2) Recurse in the correct manner in the arch makefile.
      
       (3) asm/bug.h requires asm/linkage.h to be included first. One C file puts
           asm/bug.h first.
      
       (4) Add an empty RTC header file to avoid missing header file errors.
      
       (5) sg_dma_address() should use the dma_address member of a scatter list.
      
       (6) Add trivial pci_unmap support.
      
       (7) Add pgprot_noncached()
      
       (8) Discard u_quad_t.
      
       (9) Use ~0UL rather than ULONG_MAX in unistd.h in case the latter isn't
           declared.
      
      (10) Add an empty VGA header file to avoid missing header file errors.
      
      (11) Add an XOR header file to use the generic XOR stuff.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      41be6aef
    • David Howells's avatar
      [PATCH] frv: make get_user macro cast pointers · 5c15d41b
      David Howells authored
      Make the get_user macro cast the source pointer to an appropriate type for the
      specified size.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5c15d41b
    • David Howells's avatar
      [PATCH] frv: force serial driver inclusion · f8aec757
      David Howells authored
      Force the 8230 serial driver to be built in if the on-CPU UARTs are to be
      used.  It can't be used as a module because the arch setup needs to call into
      it.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      f8aec757
    • David Howells's avatar
      [PATCH] frv: fix PCMCIA configuration · 7a758313
      David Howells authored
      Fix PCMCIA configuration for FRV by including the stock PCMCIA configuration
      description file.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      7a758313