Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3675984imd; Mon, 29 Oct 2018 10:34:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5eWc5GzxDhAYMFyBfMjfB7ABPh52QF/z0dWHpIehOiDdLtnWjWX7oAW+zyCM7VTKimHc4SO X-Received: by 2002:a63:88c7:: with SMTP id l190mr14436201pgd.110.1540834488330; Mon, 29 Oct 2018 10:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540834488; cv=none; d=google.com; s=arc-20160816; b=iypo1dGQdExv5+tu8el/SGlObrDGsQkJ7rIROMRUxqGS9exalYQEMhPJdGZBQqX1cS hVLxt3ewAalKiM9BZS1ivRt+z35jRqr/d0xIEhg5aJ+qjrU41+ig/8JYvtlb4+vN7WWY Lb6Aw6a070pQBXByQX1a2dsU65OZ+2uH8kg4vDTMHJwk1qacgx1bCtz1k9mTphPEUQlL oIfmynAfYhu8nTSfr1kwcYan+hB8PMO0cekqqIgTSvtyk+6PY9flbqiO0qS5sk7MMQg9 g+LCMpYi5S5/ohCuLKs1fvu2iy2rAcur4m903tbTUtPO4/fO/lVPjOSj1sRZw14y+pHX Ig+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=ZbubRYa/8fy+0yJxd9+y45LroD/J4+JL9RC6O2OzP8w=; b=OW1wJmvgTAKuNVqaY9OQWXwS+D1dKlbqK9dB8TBLnsuUP+TTHh797ul/I6wCX3pfy9 n/zKRaZHEaaTlk4pLw5wrp6tMf5LHokSBEOPad/4GIkk4UvymHxWyck6Ny2Pi6e3Bx9d A7eymhqp4LS+xGSURZBj2wyzLv4aXOw4ZagZDTrwdK0ni1h39FuLjkLJWpxrXN6TTz/b VN8/dSYQjSYdyK4wvHREwGYCphdEzbLX45y9XoUZv6rlabwytbxw8SfvVnu1x4RBRvhe bYZs1f+HWSAHJNEKpMVNwedbnpjMa75NKXRh5llPAY8RTdYCFmeqnHy6DWkkI+xNO7Rf IfaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=K3uh3lHZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si20791681pgn.108.2018.10.29.10.34.31; Mon, 29 Oct 2018 10:34:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=K3uh3lHZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727450AbeJ3CXL (ORCPT + 99 others); Mon, 29 Oct 2018 22:23:11 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39741 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbeJ3CXK (ORCPT ); Mon, 29 Oct 2018 22:23:10 -0400 Received: by mail-io1-f66.google.com with SMTP id n11-v6so5497505iob.6 for ; Mon, 29 Oct 2018 10:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ZbubRYa/8fy+0yJxd9+y45LroD/J4+JL9RC6O2OzP8w=; b=K3uh3lHZN0OE4CM1dCqWmJIB9hkipycO+/JsiXdLVrp5RwvFVrOVuE1nvQA2bDf2Hq Ci3HBPIcKwfbaBDZ5sBUaiSA2ZIP+MNQIKXj/aQMziSDPDvkeTa4TKYn/hb9uLJ6Fd15 1RhHw3yHVJurQ+Mt2NrDWz5F5XRkGTpgk0vFO6prcIbmbeaPnY3RkPS1OunYN4x7jhuS 1CYaaV77/YqRKlXbTTK6zkyks+VjlZUaQU1cOTGJoe9uuE4GdYH/hA+BGjhUxXjykXrs +YHUmPm46eg1mRCxWYNTAjtE6P/3mqWBAr5CcT6Rh4S44VFTqD5o8Zv0jRmc5HywyaZ5 npUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZbubRYa/8fy+0yJxd9+y45LroD/J4+JL9RC6O2OzP8w=; b=CZGpM1GZ5CLuDRbwtXjLPF88I2snwexTda9Lqdba+rT6p3zQ2rDQ2kwHd7TkgGC1pO pZk+HMfJWRIrPwCxVcqPDvq3mUKsj5C2h/ye1xnOlTo3SUZ4SZ6Y/TQTRWk+K/UKcS2S sX31okkqItLWqPffQTp2GTLvzlKHmQ0YC/+yPrsHOpTHcsAYkIa0UJBy20raTq8+GfIM DtNcYwWXM3xDqAqRBryOVd80xeQSpY8eErJjyrWJzbnurgyztfGtWnrffM1l8KQY9V2v CnguxLTr91RaINy9hG6QRtC2wRwQO9EbFJxe0rS26B61DfXjhXgewIqbrlhZhfF24/Hr Akdw== X-Gm-Message-State: AGRZ1gJvvzpLKZqNLAclkni2n8DPRQO+Ixv/xNcTYTJ/aWjumVAYJsDS U6sTYyjVMVQNBG0/mynPteuzE/Tp5Jk= X-Received: by 2002:a6b:c6d1:: with SMTP id w200-v6mr8858646iof.79.1540834414936; Mon, 29 Oct 2018 10:33:34 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id n2-v6sm6738920iog.75.2018.10.29.10.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 10:33:33 -0700 (PDT) Subject: Re: [PATCH 04/14] blk-mq: pass in request/bio flags to queue mapping To: Bart Van Assche , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181029163738.10172-1-axboe@kernel.dk> <20181029163738.10172-5-axboe@kernel.dk> <1540834236.196084.61.camel@acm.org> From: Jens Axboe Message-ID: <9b61eab8-0289-2127-5529-4f599fb1da24@kernel.dk> Date: Mon, 29 Oct 2018 11:33:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1540834236.196084.61.camel@acm.org> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/29/18 11:30 AM, Bart Van Assche wrote: > On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: >> @@ -400,9 +402,15 @@ void blk_mq_sched_insert_requests(struct request_queue *q, >> struct blk_mq_ctx *ctx, >> struct list_head *list, bool run_queue_async) >> { >> - struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, ctx->cpu); >> - struct elevator_queue *e = hctx->queue->elevator; >> + struct blk_mq_hw_ctx *hctx; >> + struct elevator_queue *e; >> + struct request *rq; >> + >> + /* For list inserts, requests better be on the same hw queue */ >> + rq = list_first_entry(list, struct request, queuelist); >> + hctx = blk_mq_map_queue(q, rq->cmd_flags, ctx->cpu); > > Passing all request cmd_flags bits to blk_mq_map_queue() makes it possible > for that function to depend on every single cmd_flags bit even if different > requests have different cmd_flags. Have you considered to pass the hw_ctx > type only to blk_mq_map_queue() to avoid that that function would start > depending on other cmd_flags? The core only knows about the number of types, not what each type means nor how to map it outside of using the mapping functions. So I don't want to expose this is an explicit type, as that would then mean that blk-mq had to know about them. > Additionally, what guarantees that all requests in queuelist have the same > hw_ctx type? If a later patch will guarantee that, please mention that in > the comment about list_first_entry(). When the code is introduced, it's always the same hctx. Later on when we do support multiple sets, the user of the list insert (plugging) explicitly makes sure that a list only contains requests for the same hardware queue. I'll improve the comment. -- Jens Axboe