summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorFrancesco Pollicino <fra.fra.800@gmail.com>2019-03-12 04:59:33 -0400
committerJens Axboe <axboe@kernel.dk>2019-04-01 10:15:40 -0400
commit1e66413c4f68e2a61a210e4f5ff5df7a2ab86a5b (patch)
tree49e5f455fa84648d09b82a92e114dfb6975adaca /block/bfq-iosched.c
parent84a746891e1d8364485c0a37533fe6c1380270d4 (diff)
block, bfq: print SHARED instead of pid for shared queues in logs
The function "bfq_log_bfqq" prints the pid of the process associated with the queue passed as input. Unfortunately, if the queue is shared, then more than one process is associated with the queue. The pid that gets printed in this case is the pid of one of the associated processes. Which process gets printed depends on the exact sequence of merge events the queue underwent. So printing such a pid is rather useless and above all is often rather confusing because it reports a random pid between those of the associated processes. This commit addresses this issue by printing SHARED instead of a pid if the queue is shared. Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Francesco Pollicino <fra.fra.800@gmail.com> Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 49bde428f7f2..37cc8f127cf6 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2590,6 +2590,16 @@ bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
2590 * assignment causes no harm). 2590 * assignment causes no harm).
2591 */ 2591 */
2592 new_bfqq->bic = NULL; 2592 new_bfqq->bic = NULL;
2593 /*
2594 * If the queue is shared, the pid is the pid of one of the associated
2595 * processes. Which pid depends on the exact sequence of merge events
2596 * the queue underwent. So printing such a pid is useless and confusing
2597 * because it reports a random pid between those of the associated
2598 * processes.
2599 * We mark such a queue with a pid -1, and then print SHARED instead of
2600 * a pid in logging messages.
2601 */
2602 new_bfqq->pid = -1;
2593 bfqq->bic = NULL; 2603 bfqq->bic = NULL;
2594 /* release process reference to bfqq */ 2604 /* release process reference to bfqq */
2595 bfq_put_queue(bfqq); 2605 bfq_put_queue(bfqq);