lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] generic dynamic per cpu refcounting
    On Mon, Jan 28, 2013 at 01:36:22PM -0800, Tejun Heo wrote:
    > On Mon, Jan 28, 2013 at 01:28:14PM -0800, Tejun Heo wrote:
    > > But at that point, the operation is already global, so there gotta be
    > > a lighter way to synchronize stuff than going through full grace
    > > period. ie. You can add a bias value before marking dead so that the
    > > counter never reaches zero before all percpu counters are collected
    > > and then unbias it right before putting the base ref, that way the
    > > only way you can hit zero ref is all refs are actually zero.
    >
    > Note that I'm saying that there's no need to distinguish between dying
    > and dead.

    Yeah I got that, I _think_ that makes me like the idea.

    > The only thing percpu part should care about it whether
    > percpu is on or off. We need a full grace period to turn off percpu
    > operations of any type but that should be the only case where full
    > grace period is necessary. The rest should be synchronizable via the
    > usual global synchronization. We probably can just test percpu
    > variable against NULL and forget about the encoded state numbers.

    Can't quite do that because initially, we use that variable for a
    timestamp and when we're shutting down we don't want percpu_ref_get()
    allocating percpu counters again.

    You'll probably use that as an argument against dynamic allocation :P


    \
     
     \ /
      Last update: 2013-01-28 23:21    [W:2.479 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site