lkml.org 
[lkml]   [2007]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 0/24] make atomic_read() behave consistently across all architectures
    Herbert Xu writes:

    > > Are you sure? How do you know some other CPU hasn't changed the value
    > > in between?
    >
    > Yes I'm sure, because we don't care if others have increased
    > the reservation.

    But others can also reduce the reservation. Also, the code sets and
    clears *sk->sk_prot->memory_pressure nonatomically with respect to the
    reads of sk->sk_prot->memory_allocated, so in fact the code doesn't
    guarantee any particular relationship between the two.

    That code looks like a beautiful example of buggy, racy code where
    someone has sprinkled magic fix-the-races dust (otherwise known as
    atomic_t) around in a vain attempt to fix the races.

    That's assuming that all that stuff actually performs any useful
    purpose, of course, and that there isn't some lock held by the
    callers. In the latter case it is pointless using atomic_t.

    Paul.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-08-16 05:27    [W:3.463 / U:0.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site