tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-6.2/block head: dc572f418a14b18270676c4a7d23a3c8a5544abc commit: afdba14612622ec75896e5646950b3562a9aadd3 [31/41] block, bfq: cleanup bfq_weights_tree add/remove apis config: arc-randconfig-r043-20221101 compiler: arc-elf-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/ammarfaizi2/linux-block/commit/afdba14612622ec75896e5646950b3562a9aadd3 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-6.2/block git checkout afdba14612622ec75896e5646950b3562a9aadd3 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): block/bfq-wf2q.c: In function '__bfq_entity_update_weight_prio': >> block/bfq-wf2q.c:709:34: warning: variable 'bfqd' set but not used [-Wunused-but-set-variable] 709 | struct bfq_data *bfqd = NULL; | ^~~~ vim +/bfqd +709 block/bfq-wf2q.c ea25da48086d3b Paolo Valente 2017-04-19 680 431b17f9d54535 Paolo Valente 2017-07-03 681 /* 431b17f9d54535 Paolo Valente 2017-07-03 682 * Update weight and priority of entity. If update_class_too is true, 431b17f9d54535 Paolo Valente 2017-07-03 683 * then update the ioprio_class of entity too. 431b17f9d54535 Paolo Valente 2017-07-03 684 * 431b17f9d54535 Paolo Valente 2017-07-03 685 * The reason why the update of ioprio_class is controlled through the 431b17f9d54535 Paolo Valente 2017-07-03 686 * last parameter is as follows. Changing the ioprio class of an 431b17f9d54535 Paolo Valente 2017-07-03 687 * entity implies changing the destination service trees for that 431b17f9d54535 Paolo Valente 2017-07-03 688 * entity. If such a change occurred when the entity is already on one 431b17f9d54535 Paolo Valente 2017-07-03 689 * of the service trees for its previous class, then the state of the 431b17f9d54535 Paolo Valente 2017-07-03 690 * entity would become more complex: none of the new possible service 431b17f9d54535 Paolo Valente 2017-07-03 691 * trees for the entity, according to bfq_entity_service_tree(), would 431b17f9d54535 Paolo Valente 2017-07-03 692 * match any of the possible service trees on which the entity 431b17f9d54535 Paolo Valente 2017-07-03 693 * is. Complex operations involving these trees, such as entity 431b17f9d54535 Paolo Valente 2017-07-03 694 * activations and deactivations, should take into account this 431b17f9d54535 Paolo Valente 2017-07-03 695 * additional complexity. To avoid this issue, this function is 431b17f9d54535 Paolo Valente 2017-07-03 696 * invoked with update_class_too unset in the points in the code where 431b17f9d54535 Paolo Valente 2017-07-03 697 * entity may happen to be on some tree. 431b17f9d54535 Paolo Valente 2017-07-03 698 */ ea25da48086d3b Paolo Valente 2017-04-19 699 struct bfq_service_tree * ea25da48086d3b Paolo Valente 2017-04-19 700 __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st, 431b17f9d54535 Paolo Valente 2017-07-03 701 struct bfq_entity *entity, 431b17f9d54535 Paolo Valente 2017-07-03 702 bool update_class_too) ea25da48086d3b Paolo Valente 2017-04-19 703 { ea25da48086d3b Paolo Valente 2017-04-19 704 struct bfq_service_tree *new_st = old_st; ea25da48086d3b Paolo Valente 2017-04-19 705 ea25da48086d3b Paolo Valente 2017-04-19 706 if (entity->prio_changed) { ea25da48086d3b Paolo Valente 2017-04-19 707 struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity); ea25da48086d3b Paolo Valente 2017-04-19 708 unsigned int prev_weight, new_weight; ea25da48086d3b Paolo Valente 2017-04-19 @709 struct bfq_data *bfqd = NULL; ea25da48086d3b Paolo Valente 2017-04-19 710 #ifdef CONFIG_BFQ_GROUP_IOSCHED ea25da48086d3b Paolo Valente 2017-04-19 711 struct bfq_sched_data *sd; ea25da48086d3b Paolo Valente 2017-04-19 712 struct bfq_group *bfqg; ea25da48086d3b Paolo Valente 2017-04-19 713 #endif ea25da48086d3b Paolo Valente 2017-04-19 714 ea25da48086d3b Paolo Valente 2017-04-19 715 if (bfqq) ea25da48086d3b Paolo Valente 2017-04-19 716 bfqd = bfqq->bfqd; ea25da48086d3b Paolo Valente 2017-04-19 717 #ifdef CONFIG_BFQ_GROUP_IOSCHED ea25da48086d3b Paolo Valente 2017-04-19 718 else { ea25da48086d3b Paolo Valente 2017-04-19 719 sd = entity->my_sched_data; ea25da48086d3b Paolo Valente 2017-04-19 720 bfqg = container_of(sd, struct bfq_group, sched_data); ea25da48086d3b Paolo Valente 2017-04-19 721 bfqd = (struct bfq_data *)bfqg->bfqd; ea25da48086d3b Paolo Valente 2017-04-19 722 } ea25da48086d3b Paolo Valente 2017-04-19 723 #endif ea25da48086d3b Paolo Valente 2017-04-19 724 e9d3c866bf4cdb Fam Zheng 2019-08-28 725 /* Matches the smp_wmb() in bfq_group_set_weight. */ e9d3c866bf4cdb Fam Zheng 2019-08-28 726 smp_rmb(); ea25da48086d3b Paolo Valente 2017-04-19 727 old_st->wsum -= entity->weight; ea25da48086d3b Paolo Valente 2017-04-19 728 ea25da48086d3b Paolo Valente 2017-04-19 729 if (entity->new_weight != entity->orig_weight) { ea25da48086d3b Paolo Valente 2017-04-19 730 if (entity->new_weight < BFQ_MIN_WEIGHT || ea25da48086d3b Paolo Valente 2017-04-19 731 entity->new_weight > BFQ_MAX_WEIGHT) { ea25da48086d3b Paolo Valente 2017-04-19 732 pr_crit("update_weight_prio: new_weight %d\n", ea25da48086d3b Paolo Valente 2017-04-19 733 entity->new_weight); ea25da48086d3b Paolo Valente 2017-04-19 734 if (entity->new_weight < BFQ_MIN_WEIGHT) ea25da48086d3b Paolo Valente 2017-04-19 735 entity->new_weight = BFQ_MIN_WEIGHT; ea25da48086d3b Paolo Valente 2017-04-19 736 else ea25da48086d3b Paolo Valente 2017-04-19 737 entity->new_weight = BFQ_MAX_WEIGHT; ea25da48086d3b Paolo Valente 2017-04-19 738 } ea25da48086d3b Paolo Valente 2017-04-19 739 entity->orig_weight = entity->new_weight; ea25da48086d3b Paolo Valente 2017-04-19 740 if (bfqq) ea25da48086d3b Paolo Valente 2017-04-19 741 bfqq->ioprio = ea25da48086d3b Paolo Valente 2017-04-19 742 bfq_weight_to_ioprio(entity->orig_weight); ea25da48086d3b Paolo Valente 2017-04-19 743 } ea25da48086d3b Paolo Valente 2017-04-19 744 431b17f9d54535 Paolo Valente 2017-07-03 745 if (bfqq && update_class_too) ea25da48086d3b Paolo Valente 2017-04-19 746 bfqq->ioprio_class = bfqq->new_ioprio_class; 431b17f9d54535 Paolo Valente 2017-07-03 747 431b17f9d54535 Paolo Valente 2017-07-03 748 /* 431b17f9d54535 Paolo Valente 2017-07-03 749 * Reset prio_changed only if the ioprio_class change 431b17f9d54535 Paolo Valente 2017-07-03 750 * is not pending any longer. 431b17f9d54535 Paolo Valente 2017-07-03 751 */ 431b17f9d54535 Paolo Valente 2017-07-03 752 if (!bfqq || bfqq->ioprio_class == bfqq->new_ioprio_class) ea25da48086d3b Paolo Valente 2017-04-19 753 entity->prio_changed = 0; ea25da48086d3b Paolo Valente 2017-04-19 754 ea25da48086d3b Paolo Valente 2017-04-19 755 /* ea25da48086d3b Paolo Valente 2017-04-19 756 * NOTE: here we may be changing the weight too early, ea25da48086d3b Paolo Valente 2017-04-19 757 * this will cause unfairness. The correct approach ea25da48086d3b Paolo Valente 2017-04-19 758 * would have required additional complexity to defer ea25da48086d3b Paolo Valente 2017-04-19 759 * weight changes to the proper time instants (i.e., ea25da48086d3b Paolo Valente 2017-04-19 760 * when entity->finish <= old_st->vtime). ea25da48086d3b Paolo Valente 2017-04-19 761 */ ea25da48086d3b Paolo Valente 2017-04-19 762 new_st = bfq_entity_service_tree(entity); ea25da48086d3b Paolo Valente 2017-04-19 763 ea25da48086d3b Paolo Valente 2017-04-19 764 prev_weight = entity->weight; ea25da48086d3b Paolo Valente 2017-04-19 765 new_weight = entity->orig_weight * ea25da48086d3b Paolo Valente 2017-04-19 766 (bfqq ? bfqq->wr_coeff : 1); ea25da48086d3b Paolo Valente 2017-04-19 767 /* 2d29c9f89fcd9b Federico Motta 2018-10-12 768 * If the weight of the entity changes, and the entity is a 2d29c9f89fcd9b Federico Motta 2018-10-12 769 * queue, remove the entity from its old weight counter (if 2d29c9f89fcd9b Federico Motta 2018-10-12 770 * there is a counter associated with the entity). ea25da48086d3b Paolo Valente 2017-04-19 771 */ afdba14612622e Yu Kuai 2022-09-16 772 if (prev_weight != new_weight && bfqq) afdba14612622e Yu Kuai 2022-09-16 773 __bfq_weights_tree_remove(bfqq); ea25da48086d3b Paolo Valente 2017-04-19 774 entity->weight = new_weight; ea25da48086d3b Paolo Valente 2017-04-19 775 /* 2d29c9f89fcd9b Federico Motta 2018-10-12 776 * Add the entity, if it is not a weight-raised queue, 2d29c9f89fcd9b Federico Motta 2018-10-12 777 * to the counter associated with its new weight. ea25da48086d3b Paolo Valente 2017-04-19 778 */ afdba14612622e Yu Kuai 2022-09-16 779 if (prev_weight != new_weight && bfqq && bfqq->wr_coeff == 1) afdba14612622e Yu Kuai 2022-09-16 780 bfq_weights_tree_add(bfqq); ea25da48086d3b Paolo Valente 2017-04-19 781 ea25da48086d3b Paolo Valente 2017-04-19 782 new_st->wsum += entity->weight; ea25da48086d3b Paolo Valente 2017-04-19 783 ea25da48086d3b Paolo Valente 2017-04-19 784 if (new_st != old_st) ea25da48086d3b Paolo Valente 2017-04-19 785 entity->start = new_st->vtime; ea25da48086d3b Paolo Valente 2017-04-19 786 } ea25da48086d3b Paolo Valente 2017-04-19 787 ea25da48086d3b Paolo Valente 2017-04-19 788 return new_st; ea25da48086d3b Paolo Valente 2017-04-19 789 } ea25da48086d3b Paolo Valente 2017-04-19 790 :::::: The code at line 709 was first introduced by commit :::::: ea25da48086d3bbebf3a2eeff387ea00ed96f5c4 block, bfq: split bfq-iosched.c into multiple source files :::::: TO: Paolo Valente :::::: CC: Jens Axboe -- 0-DAY CI Kernel Test Service https://01.org/lkp