Re: [PATCH 21/45] writeback: estimate bdi write bandwidth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-10-07 at 15:38 +0800, Wu Fengguang wrote:
> +static void bdi_calc_write_bandwidth(struct backing_dev_info *bdi,
> +                                    unsigned long nr_pages,
> +                                    unsigned long time)
> +{
> +       unsigned long bw;
> +
> +       bw = HZ * nr_pages / (time | 1);
> +       bdi->write_bandwidth = (bdi->write_bandwidth * 63 + bw) / 64;
> +}

If you have block times < 1 jiffy this all falls apart quite quickly.
You could perhaps try to use cpu_clock() for ns resolution timestamps if
this is a real issue.

(I could imagine fast arrays with huge throughput causing small sleeps,
resulting in underestimates of their bandwidth)

Also, 63/64 seems rather slow progress.. maybe that's good.



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux