Re: [PATCH v3] bcache: fix writeback target calc on large devices

2018-01-08 Thread Michael Lyle
Tang Junhui-- Thanks for your feedback, help, and flexibility. I will try to make this better overall in the long term. On Sun, Jan 7, 2018 at 6:46 PM, wrote: > OK, please replace 16384 with macro, and replease 16384 * > bdev_sectors(dc->bdev) > with bit shift operation, eg: bdev_sectors(dc-

Re: [PATCH v3] bcache: fix writeback target calc on large devices

2018-01-07 Thread tang . junhui
From: Tang Junhui >On Fri, Jan 5, 2018 at 11:29 PM, wrote: >> From: Tang Junhui >> >> Hello Mike, >> >> I thought twice, and feel this patch is a little complex and still not very >> accurate for >> small backend devices. I think we can resolve it like this: >> >> uint64_t cache_dirty_ta

Re: [PATCH v3] bcache: fix writeback target calc on large devices

2018-01-06 Thread Michael Lyle
Tang Junhui-- On Fri, Jan 5, 2018 at 11:29 PM, wrote: > From: Tang Junhui > > Hello Mike, > > I thought twice, and feel this patch is a little complex and still not very > accurate for > small backend devices. I think we can resolve it like this: > > uint64_t cache_dirty_target = >

Re: [PATCH v3] bcache: fix writeback target calc on large devices

2018-01-05 Thread tang . junhui
From: Tang Junhui Hello Mike, I thought twice, and feel this patch is a little complex and still not very accurate for small backend devices. I think we can resolve it like this: uint64_t cache_dirty_target = div_u64(cache_sectors * dc->writeback_percent, 100); -int64_t targ

Re: [PATCH v3] bcache: fix writeback target calc on large devices

2018-01-05 Thread Michael Lyle
On 01/05/2018 01:17 PM, Michael Lyle wrote: > Bcache needs to scale the dirty data in the cache over the multiple > backing disks in order to calculate writeback rates for each. > The previous code did this by multiplying the target number of dirty > sectors by the backing device size, and expected

[PATCH v3] bcache: fix writeback target calc on large devices

2018-01-05 Thread Michael Lyle
Bcache needs to scale the dirty data in the cache over the multiple backing disks in order to calculate writeback rates for each. The previous code did this by multiplying the target number of dirty sectors by the backing device size, and expected it to fit into a uint64_t; this blows up on relativ