X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fproportions.h;h=5afc1b23346d1f04536ea9339c1790b1cceeef3a;hb=2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92;hp=2c3b3cad92bec050b18605cffe39784f774f09d0;hpb=4c5cdb1e1f2a502069f57a60b5c6b97b8106c73c;p=linux-2.6 diff --git a/include/linux/proportions.h b/include/linux/proportions.h index 2c3b3cad92..5afc1b2334 100644 --- a/include/linux/proportions.h +++ b/include/linux/proportions.h @@ -77,6 +77,19 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl) local_irq_restore(flags); } +/* + * Limit the time part in order to ensure there are some bits left for the + * cycle counter and fraction multiply. + */ +#define PROP_MAX_SHIFT (3*BITS_PER_LONG/4) + +#define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1) +#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT) + +void __prop_inc_percpu_max(struct prop_descriptor *pd, + struct prop_local_percpu *pl, long frac); + + /* * ----- SINGLE ------ */