Commit b5735e77 authored by Matteo De Carlo's avatar Matteo De Carlo

Added BFQ patch fix

parent 512b8b0b
pkgbase = linux-covolunablu-gaming
pkgver = 4.15.14
pkgrel = 1
pkgrel = 2
url = https://www.kernel.org/
arch = x86_64
license = GPL2
......@@ -22,6 +22,7 @@ pkgbase = linux-covolunablu-gaming
source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
source = 0002-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch
source = bfq-default.patch
source = bfq-lock-division-zero.patch
source = https://raw.githubusercontent.com/ValveSoftware/steamos_kernel/c4948d923637a956853df0e85a6d530e483bdffa/drivers/input/joystick/xpad.c
validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886
validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E
......@@ -36,6 +37,7 @@ pkgbase = linux-covolunablu-gaming
sha256sums = 19b17156ea5aec86e4eb87fc855789375a5184faf564b4ac2cd0f279de7b3bf9
sha256sums = f49e23e2a00357f8a5f6cc5caadd56a4df2b0a3e2b53d76a514ca508f25a62a7
sha256sums = a20f72660076bc5f73404800da9bc52ceb592bdfbdab19438d66da8c01edc4f4
sha256sums = 2a40a1906c5bef180035c8af21c38c1f364a81f38507b684058803b3fa9fcfd6
sha256sums = 851b79826c1695acf93faffb17bcb420c11d12cfa96ac6b5082e4306c2d8fb55
pkgname = linux-covolunablu-gaming
......
......@@ -6,7 +6,7 @@
pkgbase=linux-covolunablu-gaming
_srcname=linux-4.15
pkgver=4.15.14
pkgrel=1
pkgrel=2
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
......@@ -29,6 +29,7 @@ source=(
0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
0002-drm-i915-edp-Only-use-the-alternate-fixed-mode-if-it.patch
bfq-default.patch
bfq-lock-division-zero.patch
https://raw.githubusercontent.com/ValveSoftware/steamos_kernel/c4948d923637a956853df0e85a6d530e483bdffa/drivers/input/joystick/xpad.c
)
validpgpkeys=(
......@@ -47,6 +48,7 @@ sha256sums=('5a26478906d5005f4f809402e981518d2b8844949199f60c4b6e1f986ca2a769'
'19b17156ea5aec86e4eb87fc855789375a5184faf564b4ac2cd0f279de7b3bf9'
'f49e23e2a00357f8a5f6cc5caadd56a4df2b0a3e2b53d76a514ca508f25a62a7'
'a20f72660076bc5f73404800da9bc52ceb592bdfbdab19438d66da8c01edc4f4'
'2a40a1906c5bef180035c8af21c38c1f364a81f38507b684058803b3fa9fcfd6'
'851b79826c1695acf93faffb17bcb420c11d12cfa96ac6b5082e4306c2d8fb55'
)
......@@ -71,6 +73,10 @@ prepare() {
# use bfq as default scheduler
patch -p1 -i ../bfq-default.patch
# fix for bfq blocking requests for slow devices
# https://www.spinics.net/lists/kernel/msg2739205.html
patch -p1 -i ../bfq-lock-division-zero.patch
# use steamos version of xpad
cp "${srcdir}/xpad.c" ./drivers/input/joystick/xpad.c
......
Rate should never overflow or become zero because it is used as divider.
This patch accumulates it with saturation.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
block/bfq-iosched.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index aeca22d91101..a236c8d541b5 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2546,7 +2546,8 @@ static void bfq_reset_rate_computation(struct bfq_data *bfqd,
static void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
{
- u32 rate, weight, divisor;
+ u32 weight, divisor;
+ u64 rate;
/*
* For the convergence property to hold (see comments on
@@ -2634,9 +2635,10 @@ static void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
*/
bfqd->peak_rate *= divisor-1;
bfqd->peak_rate /= divisor;
- rate /= divisor; /* smoothing constant alpha = 1/divisor */
+ do_div(rate, divisor); /* smoothing constant alpha = 1/divisor */
- bfqd->peak_rate += rate;
+ /* rate should never overlow or become zero */
+ bfqd->peak_rate = clamp_t(u64, rate + bfqd->peak_rate, 1, U32_MAX);
update_thr_responsiveness_params(bfqd);
reset_computation:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment