[2/2] bfq: ignore oom_bfqq in bfq_check_waker

Message ID 20221108181030.1611703-2-khazhy@google.com
State New
Headers
Series [RFC] bfq: fix waker_bfqq inconsistency crash |

Commit Message

Khazhismel Kumykov Nov. 8, 2022, 6:10 p.m. UTC
  oom_bfqq is just a fallback bfqq, so shouldn't be used with waker
detection.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
---
 block/bfq-iosched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Jan Kara Nov. 9, 2022, 11:14 a.m. UTC | #1
On Tue 08-11-22 10:10:30, Khazhismel Kumykov wrote:
> oom_bfqq is just a fallback bfqq, so shouldn't be used with waker
> detection.
> 
> Suggested-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Khazhismel Kumykov <khazhy@google.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  block/bfq-iosched.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index ca04ec868c40..267baf84870f 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -2135,7 +2135,9 @@ static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq,
>  	if (!bfqd->last_completed_rq_bfqq ||
>  	    bfqd->last_completed_rq_bfqq == bfqq ||
>  	    bfq_bfqq_has_short_ttime(bfqq) ||
> -	    now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC)
> +	    now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC ||
> +	    bfqd->last_completed_rq_bfqq == &bfqd->oom_bfqq ||
> +	    bfqq == &bfqd->oom_bfqq)
>  		return;
>  
>  	/*
> -- 
> 2.38.1.431.g37b22c650d-goog
>
  

Patch

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ca04ec868c40..267baf84870f 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2135,7 +2135,9 @@  static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq,
 	if (!bfqd->last_completed_rq_bfqq ||
 	    bfqd->last_completed_rq_bfqq == bfqq ||
 	    bfq_bfqq_has_short_ttime(bfqq) ||
-	    now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC)
+	    now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC ||
+	    bfqd->last_completed_rq_bfqq == &bfqd->oom_bfqq ||
+	    bfqq == &bfqd->oom_bfqq)
 		return;
 
 	/*