lkml.org 
[lkml]   [2011]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/3] kref: Remove the memory barriers
    On Mon, Dec 12, 2011 at 09:55:57AM +0100, Peter Zijlstra wrote:
    > On Mon, 2011-12-12 at 11:48 +0800, Ming Lei wrote:
    > > We can't assume any lock about kref usage, because kref is often used
    > > in lockless scenario.
    >
    > Then you're doing it wrong, seriously.
    >
    > kref in lockless scenarios simply doesn't work, you need rcu (or another
    > means to stabilize storage) and atomic_inc_not_zero() as well as means
    > to validate your object after the lookup.

    I agree, and I'll apply your patches later today, thanks for doing them.

    greg k-h


    \
     
     \ /
      Last update: 2011-12-12 16:31    [W:5.650 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site