[lkml]   [2008]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [rfc] SLOB memory ordering issue
    On Thu, 2008-10-16 at 03:34 +1100, Nick Piggin wrote:
    > I think I see a possible memory ordering problem with SLOB:
    > In slab caches with constructors, the constructor is run
    > before returning the object to caller, with no memory barrier
    > afterwards.
    > Now there is nothing that indicates the _exact_ behaviour
    > required here. Is it at all reasonable to expect ->ctor() to
    > be visible to all CPUs and not just the allocating CPU?

    Do you have a failure scenario in mind?

    First, it's a categorical mistake for another CPU to be looking at the
    contents of an object unless it knows that it's in an allocated state.

    For another CPU to receive that knowledge (by reading a causally-valid
    pointer to it in memory), a memory barrier has to occur, no?

    Mathematics is the supreme nostalgia of our time.

     \ /
      Last update: 2008-10-15 18:59    [W:0.023 / U:0.276 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site