mbox series

[0/2] small optimization for accessing queue map

Message ID 1548325533-1695-1-git-send-email-jianchao.w.wang@oracle.com (mailing list archive)
Headers show
Series small optimization for accessing queue map | expand

Message

jianchao.wang Jan. 24, 2019, 10:25 a.m. UTC
Hi Jens

These two patches are small optimization for accessing the queue mapping
in hot path. It saves the queue mapping results into blk_mq_ctx directly,
then we needn't do the complicated bounce on queue_hw_ctx[] map[] and
mq_map[].

Jianchao Wang (2)
blk-mq: save queue mapping result into ctx directly
blk-mq: save default hctx into ctx->hctxs

 block/blk-mq-sched.c |  2 +-
 block/blk-mq-tag.c   |  2 +-
 block/blk-mq.c       | 13 ++++++++++---
 block/blk-mq.h       | 20 +++++++++-----------
 block/blk.h          |  2 +-
 5 files changed, 22 insertions(+), 17 deletions(-)

Thanks
Jianchao

Comments

Jens Axboe Jan. 24, 2019, 6:08 p.m. UTC | #1
On 1/24/19 3:25 AM, Jianchao Wang wrote:
> Hi Jens
> 
> These two patches are small optimization for accessing the queue mapping
> in hot path. It saves the queue mapping results into blk_mq_ctx directly,
> then we needn't do the complicated bounce on queue_hw_ctx[] map[] and
> mq_map[].

I like this a lot, the current double indirect does suck, and it does show
up in profiles as well. I'll run some testing with this, thanks!
Jens Axboe Feb. 1, 2019, 3:34 p.m. UTC | #2
On 1/24/19 3:25 AM, Jianchao Wang wrote:
> Hi Jens
> 
> These two patches are small optimization for accessing the queue mapping
> in hot path. It saves the queue mapping results into blk_mq_ctx directly,
> then we needn't do the complicated bounce on queue_hw_ctx[] map[] and
> mq_map[].

Doing some targeted testing, the cycles wasted on the double indirect
are reclaimed with this. I've applied both for 5.1, thanks.