From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753670AbbDHDUv (ORCPT ); Tue, 7 Apr 2015 23:20:51 -0400 Received: from smtpbgbr1.qq.com ([54.207.19.206]:56200 "EHLO smtpbgbr1.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbbDHDUu (ORCPT ); Tue, 7 Apr 2015 23:20:50 -0400 X-QQ-mid: bizesmtp8t1428463231t588t122 X-QQ-SSF: 00100000002000F0F342B00A0000000 X-QQ-FEAT: Oab6VyED0GpeOdSsetaD2mS4n9dGDIcHgR6ZPJFkLTR3QBYPwsNR1jKrLbNAK aLC0YwdZc+aX8NfKI+FHF9J2ISPAQVG3+co2bMJgrCMnxcU3oefpfPOiTn4sNbw3vsZj1PF DxqFbD8SRoDqRevEwo+LqdYF795qVTOymXL/dE3/oJ2k4FtURM3rtXMHYY5Vb4v0gdgBIG5 r5EUoQKevjEBneclcmmk5gpP7NMT9Lmc= X-QQ-GoodBg: 0 Message-ID: <55249ED9.3050605@memblaze.com> Date: Wed, 08 Apr 2015 11:22:01 +0800 From: Chong Yuan User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: nimisolo CC: axboe , linux-kernel Subject: Re: blk-mq : blk_mq_map_swqueue maybe References: <806c215d-fd17-471d-96a7-9c083b9fe7db@aliyun.com> In-Reply-To: <806c215d-fd17-471d-96a7-9c083b9fe7db@aliyun.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nimisolo, 在 4/8/2015 10:10 AM, nimisolo 写道: > Hi Jens, > > In blk_mq_map_swqueue(), all the blk_mq_hw_ctx's nr_ctx are set > to zero, and then each blk_mq_ctx's index_hw is set to nr_ctx. > I think the index_hw means the index of the hardware queue that map > to this software queue, so maybe index_hw should be set to > blk_mq_hw_ctx's queue_num. Multiple sw queues may be dispatched to one hw queue. So index_hw here means the index of the sw queue in corresponding hw queue. --yc > > I'm a student and I probably have misunderstood this code, please help > me to resolve this confusion. Thank you. > > static void blk_mq_map_swqueue(struct request_queue *q) > { > ......... > queue_for_each_hw_ctx(q, hctx, i) { > ......... > hctx->nr_ctx = 0; > } > ......... > queue_for_each_ctx(q, ctx, i) { > ......... > ctx->index_hw = hctx->nr_ctx; > ......... > } > } > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >