Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Hagar Hemdan <hagarhem@amazon.com>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.1] block, bfq: split sync bfq_queues on a per-actuator basis
Date: Wed, 19 Feb 2025 08:00:35 -0500	[thread overview]
Message-ID: <20250219075548-b15300b0512e10b0@stable.kernel.org> (raw)
In-Reply-To: <20250219090907.30462-1-hagarhem@amazon.com>

[ 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@amazon.com>
Commit author: Paolo Valente<paolo.valente@linaro.org>


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@linaro.org>
         Link: https://lore.kernel.org/r/20230103145503.71712-2-paolo.valente@linaro.org
         Signed-off-by: Jens Axboe <axboe@kernel.dk>
    +    Stable-dep-of: e8b8344de398 ("block, bfq: fix bfqq uaf in bfq_limit_depth()")
    +    [Hagar: needed contextual fixes]
    +    Signed-off-by: Hagar Hemdan <hagarhem@amazon.com>
     
      ## 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   |

      parent reply	other threads:[~2025-02-19 13:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19  9:09 [PATCH 6.1] block, bfq: split sync bfq_queues on a per-actuator basis Hagar Hemdan
2025-02-19  9:09 ` [PATCH 6.1] block, bfq: fix bfqq uaf in bfq_limit_depth() Hagar Hemdan
2025-02-19 13:00   ` Sasha Levin
2025-02-19 13:00 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250219075548-b15300b0512e10b0@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=hagarhem@amazon.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox