diff options
author | Bart Van Assche <[email protected]> | 2019-10-25 09:50:10 -0700 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2019-10-25 14:12:20 -0600 |
commit | f7e76dbc24df695f1b8e88ed3201be22215ec969 (patch) | |
tree | 7ffba72420872347d8a556ea42f8c41edc389ebd /net/switchdev/switchdev.c | |
parent | ac0d6b926e741f328b23c8af0134312af7c032d9 (diff) |
block: Reduce the amount of memory used for tag sets
Instead of allocating an array of size nr_cpu_ids for set->tags, allocate
an array of size set->nr_hw_queues. This patch improves behavior that was
introduced by commit 868f2f0b7206 ("blk-mq: dynamic h/w context count").
Reallocating tag sets from inside __blk_mq_update_nr_hw_queues() is safe
because:
- All request queues that share the tag sets are frozen before the tag sets
are reallocated.
- blk_mq_queue_tag_busy_iter() holds q->q_usage_counter while active and
hence is serialized against __blk_mq_update_nr_hw_queues().
Cc: Keith Busch <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Ming Lei <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Johannes Thumshirn <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions