1. 09 May, 2017 1 commit
  2. 10 Feb, 2017 1 commit
  3. 18 Jan, 2017 1 commit
    • Peter Zijlstra's avatar
      locking/atomic, kref: Implement kref_put_lock() · 0a13cd1a
      Peter Zijlstra authored
      Because home-rolling your own is _awesome_, stop doing it. Provide
      kref_put_lock(), just like kref_put_mutex() but for a spinlock.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0a13cd1a
  4. 14 Jan, 2017 3 commits
    • Peter Zijlstra's avatar
      locking/atomic, kref: Kill kref_sub() · bdfafc4f
      Peter Zijlstra authored
      By general sentiment kref_sub() is a bad interface, make it go away.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      bdfafc4f
    • Peter Zijlstra's avatar
      locking/atomic, kref: Add kref_read() · 2c935bc5
      Peter Zijlstra authored
      Since we need to change the implementation, stop exposing internals.
      
      Provide kref_read() to read the current reference count; typically
      used for debug messages.
      
      Kills two anti-patterns:
      
      	atomic_read(&kref->refcount)
      	kref->refcount.counter
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2c935bc5
    • Peter Zijlstra's avatar
      locking/atomic, kref: Add KREF_INIT() · 1e24edca
      Peter Zijlstra authored
      Since we need to change the implementation, stop exposing internals.
      
      Provide KREF_INIT() to allow static initialization of struct kref.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1e24edca
  5. 11 Jan, 2017 1 commit
  6. 16 Dec, 2016 1 commit
  7. 29 Nov, 2015 1 commit
  8. 15 May, 2013 1 commit
  9. 07 May, 2013 1 commit
  10. 20 Nov, 2012 1 commit
    • Thomas Hellstrom's avatar
      kref: Implement kref_get_unless_zero v3 · 4b20db3d
      Thomas Hellstrom authored
      This function is intended to simplify locking around refcounting for
      objects that can be looked up from a lookup structure, and which are
      removed from that lookup structure in the object destructor.
      Operations on such objects require at least a read lock around
      lookup + kref_get, and a write lock around kref_put + remove from lookup
      structure. Furthermore, RCU implementations become extremely tricky.
      With a lookup followed by a kref_get_unless_zero *with return value check*
      locking in the kref_put path can be deferred to the actual removal from
      the lookup structure and RCU lookups become trivial.
      
      v2: Formatting fixes.
      v3: Invert the return value.
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      4b20db3d
  11. 22 Aug, 2012 1 commit
  12. 17 Jan, 2012 1 commit
    • James Bottomley's avatar
      Fix compile breakage with kref.h · 67175b85
      James Bottomley authored
      This set of build failures just started appearing on parisc:
      
        In file included from drivers/input/serio/serio_raw.c:12:
        include/linux/kref.h: In function 'kref_get':
        include/linux/kref.h:40: error: 'TAINT_WARN' undeclared (first use in this function)
        include/linux/kref.h:40: error: (Each undeclared identifier is reported only once
        include/linux/kref.h:40: error: for each function it appears in.)
        include/linux/kref.h: In function 'kref_sub':
        include/linux/kref.h:65: error: 'TAINT_WARN' undeclared (first use in this function)
      
      It happens because TAINT_WARN is defined in kernel.h and this particular
      compile doesn't seem to include it (no idea why it's just manifesting ..
      probably some #include file untangling exposed it).
      
      Fix by adding
      
        #include <linux/kernel.h>
      
      to linux/kref.h
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      67175b85
  13. 14 Dec, 2011 1 commit
    • Greg Kroah-Hartman's avatar
      kref: fix up the kfree build problems · 6261ddee
      Greg Kroah-Hartman authored
      It turns out that some memory allocators use kobjects, which use krefs,
      and kref.h was wanting to figure out the address of kfree(), which ended
      up in a loop.
      
      kfree was only being needed for a warning to tell the caller that they
      were doing something stupid.  Now we just move that warning into the
      comments for the functions, which results in a bit more fun as everyone
      enjoys digging for people to mock at times of boredom.
      
      So, remove the dependancy of slab.h on kref.h, and fix up the other
      include file as well (we really only need bug.h and atomic.h, not
      types.h).
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6261ddee
  14. 13 Dec, 2011 3 commits
    • Peter Zijlstra's avatar
      kref: Remove the memory barriers · 3c8ed889
      Peter Zijlstra authored
      Commit 1b0b3b99 ("kref: fix CPU ordering with respect to krefs")
      wrongly adds memory barriers to kref.
      
      It states:
      
        some atomic operations are only atomic, not ordered. Thus a CPU is allowed
        to reorder memory references to an object to before the reference is
        obtained. This fixes it.
      
      While true, it fails to show why this is a problem. I say it is not a
      problem because if there is a race with kref_put() such that we could
      end up referencing a free'd object without this memory barrier, we
      would still have that race with the memory barrier.
      
      The kref_put() in question could complete (and free the object) before
      the atomic_inc() and we'd still be up shit creek.
      
      The kref_init() case is even worse, if your object is published at this
      time you're so wrong the memory barrier won't make a difference what
      so ever. If its not published, the act of publishing should include
      the needed barriers/locks to make sure all writes prior to the act of
      publishing are complete such that others will only observe a complete
      object.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3c8ed889
    • Peter Zijlstra's avatar
      kref: Implement kref_put in terms of kref_sub · 47dbd7d9
      Peter Zijlstra authored
      Less lines of code is better.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      47dbd7d9
    • Peter Zijlstra's avatar
      kref: Inline all functions · 4af679cd
      Peter Zijlstra authored
      These are tiny functions, there's no point in having them out-of-line.
      
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-8eccvi2ur2fzgi00xdjlbf5z@git.kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4af679cd
  15. 07 Jan, 2011 1 commit
  16. 05 Jan, 2011 1 commit
  17. 22 Nov, 2010 1 commit
  18. 21 May, 2010 1 commit
  19. 15 Mar, 2010 1 commit
  20. 26 Sep, 2009 1 commit
  21. 30 Apr, 2008 1 commit
  22. 25 Jan, 2008 1 commit
  23. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      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