1. 14 Mar, 2011 2 commits
    • Thomas Gleixner's avatar
      arm: Remove bogus comment in futex_atomic_cmpxchg_inatomic() · 07d5ecae
      Thomas Gleixner authored
      commit 522d7dec(futex: Remove redundant pagefault_disable in
      futex_atomic_cmpxchg_inatomic()) added a bogus comment.
      
      /* Note that preemption is disabled by futex_atomic_cmpxchg_inatomic
       * call sites. */
      
      Bogus in two aspects:
      
      1) pagefault_disable != preempt_disable even if the mechanism we use
         is the same
      
      2) we have a call site which deliberately does not disable pagefaults
         as it wants the possible fault to be handled - though that has been
         changed for consistency reasons now.
      
      Sigh. I really should have seen that when committing the above. :(
      Catched-by-and-rightfully-ranted-at-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <alpine.LFD.2.00.1103141126590.2787@localhost6.localdomain6>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Darren Hart <darren@dvhart.com>
      07d5ecae
    • Thomas Gleixner's avatar
      futex: Deobfuscate handle_futex_death() · 6e0aa9f8
      Thomas Gleixner authored
      handle_futex_death() uses futex_atomic_cmpxchg_inatomic() without
      disabling page faults. That's ok, but totally non obvious.
      
      We don't hold locks so we actually can and want to fault here, because
      the get_user() before futex_atomic_cmpxchg_inatomic() does not
      guarantee a R/W mapping.
      
      We could just add a big fat comment to explain this, but actually
      changing the code so that the functionality is entirely clear is
      better.
      
      Use the helper function which disables page faults around the
      futex_atomic_cmpxchg_inatomic() and handle a fault with a call to
      fault_in_user_writeable() as all other places in the futex code do as
      well.
      Pointed-out-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarDarren Hart <darren@dvhart.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      LKML-Reference: <alpine.LFD.2.00.1103141126590.2787@localhost6.localdomain6>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      6e0aa9f8
  2. 12 Mar, 2011 1 commit
  3. 11 Mar, 2011 8 commits
    • Lai Jiangshan's avatar
      plist: Add priority list test · 6d55da53
      Lai Jiangshan authored
      Add test code for checking plist when the kernel is booting.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4D107986.1010302@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6d55da53
    • Lai Jiangshan's avatar
      plist: Shrink struct plist_head · bf6a9b83
      Lai Jiangshan authored
      struct plist_head is used in struct task_struct as well as struct
      rtmutex. If we can make it smaller, it will also make these structures
      smaller as well.
      
      The field prio_list in struct plist_head is seldom used and we can get
      its information from the plist_nodes. Removing this field will decrease
      the size of plist_head by half.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4D107982.9090700@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      bf6a9b83
    • Lai Jiangshan's avatar
      futex,plist: Remove debug lock assignment from plist_node · 017f2b23
      Lai Jiangshan authored
      The original code uses &plist_node->plist as the fake head of
      the priority list for plist_del(), these debug locks in
      the fake head are needed for CONFIG_DEBUG_PI_LIST.
      
      But now we always pass the real head to plist_del(), the debug locks
      in plist_node will not be used, so we remove these assignments.
      Acked-by: default avatarDarren Hart <dvhart@linux.intel.com>
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4D10797E.7040803@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      017f2b23
    • Lai Jiangshan's avatar
      futex,plist: Pass the real head of the priority list to plist_del() · 2e12978a
      Lai Jiangshan authored
      Some plist_del()s in kernel/futex.c are passed a faked head of the
      priority list.
      
      It does not fail because the current code does not require the real head
      in plist_del(). The current code of plist_del() just uses the head for checking,
      so it will not cause a bad result even when we use a faked head.
      
      But it is undocumented usage:
      
      /**
       * plist_del - Remove a @node from plist.
       *
       * @node:	&struct plist_node pointer - entry to be removed
       * @head:	&struct plist_head pointer - list head
       */
      
      The document says that the @head is the "list head" head of the priority list.
      
      In futex code, several places use "plist_del(&q->list, &q->list.plist);",
      they pass a fake head. We need to fix them all.
      
      Thanks to Darren Hart for many suggestions.
      Acked-by: default avatarDarren Hart <dvhart@linux.intel.com>
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4D11984A.5030203@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      2e12978a
    • Michel Lespinasse's avatar
      futex: Sanitize futex ops argument types · 8d7718aa
      Michel Lespinasse authored
      Change futex_atomic_op_inuser and futex_atomic_cmpxchg_inatomic
      prototypes to use u32 types for the futex as this is the data type the
      futex core code uses all over the place.
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <20110311025058.GD26122@google.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8d7718aa
    • Michel Lespinasse's avatar
      futex: Sanitize cmpxchg_futex_value_locked API · 37a9d912
      Michel Lespinasse authored
      The cmpxchg_futex_value_locked API was funny in that it returned either
      the original, user-exposed futex value OR an error code such as -EFAULT.
      This was confusing at best, and could be a source of livelocks in places
      that retry the cmpxchg_futex_value_locked after trying to fix the issue
      by running fault_in_user_writeable().
          
      This change makes the cmpxchg_futex_value_locked API more similar to the
      get_futex_value_locked one, returning an error code and updating the
      original value through a reference argument.
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Acked-by: Chris Metcalf <cmetcalf@tilera.com>  [tile]
      Acked-by: Tony Luck <tony.luck@intel.com>  [ia64]
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: Michal Simek <monstr@monstr.eu>  [microblaze]
      Acked-by: David Howells <dhowells@redhat.com> [frv]
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <20110311024851.GC26122@google.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      37a9d912
    • Michel Lespinasse's avatar
      futex: Remove redundant pagefault_disable in futex_atomic_cmpxchg_inatomic() · 522d7dec
      Michel Lespinasse authored
      kernel/futex.c disables page faults before calling
      futex_atomic_cmpxchg_inatomic(), so there is no need to do it again
      within that function.
      Signed-off-by: default avatarMichel Lespinasse <walken@google.com>
      Cc: Darren Hart <darren@dvhart.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <20110311024731.GB26122@google.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      522d7dec
    • Thomas Gleixner's avatar
      futex: Avoid redudant evaluation of task_pid_vnr() · c0c9ed15
      Thomas Gleixner authored
      The result is not going to change under us, so no need to reevaluate
      this over and over. Seems to be a leftover from the mechanical mass
      conversion of task->pid to task_pid_vnr(tsk).
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      c0c9ed15
  4. 10 Mar, 2011 1 commit
  5. 08 Mar, 2011 5 commits
  6. 07 Mar, 2011 9 commits
  7. 06 Mar, 2011 5 commits
  8. 05 Mar, 2011 9 commits