Skip to content

Commit 978c7ec

Browse files
committed
Merge branch 'centos-stream-9-rhel9.6-block-update-v6.12' into block_test
Signed-off-by: Rado Vrbovsky <[email protected]>
2 parents 366f64d + 654920f commit 978c7ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+629
-620
lines changed

MAINTAINERS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3351,10 +3351,9 @@ F: Documentation/filesystems/befs.rst
33513351
F: fs/befs/
33523352

33533353
BFQ I/O SCHEDULER
3354-
M: Paolo Valente <[email protected]>
3355-
M: Jens Axboe <[email protected]>
3354+
M: Yu Kuai <[email protected]>
33563355
3357-
S: Maintained
3356+
S: Odd Fixes
33583357
F: Documentation/block/bfq-iosched.rst
33593358
F: block/bfq-*
33603359

block/bdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ int bd_prepare_to_claim(struct block_device *bdev, void *holder,
529529

530530
/* if claiming is already in progress, wait for it to finish */
531531
if (whole->bd_claiming) {
532-
wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
532+
wait_queue_head_t *wq = __var_waitqueue(&whole->bd_claiming);
533533
DEFINE_WAIT(wait);
534534

535535
prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
@@ -552,7 +552,7 @@ static void bd_clear_claiming(struct block_device *whole, void *holder)
552552
/* tell others that we're done */
553553
BUG_ON(whole->bd_claiming != holder);
554554
whole->bd_claiming = NULL;
555-
wake_up_bit(&whole->bd_claiming, 0);
555+
wake_up_var(&whole->bd_claiming);
556556
}
557557

558558
/**

block/bfq-cgroup.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,7 @@ void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
679679
bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);
680680
bfqg_and_blkg_put(old_parent);
681681

682-
if (entity->parent &&
683-
entity->parent->last_bfqq_created == bfqq)
684-
entity->parent->last_bfqq_created = NULL;
685-
else if (bfqd->last_bfqq_created == bfqq)
686-
bfqd->last_bfqq_created = NULL;
687-
682+
bfq_reassign_last_bfqq(bfqq, NULL);
688683
entity->parent = bfqg->my_entity;
689684
entity->sched_data = &bfqg->sched_data;
690685
/* pin down bfqg and its associated blkg */

block/bfq-iosched.c

Lines changed: 110 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,8 +2911,12 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
29112911
struct bfq_iocq_bfqq_data *bfqq_data = &bic->bfqq_data[a_idx];
29122912

29132913
/* if a merge has already been setup, then proceed with that first */
2914-
if (bfqq->new_bfqq)
2915-
return bfqq->new_bfqq;
2914+
new_bfqq = bfqq->new_bfqq;
2915+
if (new_bfqq) {
2916+
while (new_bfqq->new_bfqq)
2917+
new_bfqq = new_bfqq->new_bfqq;
2918+
return new_bfqq;
2919+
}
29162920

29172921
/*
29182922
* Check delayed stable merge for rotational or non-queueing
@@ -3093,8 +3097,8 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
30933097
}
30943098

30953099

3096-
static void
3097-
bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq, struct bfq_queue *new_bfqq)
3100+
void bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq,
3101+
struct bfq_queue *new_bfqq)
30983102
{
30993103
if (cur_bfqq->entity.parent &&
31003104
cur_bfqq->entity.parent->last_bfqq_created == cur_bfqq)
@@ -3125,10 +3129,12 @@ void bfq_release_process_ref(struct bfq_data *bfqd, struct bfq_queue *bfqq)
31253129
bfq_put_queue(bfqq);
31263130
}
31273131

3128-
static void
3129-
bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
3130-
struct bfq_queue *bfqq, struct bfq_queue *new_bfqq)
3132+
static struct bfq_queue *bfq_merge_bfqqs(struct bfq_data *bfqd,
3133+
struct bfq_io_cq *bic,
3134+
struct bfq_queue *bfqq)
31313135
{
3136+
struct bfq_queue *new_bfqq = bfqq->new_bfqq;
3137+
31323138
bfq_log_bfqq(bfqd, bfqq, "merging with queue %lu",
31333139
(unsigned long)new_bfqq->pid);
31343140
/* Save weight raising and idle window of the merged queues */
@@ -3222,6 +3228,8 @@ bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
32223228
bfq_reassign_last_bfqq(bfqq, new_bfqq);
32233229

32243230
bfq_release_process_ref(bfqd, bfqq);
3231+
3232+
return new_bfqq;
32253233
}
32263234

32273235
static bool bfq_allow_bio_merge(struct request_queue *q, struct request *rq,
@@ -3257,14 +3265,8 @@ static bool bfq_allow_bio_merge(struct request_queue *q, struct request *rq,
32573265
* fulfilled, i.e., bic can be redirected to new_bfqq
32583266
* and bfqq can be put.
32593267
*/
3260-
bfq_merge_bfqqs(bfqd, bfqd->bio_bic, bfqq,
3261-
new_bfqq);
3262-
/*
3263-
* If we get here, bio will be queued into new_queue,
3264-
* so use new_bfqq to decide whether bio and rq can be
3265-
* merged.
3266-
*/
3267-
bfqq = new_bfqq;
3268+
while (bfqq != new_bfqq)
3269+
bfqq = bfq_merge_bfqqs(bfqd, bfqd->bio_bic, bfqq);
32683270

32693271
/*
32703272
* Change also bqfd->bio_bfqq, as
@@ -5701,9 +5703,7 @@ bfq_do_early_stable_merge(struct bfq_data *bfqd, struct bfq_queue *bfqq,
57015703
* state before killing it.
57025704
*/
57035705
bfqq->bic = bic;
5704-
bfq_merge_bfqqs(bfqd, bic, bfqq, new_bfqq);
5705-
5706-
return new_bfqq;
5706+
return bfq_merge_bfqqs(bfqd, bic, bfqq);
57075707
}
57085708

57095709
/*
@@ -6158,6 +6158,7 @@ static bool __bfq_insert_request(struct bfq_data *bfqd, struct request *rq)
61586158
bool waiting, idle_timer_disabled = false;
61596159

61606160
if (new_bfqq) {
6161+
struct bfq_queue *old_bfqq = bfqq;
61616162
/*
61626163
* Release the request's reference to the old bfqq
61636164
* and make sure one is taken to the shared queue.
@@ -6174,18 +6175,18 @@ static bool __bfq_insert_request(struct bfq_data *bfqd, struct request *rq)
61746175
* new_bfqq.
61756176
*/
61766177
if (bic_to_bfqq(RQ_BIC(rq), true,
6177-
bfq_actuator_index(bfqd, rq->bio)) == bfqq)
6178-
bfq_merge_bfqqs(bfqd, RQ_BIC(rq),
6179-
bfqq, new_bfqq);
6178+
bfq_actuator_index(bfqd, rq->bio)) == bfqq) {
6179+
while (bfqq != new_bfqq)
6180+
bfqq = bfq_merge_bfqqs(bfqd, RQ_BIC(rq), bfqq);
6181+
}
61806182

6181-
bfq_clear_bfqq_just_created(bfqq);
6183+
bfq_clear_bfqq_just_created(old_bfqq);
61826184
/*
61836185
* rq is about to be enqueued into new_bfqq,
61846186
* release rq reference on bfqq
61856187
*/
6186-
bfq_put_queue(bfqq);
6188+
bfq_put_queue(old_bfqq);
61876189
rq->elv.priv[1] = new_bfqq;
6188-
bfqq = new_bfqq;
61896190
}
61906191

61916192
bfq_update_io_thinktime(bfqd, bfqq);
@@ -6723,7 +6724,7 @@ bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
67236724
{
67246725
bfq_log_bfqq(bfqq->bfqd, bfqq, "splitting queue");
67256726

6726-
if (bfqq_process_refs(bfqq) == 1) {
6727+
if (bfqq_process_refs(bfqq) == 1 && !bfqq->new_bfqq) {
67276728
bfqq->pid = current->pid;
67286729
bfq_clear_bfqq_coop(bfqq);
67296730
bfq_clear_bfqq_split_coop(bfqq);
@@ -6738,11 +6739,10 @@ bfq_split_bfqq(struct bfq_io_cq *bic, struct bfq_queue *bfqq)
67386739
return NULL;
67396740
}
67406741

6741-
static struct bfq_queue *bfq_get_bfqq_handle_split(struct bfq_data *bfqd,
6742-
struct bfq_io_cq *bic,
6743-
struct bio *bio,
6744-
bool split, bool is_sync,
6745-
bool *new_queue)
6742+
static struct bfq_queue *
6743+
__bfq_get_bfqq_handle_split(struct bfq_data *bfqd, struct bfq_io_cq *bic,
6744+
struct bio *bio, bool split, bool is_sync,
6745+
bool *new_queue)
67466746
{
67476747
unsigned int act_idx = bfq_actuator_index(bfqd, bio);
67486748
struct bfq_queue *bfqq = bic_to_bfqq(bic, is_sync, act_idx);
@@ -6821,6 +6821,84 @@ static void bfq_prepare_request(struct request *rq)
68216821
rq->elv.priv[0] = rq->elv.priv[1] = NULL;
68226822
}
68236823

6824+
static struct bfq_queue *bfq_waker_bfqq(struct bfq_queue *bfqq)
6825+
{
6826+
struct bfq_queue *new_bfqq = bfqq->new_bfqq;
6827+
struct bfq_queue *waker_bfqq = bfqq->waker_bfqq;
6828+
6829+
if (!waker_bfqq)
6830+
return NULL;
6831+
6832+
while (new_bfqq) {
6833+
if (new_bfqq == waker_bfqq) {
6834+
/*
6835+
* If waker_bfqq is in the merge chain, and current
6836+
* is the only procress.
6837+
*/
6838+
if (bfqq_process_refs(waker_bfqq) == 1)
6839+
return NULL;
6840+
break;
6841+
}
6842+
6843+
new_bfqq = new_bfqq->new_bfqq;
6844+
}
6845+
6846+
return waker_bfqq;
6847+
}
6848+
6849+
static struct bfq_queue *bfq_get_bfqq_handle_split(struct bfq_data *bfqd,
6850+
struct bfq_io_cq *bic,
6851+
struct bio *bio,
6852+
unsigned int idx,
6853+
bool is_sync)
6854+
{
6855+
struct bfq_queue *waker_bfqq;
6856+
struct bfq_queue *bfqq;
6857+
bool new_queue = false;
6858+
6859+
bfqq = __bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync,
6860+
&new_queue);
6861+
if (unlikely(new_queue))
6862+
return bfqq;
6863+
6864+
/* If the queue was seeky for too long, break it apart. */
6865+
if (!bfq_bfqq_coop(bfqq) || !bfq_bfqq_split_coop(bfqq) ||
6866+
bic->bfqq_data[idx].stably_merged)
6867+
return bfqq;
6868+
6869+
waker_bfqq = bfq_waker_bfqq(bfqq);
6870+
6871+
/* Update bic before losing reference to bfqq */
6872+
if (bfq_bfqq_in_large_burst(bfqq))
6873+
bic->bfqq_data[idx].saved_in_large_burst = true;
6874+
6875+
bfqq = bfq_split_bfqq(bic, bfqq);
6876+
if (bfqq) {
6877+
bfq_bfqq_resume_state(bfqq, bfqd, bic, true);
6878+
return bfqq;
6879+
}
6880+
6881+
bfqq = __bfq_get_bfqq_handle_split(bfqd, bic, bio, true, is_sync, NULL);
6882+
if (unlikely(bfqq == &bfqd->oom_bfqq))
6883+
return bfqq;
6884+
6885+
bfq_bfqq_resume_state(bfqq, bfqd, bic, false);
6886+
bfqq->waker_bfqq = waker_bfqq;
6887+
bfqq->tentative_waker_bfqq = NULL;
6888+
6889+
/*
6890+
* If the waker queue disappears, then new_bfqq->waker_bfqq must be
6891+
* reset. So insert new_bfqq into the
6892+
* woken_list of the waker. See
6893+
* bfq_check_waker for details.
6894+
*/
6895+
if (waker_bfqq)
6896+
hlist_add_head(&bfqq->woken_list_node,
6897+
&bfqq->waker_bfqq->woken_list);
6898+
6899+
return bfqq;
6900+
}
6901+
68246902
/*
68256903
* If needed, init rq, allocate bfq data structures associated with
68266904
* rq, and increment reference counters in the destination bfq_queue
@@ -6852,8 +6930,6 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
68526930
struct bfq_io_cq *bic;
68536931
const int is_sync = rq_is_sync(rq);
68546932
struct bfq_queue *bfqq;
6855-
bool new_queue = false;
6856-
bool bfqq_already_existing = false, split = false;
68576933
unsigned int a_idx = bfq_actuator_index(bfqd, bio);
68586934

68596935
if (unlikely(!rq->elv.icq))
@@ -6870,54 +6946,9 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
68706946
return RQ_BFQQ(rq);
68716947

68726948
bic = icq_to_bic(rq->elv.icq);
6873-
68746949
bfq_check_ioprio_change(bic, bio);
6875-
68766950
bfq_bic_update_cgroup(bic, bio);
6877-
6878-
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync,
6879-
&new_queue);
6880-
6881-
if (likely(!new_queue)) {
6882-
/* If the queue was seeky for too long, break it apart. */
6883-
if (bfq_bfqq_coop(bfqq) && bfq_bfqq_split_coop(bfqq) &&
6884-
!bic->bfqq_data[a_idx].stably_merged) {
6885-
struct bfq_queue *old_bfqq = bfqq;
6886-
6887-
/* Update bic before losing reference to bfqq */
6888-
if (bfq_bfqq_in_large_burst(bfqq))
6889-
bic->bfqq_data[a_idx].saved_in_large_burst =
6890-
true;
6891-
6892-
bfqq = bfq_split_bfqq(bic, bfqq);
6893-
split = true;
6894-
6895-
if (!bfqq) {
6896-
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio,
6897-
true, is_sync,
6898-
NULL);
6899-
if (unlikely(bfqq == &bfqd->oom_bfqq))
6900-
bfqq_already_existing = true;
6901-
} else
6902-
bfqq_already_existing = true;
6903-
6904-
if (!bfqq_already_existing) {
6905-
bfqq->waker_bfqq = old_bfqq->waker_bfqq;
6906-
bfqq->tentative_waker_bfqq = NULL;
6907-
6908-
/*
6909-
* If the waker queue disappears, then
6910-
* new_bfqq->waker_bfqq must be
6911-
* reset. So insert new_bfqq into the
6912-
* woken_list of the waker. See
6913-
* bfq_check_waker for details.
6914-
*/
6915-
if (bfqq->waker_bfqq)
6916-
hlist_add_head(&bfqq->woken_list_node,
6917-
&bfqq->waker_bfqq->woken_list);
6918-
}
6919-
}
6920-
}
6951+
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, a_idx, is_sync);
69216952

69226953
bfqq_request_allocated(bfqq);
69236954
bfqq->ref++;
@@ -6935,18 +6966,8 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
69356966
* resume its state.
69366967
*/
69376968
if (likely(bfqq != &bfqd->oom_bfqq) && !bfqq->new_bfqq &&
6938-
bfqq_process_refs(bfqq) == 1) {
6969+
bfqq_process_refs(bfqq) == 1)
69396970
bfqq->bic = bic;
6940-
if (split) {
6941-
/*
6942-
* The queue has just been split from a shared
6943-
* queue: restore the idle window and the
6944-
* possible weight raising period.
6945-
*/
6946-
bfq_bfqq_resume_state(bfqq, bfqd, bic,
6947-
bfqq_already_existing);
6948-
}
6949-
}
69506971

69516972
/*
69526973
* Consider bfqq as possibly belonging to a burst of newly

block/bfq-iosched.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,8 @@ void bfq_del_bfqq_busy(struct bfq_queue *bfqq, bool expiration);
11561156
void bfq_add_bfqq_busy(struct bfq_queue *bfqq);
11571157
void bfq_add_bfqq_in_groups_with_pending_reqs(struct bfq_queue *bfqq);
11581158
void bfq_del_bfqq_in_groups_with_pending_reqs(struct bfq_queue *bfqq);
1159+
void bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq,
1160+
struct bfq_queue *new_bfqq);
11591161

11601162
/* --------------- end of interface of B-WF2Q+ ---------------- */
11611163

@@ -1183,11 +1185,6 @@ struct bfq_group *bfqq_group(struct bfq_queue *bfqq);
11831185
"%s " fmt, pid_str, ##args); \
11841186
} while (0)
11851187

1186-
#define bfq_log_bfqg(bfqd, bfqg, fmt, args...) do { \
1187-
blk_add_cgroup_trace_msg((bfqd)->queue, \
1188-
&bfqg_to_blkg(bfqg)->blkcg->css, fmt, ##args); \
1189-
} while (0)
1190-
11911188
#else /* CONFIG_BFQ_GROUP_IOSCHED */
11921189

11931190
#define bfq_log_bfqq(bfqd, bfqq, fmt, args...) do { \
@@ -1197,7 +1194,6 @@ struct bfq_group *bfqq_group(struct bfq_queue *bfqq);
11971194
bfq_bfqq_name((bfqq), pid_str, MAX_BFQQ_NAME_LENGTH); \
11981195
blk_add_trace_msg((bfqd)->queue, "%s " fmt, pid_str, ##args); \
11991196
} while (0)
1200-
#define bfq_log_bfqg(bfqd, bfqg, fmt, args...) do {} while (0)
12011197

12021198
#endif /* CONFIG_BFQ_GROUP_IOSCHED */
12031199

block/bio-integrity.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ int bio_integrity_map_user(struct bio *bio, void __user *ubuf, ssize_t bytes,
365365
kfree(bvec);
366366
return ret;
367367
}
368-
EXPORT_SYMBOL_GPL(bio_integrity_map_user);
369368

370369
/**
371370
* bio_integrity_prep - Prepare bio for integrity I/O

0 commit comments

Comments
 (0)