Skip to contentSkip to conversation

block/bfq: fix ifdef for CONFIG_BFQ_GROUP_IOSCHED=y

PATCH In review Konstantin Khlebnikov 4 participants 7 messages Mar 29, 2019 – Apr 1, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/bfq: fix ifdef for CONFIG_BFQ_GROUP_IOSCHED=y

Replace BFQ_GROUP_IOSCHED_ENABLED with CONFIG_BFQ_GROUP_IOSCHED. Code under these ifdefs never worked, something might be broken.

Fixes 0471559c2fbd ("block, bfq: add/remove entity weights correctly")
Fixes 73d58118498b ("block, bfq: consider also ioprio classes in symmetry detection")
---
 block/bfq-iosched.c |    2 +-
 block/bfq-wf2q.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
block/bfq-iosched.c +1 -1
index 4c592496a16a..fac188dd78fa 100644
@@ -674,7 +674,7 @@ static bool bfq_symmetric_scenario(struct bfq_data *bfqd)
 	 * at least two nodes.
 	 */
 	return !(varied_queue_weights || multiple_classes_busy
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
 	       || bfqd->num_groups_with_pending_reqs > 0
 #endif
 		);
block/bfq-wf2q.c +1 -1
index 63311d1ff1ed..a11bef75483d 100644
@@ -1012,7 +1012,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
 		entity->on_st = true;
 	}
 
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
 	if (!bfq_entity_to_bfqq(entity)) { /* bfq_group */
 		struct bfq_group *bfqg =
 			container_of(entity, struct bfq_group, entity);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Konstantin Khlebnikov

Replace BFQ_GROUP_IOSCHED_ENABLED with CONFIG_BFQ_GROUP_IOSCHED. Code under these ifdefs never worked, something might be broken.

Fixes 0471559c2fbd ("block, bfq: add/remove entity weights correctly")
Fixes 73d58118498b ("block, bfq: consider also ioprio classes in symmetry detection")
---
  block/bfq-iosched.c |    2 +-
  block/bfq-wf2q.c    |    2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
block/bfq-iosched.c +1 -1
index 4c592496a16a..fac188dd78fa 100644
@@ -674,7 +674,7 @@ static bool bfq_symmetric_scenario(struct bfq_data *bfqd)
  	 * at least two nodes.
  	 */
  	return !(varied_queue_weights || multiple_classes_busy
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
  	       || bfqd->num_groups_with_pending_reqs > 0
  #endif
  		);
block/bfq-wf2q.c +0 -0
index 63311d1ff1ed..a11bef75483d 100644

block/bfq-wf2q.c static void __bfq_activate_entity(struct bfq_entity *entity, · line 1018

Quoted 8 lines
block/bfq-wf2q.c +1 -1
@@ -1012,7 +1012,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
  		entity->on_st = true;
  	}
 
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
  	if (!bfq_entity_to_bfqq(entity)) { /* bfq_group */
  		struct bfq_group *bfqg =
  			container_of(entity, struct bfq_group, entity);

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

cheers,
Holger

maintainer
#2 lore raw
Quoted 33 lines · Holger Hoffstätte
Quoted 32 lines · Konstantin Khlebnikov

Replace BFQ_GROUP_IOSCHED_ENABLED with CONFIG_BFQ_GROUP_IOSCHED. Code under these ifdefs never worked, something might be broken.

Fixes 0471559c2fbd ("block, bfq: add/remove entity weights correctly")
Fixes 73d58118498b ("block, bfq: consider also ioprio classes in symmetry detection")
---
  block/bfq-iosched.c |    2 +-
  block/bfq-wf2q.c    |    2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
block/bfq-iosched.c +1 -1
index 4c592496a16a..fac188dd78fa 100644
@@ -674,7 +674,7 @@ static bool bfq_symmetric_scenario(struct bfq_data *bfqd)
  	 * at least two nodes.
  	 */
  	return !(varied_queue_weights || multiple_classes_busy
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
  	       || bfqd->num_groups_with_pending_reqs > 0
  #endif
  		);
block/bfq-wf2q.c +0 -0
index 63311d1ff1ed..a11bef75483d 100644
@@ -1012,7 +1012,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
  		entity->on_st = true;
  	}
 
Quoted 12 lines

block/bfq-wf2q.c static void __bfq_activate_entity(struct bfq_entity *entity, · line 1018

Quoted 7 lines
block/bfq-wf2q.c +1 -1
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
  	if (!bfq_entity_to_bfqq(entity)) { /* bfq_group */
  		struct bfq_group *bfqg =
  			container_of(entity, struct bfq_group, entity);

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

I'm hesitant to apply this, since the group scheduling stuff has obviously never been tested.

Hence it should go through some actual testing first, which means it's a 5.2 candidate, not 5.1.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 47 lines · Jens Axboe
Quoted 33 lines · Holger Hoffstätte
Quoted 32 lines · Konstantin Khlebnikov

Replace BFQ_GROUP_IOSCHED_ENABLED with CONFIG_BFQ_GROUP_IOSCHED. Code under these ifdefs never worked, something might be broken.

Fixes 0471559c2fbd ("block, bfq: add/remove entity weights correctly")
Fixes 73d58118498b ("block, bfq: consider also ioprio classes in symmetry detection")
---
   block/bfq-iosched.c |    2 +-
   block/bfq-wf2q.c    |    2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)
block/bfq-iosched.c +1 -1
index 4c592496a16a..fac188dd78fa 100644
@@ -674,7 +674,7 @@ static bool bfq_symmetric_scenario(struct bfq_data *bfqd)
   	 * at least two nodes.
   	 */
   	return !(varied_queue_weights || multiple_classes_busy
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
   	       || bfqd->num_groups_with_pending_reqs > 0
   #endif
   		);
block/bfq-wf2q.c +0 -0
index 63311d1ff1ed..a11bef75483d 100644
@@ -1012,7 +1012,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
   		entity->on_st = true;
   	}
 
Quoted 12 lines

block/bfq-wf2q.c static void __bfq_activate_entity(struct bfq_entity *entity, · line 1018

Quoted 7 lines
block/bfq-wf2q.c +1 -1
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
   	if (!bfq_entity_to_bfqq(entity)) { /* bfq_group */
   		struct bfq_group *bfqg =
   			container_of(entity, struct bfq_group, entity);

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

Quoted 2 lines

I'm hesitant to apply this, since the group scheduling stuff has obviously never been tested.

This is simply a regression in 5.1 caused by 73d58118498b - nothing else, and as such this fix needs to go into 5.1 as well. I'm sure Paolo will agree. What you so ominously call "the group scheduling stuff" has been there and shipping in mainline since day 1 of the BFQ merge, and it works fine in 5.0.

cheers
Holger

maintainer
#4 lore raw
Quoted 48 lines · Holger Hoffstätte
Quoted 47 lines · Jens Axboe
Quoted 45 lines · Holger Hoffstätte
Quoted 31 lines · Konstantin Khlebnikov

Replace BFQ_GROUP_IOSCHED_ENABLED with CONFIG_BFQ_GROUP_IOSCHED. Code under these ifdefs never worked, something might be broken.

Fixes 0471559c2fbd ("block, bfq: add/remove entity weights correctly")
Fixes 73d58118498b ("block, bfq: consider also ioprio classes in symmetry detection")
---
   block/bfq-iosched.c |    2 +-
   block/bfq-wf2q.c    |    2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)
block/bfq-iosched.c +1 -1
index 4c592496a16a..fac188dd78fa 100644
@@ -674,7 +674,7 @@ static bool bfq_symmetric_scenario(struct bfq_data *bfqd)
   	 * at least two nodes.
   	 */
   	return !(varied_queue_weights || multiple_classes_busy
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
   	       || bfqd->num_groups_with_pending_reqs > 0
   #endif
   		);
block/bfq-wf2q.c +0 -0
index 63311d1ff1ed..a11bef75483d 100644

block/bfq-wf2q.c static void __bfq_activate_entity(struct bfq_entity *entity, · line 1018

Quoted 8 lines
block/bfq-wf2q.c +1 -1
@@ -1012,7 +1012,7 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
   		entity->on_st = true;
   	}
 
-#ifdef BFQ_GROUP_IOSCHED_ENABLED
+#ifdef CONFIG_BFQ_GROUP_IOSCHED
   	if (!bfq_entity_to_bfqq(entity)) { /* bfq_group */
   		struct bfq_group *bfqg =
   			container_of(entity, struct bfq_group, entity);

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

Quoted 7 lines
Quoted 2 lines

I'm hesitant to apply this, since the group scheduling stuff has obviously never been tested.

This is simply a regression in 5.1 caused by 73d58118498b - nothing else, and as such this fix needs to go into 5.1 as well. I'm sure Paolo will agree. What you so ominously call "the group scheduling stuff" has been there and shipping in mainline since day 1 of the BFQ merge, and it works fine in 5.0.

If that's the case (I didn't check how far back it went), then yes, it should of course go into 5.1.

The ominous nature of my reply I'll chalk up to your interpretation

Signature · 1 line
Jens Axboe
#5 lore raw
Quoted 8 lines · Jens Axboe
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

I'm hesitant to apply this, since the group scheduling stuff has obviously never been tested.

Quoted 7 lines
Quoted 4 lines

This is simply a regression in 5.1 caused by 73d58118498b - nothing else, and as such this fix needs to go into 5.1 as well. I'm sure Paolo will agree. What you so ominously call "the group scheduling stuff" has been there and shipping in mainline since day 1 of the BFQ merge, and it works fine in 5.0.

If that's the case (I didn't check how far back it went), then yes, it should of course go into 5.1.

Yay.

Quoted 1 line

The ominous nature of my reply I'll chalk up to your interpretation

Fair enough ;)

A more interesting question is why upstream uses undefined defines for patches. That's a first-rate self-grenade if I've ever seen one, and obviously something that is easily missed. Paolo?

-h

#6 lore raw
Quoted 22 lines

Il giorno 29 mar 2019, alle ore 17:44, Holger Hoffstätte <[email protected]> ha scritto:

Quoted 8 lines · Jens Axboe
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

Good catch! I run without group scheduling and therefore didn't notice these stray defines earlier. For 5.1 it should merge cleanly; adding this on top of the pending 5.2 BFQ patches required a small context fixup in hunk #1 due to "block, bfq: do not idle for lowest-weight queues".

I'm hesitant to apply this, since the group scheduling stuff has obviously never been tested.

Quoted 6 lines
Quoted 4 lines

This is simply a regression in 5.1 caused by 73d58118498b - nothing else, and as such this fix needs to go into 5.1 as well. I'm sure Paolo will agree. What you so ominously call "the group scheduling stuff" has been there and shipping in mainline since day 1 of the BFQ merge, and it works fine in 5.0.

If that's the case (I didn't check how far back it went), then yes, it should of course go into 5.1.

Yay.

Quoted 8 lines
Quoted 1 line

The ominous nature of my reply I'll chalk up to your interpretation

Fair enough ;)

A more interesting question is why upstream uses undefined defines for patches. That's a first-rate self-grenade if I've ever seen one, and obviously something that is easily missed. Paolo?

Paolo feels a little bit ashamed for this mistake :)

This horrible typo may also be the cause of the crashes recently reported on this list. I've just asked to try this fix:
https://lore.kernel.org/linux-block/[email protected]/T/

And yes, I agree that this fix should be applied to 5.1. Thank you Konstantin for spotting and removing this bomb.

Thanks,
Paolo

Quoted 1 line

-h