From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 01/14] blk-mq: kill q->mq_map To: Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org References: <20181025211626.12692-1-axboe@kernel.dk> <20181025211626.12692-2-axboe@kernel.dk> <2357b785-6730-fb02-f7fb-9f4a230a00ea@kernel.dk> From: "jianchao.wang" Message-ID: Date: Mon, 29 Oct 2018 10:02:32 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 List-ID: Hi Jens On 10/28/18 12:52 AM, Jens Axboe wrote: > On 10/27/18 10:48 AM, Jens Axboe wrote: >> On 10/27/18 8:19 AM, jianchao.wang wrote: >>> Hi Jens >>> >>> On 10/26/18 5:16 AM, Jens Axboe wrote: >>>> It's just a pointer to set->mq_map, use that instead. >>> Instead of using the set->mq_map and then a two-dimensional set->mq_map, >>> how about migrate the mq_map from per-set to per-cpuctx ? >>> something like: >>> q->queue_hw_ctx[ctx->map[type]] >> >> I think the current series is pretty clean in that regard, it goes >> from members -> map -> map array. I'd be willing to look at a >> conversion on top of that, if it makes things cleaner. > > On top of that, this: > > q->queue_hw_ctx[set->map[type].mq_map[cpu]] > > is one less pointer dereference, so more efficient. > Saving the blk_mq_hw_ctx into blk_mq_ctx direclty maybe more direct and efficient. something like, ctx->map_hctxs[type] all of the memory accessing is local. What we need to pay for this is do mapping for every request_queue. Thanks Jianchao From mboxrd@z Thu Jan 1 00:00:00 1970 From: jianchao.w.wang@oracle.com (jianchao.wang) Date: Mon, 29 Oct 2018 10:02:32 +0800 Subject: [PATCH 01/14] blk-mq: kill q->mq_map In-Reply-To: References: <20181025211626.12692-1-axboe@kernel.dk> <20181025211626.12692-2-axboe@kernel.dk> <2357b785-6730-fb02-f7fb-9f4a230a00ea@kernel.dk> Message-ID: Hi Jens On 10/28/18 12:52 AM, Jens Axboe wrote: > On 10/27/18 10:48 AM, Jens Axboe wrote: >> On 10/27/18 8:19 AM, jianchao.wang wrote: >>> Hi Jens >>> >>> On 10/26/18 5:16 AM, Jens Axboe wrote: >>>> It's just a pointer to set->mq_map, use that instead. >>> Instead of using the set->mq_map and then a two-dimensional set->mq_map, >>> how about migrate the mq_map from per-set to per-cpuctx ? >>> something like: >>> q->queue_hw_ctx[ctx->map[type]] >> >> I think the current series is pretty clean in that regard, it goes >> from members -> map -> map array. I'd be willing to look at a >> conversion on top of that, if it makes things cleaner. > > On top of that, this: > > q->queue_hw_ctx[set->map[type].mq_map[cpu]] > > is one less pointer dereference, so more efficient. > Saving the blk_mq_hw_ctx into blk_mq_ctx direclty maybe more direct and efficient. something like, ctx->map_hctxs[type] all of the memory accessing is local. What we need to pay for this is do mapping for every request_queue. Thanks Jianchao