lkml.org 
[lkml]   [2006]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [2.6.16 PATCH] Connector: Filesystem Events Connector
    On Thu, Mar 23, 2006 at 11:35:50PM -0800, Matt Helsley (matthltc@us.ibm.com) wrote:
    > I would argue preemption should be disabled around the if-block at the
    > very least. Suppose your rate limit is 10k calls/sec and you have 4
    > procs. Each proc has a sequence of three instructions:
    >
    > load fsevent_sum into register rx (rx <= 1000)
    > rx++ (rx <= 1001)
    > store contents of register rx in fsevent_sum (fsevent_sum <= 1001)
    >
    >
    > Now consider the following sequence of steps:
    >
    > load fsevent_sum into rx (rx <= 1000)
    > <preempted>
    > <3 other processors each manage to increment the sum by 3333 bringing us
    > to 9999>
    > <resumed>
    > rx++ (rx <= 1001)
    > store contents of rx in fsevent_sum (fsevent_sum <= 1001)
    >
    > So every processor now thinks it won't exceed the rate limit by
    > generating more events when in fact we've just exceeded the limit. So,
    > unless my example is flawed, I think you need to disable preemption
    > here.

    Doesn't it just exceed the limit by one event per cpu?

    > Also, even if you simply disable preemption couldn't this cause the
    > cache line containing the sum to bounce frequently on large SMP systems?
    >
    > <snip>
    >
    > Cheers,
    > -Matt Helsley

    --
    Evgeniy Polyakov
    -
    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: 2006-03-24 09:14    [W:0.028 / U:0.156 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site