Re: [PATCH][next] bcache: Use 64-bit arithmetic instead of 32-bit

2021-02-13 Thread Coly Li
On 2/13/21 12:42 AM, David Laight wrote: > From: Coly Li >> Sent: 12 February 2021 16:02 >> >> On 2/12/21 11:31 PM, David Laight wrote: > if (c->gc_stats.in_use <= BCH_WRITEBACK_FRAGMENT_THRESHOLD_MID) > { > - fp_term = dc->writeback_rate_fp_term_low * >

RE: [PATCH][next] bcache: Use 64-bit arithmetic instead of 32-bit

2021-02-12 Thread David Laight
From: Coly Li > Sent: 12 February 2021 16:02 > > On 2/12/21 11:31 PM, David Laight wrote: > >>> if (c->gc_stats.in_use <= BCH_WRITEBACK_FRAGMENT_THRESHOLD_MID) > >>> { > >>> - fp_term = dc->writeback_rate_fp_term_low * > >>> + fp_term = (int64_t)dc->writ

Re: [PATCH][next] bcache: Use 64-bit arithmetic instead of 32-bit

2021-02-12 Thread Coly Li
On 2/12/21 11:31 PM, David Laight wrote: >>> if (c->gc_stats.in_use <= BCH_WRITEBACK_FRAGMENT_THRESHOLD_MID) >>> { >>> - fp_term = dc->writeback_rate_fp_term_low * >>> + fp_term = (int64_t)dc->writeback_rate_fp_term_low * >>> (c->

RE: [PATCH][next] bcache: Use 64-bit arithmetic instead of 32-bit

2021-02-12 Thread David Laight
> > if (c->gc_stats.in_use <= BCH_WRITEBACK_FRAGMENT_THRESHOLD_MID) > > { > > - fp_term = dc->writeback_rate_fp_term_low * > > + fp_term = (int64_t)dc->writeback_rate_fp_term_low * > > (c->gc_stats.in_use - > > BCH_WRITEBACK_FRAG

Re: [PATCH][next] bcache: Use 64-bit arithmetic instead of 32-bit

2021-02-12 Thread Coly Li
On 2/12/21 8:50 PM, Gustavo A. R. Silva wrote: > Cast multiple variables to (int64_t) in order to give the compiler > complete information about the proper arithmetic to use. Notice that > these variables are being used in contexts that expect expressions of > type int64_t (64 bit, signed). And cu