Re: [PATCH 6.1] block, bfq: split sync bfq_queues on a per-actuator basis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: 9778369a2d6c5ed2b81a04164c4aa9da1bdb193d

WARNING: Author mismatch between patch and upstream commit:
Backport author: Hagar Hemdan<hagarhem@xxxxxxxxxx>
Commit author: Paolo Valente<paolo.valente@xxxxxxxxxx>


Status in newer kernel trees:
6.13.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)

Note: The patch differs from the upstream commit:
---
1:  9778369a2d6c5 ! 1:  e73e0a774c936 block, bfq: split sync bfq_queues on a per-actuator basis
    @@ Metadata
      ## Commit message ##
         block, bfq: split sync bfq_queues on a per-actuator basis
     
    +    commit 9778369a2d6c5ed2b81a04164c4aa9da1bdb193d upstream.
    +
         Single-LUN multi-actuator SCSI drives, as well as all multi-actuator
         SATA drives appear as a single device to the I/O subsystem [1].  Yet
         they address commands to different actuators internally, as a function
    @@ Commit message
         Signed-off-by: Paolo Valente <paolo.valente@xxxxxxxxxx>
         Link: https://lore.kernel.org/r/20230103145503.71712-2-paolo.valente@xxxxxxxxxx
         Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    +    Stable-dep-of: e8b8344de398 ("block, bfq: fix bfqq uaf in bfq_limit_depth()")
    +    [Hagar: needed contextual fixes]
    +    Signed-off-by: Hagar Hemdan <hagarhem@xxxxxxxxxx>
     
      ## block/bfq-cgroup.c ##
     @@ block/bfq-cgroup.c: void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
    @@ block/bfq-cgroup.c: void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *
      /**
       * __bfq_bic_change_cgroup - move @bic to @bfqg.
       * @bfqd: the queue descriptor.
    -@@ block/bfq-cgroup.c: static void __bfq_bic_change_cgroup(struct bfq_data *bfqd,
    - 				    struct bfq_io_cq *bic,
    - 				    struct bfq_group *bfqg)
    +@@ block/bfq-cgroup.c: void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
    +  * sure that the reference to cgroup is valid across the call (see
    +  * comments in bfq_bic_update_cgroup on this issue)
    +  */
    +-static void *__bfq_bic_change_cgroup(struct bfq_data *bfqd,
    ++static void __bfq_bic_change_cgroup(struct bfq_data *bfqd,
    + 				     struct bfq_io_cq *bic,
    + 				     struct bfq_group *bfqg)
      {
     -	struct bfq_queue *async_bfqq = bic_to_bfqq(bic, false);
     -	struct bfq_queue *sync_bfqq = bic_to_bfqq(bic, true);
    @@ block/bfq-cgroup.c: static void __bfq_bic_change_cgroup(struct bfq_data *bfqd,
     -				 * request from the old cgroup.
     -				 */
     -				bfq_put_cooperator(sync_bfqq);
    --				bfq_release_process_ref(bfqd, sync_bfqq);
     -				bic_set_bfqq(bic, NULL, true);
    +-				bfq_release_process_ref(bfqd, sync_bfqq);
     -			}
     -		}
     +		if (sync_bfqq)
     +			bfq_sync_bfqq_move(bfqd, sync_bfqq, bic, bfqg, act_idx);
      	}
    +-
    +-	return bfqg;
      }
      
    + void bfq_bic_update_cgroup(struct bfq_io_cq *bic, struct bio *bio)
     
      ## block/bfq-iosched.c ##
     @@ block/bfq-iosched.c: static const unsigned long bfq_late_stable_merging = 600;
    @@ block/bfq-iosched.c: static bool bfq_bio_merge(struct request_queue *q, struct b
      	} else {
      		bfqd->bio_bfqq = NULL;
      	}
    -@@ block/bfq-iosched.c: bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
    +@@ block/bfq-iosched.c: static struct bfq_queue *bfq_merge_bfqqs(struct bfq_data *bfqd,
      	/*
      	 * Merge queues (that is, let bic redirect its requests to new_bfqq)
      	 */
    @@ block/bfq-iosched.c: static void bfq_check_ioprio_change(struct bfq_io_cq *bic,
     -	bfqq = bic_to_bfqq(bic, false);
     +	bfqq = bic_to_bfqq(bic, false, bfq_actuator_index(bfqd, bio));
      	if (bfqq) {
    - 		bfq_release_process_ref(bfqd, bfqq);
    + 		struct bfq_queue *old_bfqq = bfqq;
    + 
      		bfqq = bfq_get_queue(bfqd, bio, false, bic, true);
     -		bic_set_bfqq(bic, bfqq, false);
     +		bic_set_bfqq(bic, bfqq, false, bfq_actuator_index(bfqd, bio));
    + 		bfq_release_process_ref(bfqd, old_bfqq);
      	}
      
     -	bfqq = bic_to_bfqq(bic, true);
    @@ block/bfq-iosched.c: static bool __bfq_insert_request(struct bfq_data *bfqd, str
      		 * then complete the merge and redirect it to
      		 * new_bfqq.
      		 */
    --		if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq)
    +-		if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq) {
     +		if (bic_to_bfqq(RQ_BIC(rq), true,
    -+				bfq_actuator_index(bfqd, rq->bio)) == bfqq)
    - 			bfq_merge_bfqqs(bfqd, RQ_BIC(rq),
    - 					bfqq, new_bfqq);
    - 
    ++				bfq_actuator_index(bfqd, rq->bio)) == bfqq) {
    + 			while (bfqq != new_bfqq)
    + 				bfqq = bfq_merge_bfqqs(bfqd, RQ_BIC(rq), bfqq);
    + 		}
     @@ block/bfq-iosched.c: bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
      		return bfqq;
      	}
    @@ block/bfq-iosched.h: struct bfq_group {
     +				unsigned int actuator_idx);
      struct bfq_data *bic_to_bfqd(struct bfq_io_cq *bic);
      void bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq);
    - void bfq_weights_tree_add(struct bfq_queue *bfqq);
    + void bfq_weights_tree_add(struct bfq_data *bfqd, struct bfq_queue *bfqq,
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux