Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1285396
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: undefined shift in wb_update_dirty_ratelimit() |
| Date | 2015-12-07 15:30 +0100 |
| Message-ID | <qD4XG-5GH-45@gated-at.bofh.it> (permalink) |
| References | <qD4NY-5Bp-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hello, Andrey.
On Mon, Dec 07, 2015 at 05:17:06PM +0300, Andrey Ryabinin wrote:
> I've hit undefined shift in wb_update_dirty_ratelimit() which does some
> mysterious 'step' calculations:
>
> /*
> * Don't pursue 100% rate matching. It's impossible since the balanced
> * rate itself is constantly fluctuating. So decrease the track speed
> * when it gets close to the target. Helps eliminate pointless tremors.
> */
> step >>= dirty_ratelimit / (2 * step + 1);
>
>
> dirty_ratelimit = INIT_BW and step = 0 results in this:
>
> [ 5006.957366] ================================================================================
> [ 5006.957798] UBSAN: Undefined behaviour in ../mm/page-writeback.c:1286:7
> [ 5006.958091] shift exponent 25600 is too large for 64-bit type 'long unsigned int'
We prolly should do sth like
shift = dirty_ratelimit / (2 * step = 1);
if (shift < BITS_PER_LONG) {
step = (step >> shift) + 7 / 8;
} else {
step = 0;
}
Thanks.
--
tejun
--
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/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
undefined shift in wb_update_dirty_ratelimit() Andrey Ryabinin <aryabinin@odin.com> - 2015-12-07 15:20 +0100 Re: undefined shift in wb_update_dirty_ratelimit() Tejun Heo <tj@kernel.org> - 2015-12-07 15:30 +0100
csiph-web