Commit a6123047 authored by Paolo Valente's avatar Paolo Valente Committed by Jens Axboe

block, bfq: move io_cq-persistent bfqq data into a dedicated struct

With a multi-actuator drive, a process may get associated with multiple
bfq_queues: one queue for each of the N actuators. So, the bfq_io_cq
data structure must be able to accommodate its per-queue persistent
information for N queues. Currently it stores this information for
just one queue, in several scalar fields.

This is a preparatory commit for moving to accommodating persistent
information for N queues. In particular, this commit packs all the
above scalar fields into a single data structure. Then there is now
only one field, in bfq_io_cq, that stores all the above information. This
scalar field will then be turned into an array by a following commit.
Suggested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarGianmarco Lusvardi <glusvardi@posteo.net>
Signed-off-by: default avatarGiulio Barabino <giuliobarabino99@gmail.com>
Signed-off-by: default avatarEmiliano Maccaferri <inbox@emilianomaccaferri.com>
Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
Link: https://lore.kernel.org/r/20230103145503.71712-4-paolo.valente@linaro.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b7529898
This diff is collapsed.
...@@ -413,27 +413,9 @@ struct bfq_queue { ...@@ -413,27 +413,9 @@ struct bfq_queue {
}; };
/** /**
* struct bfq_io_cq - per (request_queue, io_context) structure. * struct bfq_data - bfqq data unique and persistent for associated bfq_io_cq
*/ */
struct bfq_io_cq { struct bfq_iocq_bfqq_data {
/* associated io_cq structure */
struct io_cq icq; /* must be the first member */
/*
* Matrix of associated process queues: first row for async
* queues, second row sync queues. Each row contains one
* column for each actuator. An I/O request generated by the
* process is inserted into the queue pointed by bfqq[i][j] if
* the request is to be served by the j-th actuator of the
* drive, where i==0 or i==1, depending on whether the request
* is async or sync. So there is a distinct queue for each
* actuator.
*/
struct bfq_queue *bfqq[2][BFQ_MAX_ACTUATORS];
/* per (request_queue, blkcg) ioprio */
int ioprio;
#ifdef CONFIG_BFQ_GROUP_IOSCHED
uint64_t blkcg_serial_nr; /* the current blkcg serial */
#endif
/* /*
* Snapshot of the has_short_time flag before merging; taken * Snapshot of the has_short_time flag before merging; taken
* to remember its value while the queue is merged, so as to * to remember its value while the queue is merged, so as to
...@@ -488,6 +470,34 @@ struct bfq_io_cq { ...@@ -488,6 +470,34 @@ struct bfq_io_cq {
struct bfq_queue *stable_merge_bfqq; struct bfq_queue *stable_merge_bfqq;
bool stably_merged; /* non splittable if true */ bool stably_merged; /* non splittable if true */
};
/**
* struct bfq_io_cq - per (request_queue, io_context) structure.
*/
struct bfq_io_cq {
/* associated io_cq structure */
struct io_cq icq; /* must be the first member */
/*
* Matrix of associated process queues: first row for async
* queues, second row sync queues. Each row contains one
* column for each actuator. An I/O request generated by the
* process is inserted into the queue pointed by bfqq[i][j] if
* the request is to be served by the j-th actuator of the
* drive, where i==0 or i==1, depending on whether the request
* is async or sync. So there is a distinct queue for each
* actuator.
*/
struct bfq_queue *bfqq[2][BFQ_MAX_ACTUATORS];
/* per (request_queue, blkcg) ioprio */
int ioprio;
#ifdef CONFIG_BFQ_GROUP_IOSCHED
uint64_t blkcg_serial_nr; /* the current blkcg serial */
#endif
/* persistent data for associated synchronous process queue */
struct bfq_iocq_bfqq_data bfqq_data;
unsigned int requests; /* Number of requests this process has in flight */ unsigned int requests; /* Number of requests this process has in flight */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment