Looks good.
> idle = init_tasks[0]->times.tms_utime + init_tasks[0]->times.tms_stime;
> [snip]
> */
> #if HZ!=100
> len = sprintf(page,"%lu.%02lu %lu.%02lu\n",
> - uptime / HZ,
> - (((uptime % HZ) * 100) / HZ) % 100,
> + (unsigned long) uptime,
> + (remainder * 100) / HZ,
> idle / HZ,
> (((idle % HZ) * 100) / HZ) % 100);
Probably need to make idle a 64-bit value as well, even if the individual
items are not, just to avoid potential overflow... Calling do_div(idle,HZ)
may end up being just as fast as the hoops we jump through above to calculate
the fractions (2 divides, 2 modulus, and one multiply).
Cheers, Andreas
-- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/- 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/