On 07/04/2013 05:13 PM, Peter Zijlstra wrote: [snip] > > Right, but something like the below is limited in cost to at most 32/64 (I > forgot the type) shifts. Now its probably not worth doing, but it shows > things like that can be done in 'constant' time. > > now = jiffies; > if (now - p->last_switch_decay > 8*sizeof(p->nr_wakee_switch)*HZ) { > p->nr_wakee_switch = 0; > p->last_switch_decay = now; > } else while (now > p->last_switch_decay + HZ) { > p->nr_wakee_switch >>= 1; > p->last_switch_decay += HZ; > }
Hmm...interesting, some kind of cataclysm decay, not sure how it works but yes, the cost was capped. Well, seems like we still have many follow-up research works after fix the issue ;-) Regards, Michael Wang > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/