Re: [PATCH 02/12] btrfs: add bps discard rate limit for async discard

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

 



On Thu, Jan 02, 2020 at 04:26:36PM -0500, Dennis Zhou wrote:
> +		 */
> +		if (kbps_limit && discard_ctl->prev_discard) {
> +			u64 bps_limit = ((u64)kbps_limit) * SZ_1K;
> +			u64 bps_delay = div64_u64(discard_ctl->prev_discard *
> +						  MSEC_PER_SEC, bps_limit);

I hoped we can get rid of the 64bit division when the kbps is u32 but I
don't think it's necessary, bytes as units of the calculation are fine.

> +
> +			delay = max(delay, msecs_to_jiffies(bps_delay));
> +		}



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux