Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3720812imd; Mon, 29 Oct 2018 11:15:53 -0700 (PDT) X-Google-Smtp-Source: AJdET5cSta+DTRTzgrW8zKAFNl4I5EYrhIGtQPNy/GBd9829vzdpEIybFYyMNWVEcQ1JACTuE452 X-Received: by 2002:a17:902:1ab:: with SMTP id b40-v6mr15554245plb.82.1540836953603; Mon, 29 Oct 2018 11:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540836953; cv=none; d=google.com; s=arc-20160816; b=H4W74t1E97fgpFo3jCMkCYDdRwYPY6thfLr35B/hBBrercNxtWQZ+GkSmK3UNMMxPO mHOWM3j0gNiJHs1Au3Rs5Qpjj9WN+XXgWZ5Zlif3P/n4UbIW8h/VmB3dvMt3uwpnJBGH 0gDCMaJzyezgXDuuuC3OikLq4+ypLW88tQBO8rNcLnZJH9DltxhAXJOhKEWhPAYrgBHU u5hbXj7HnJzXQlY5SnDPs4p/Zy6LR2ji5lqoivCMU80dq5ph6W52lMjk+Ro48+fNFp6C YjbsL3a9v/vZ3vHoBYupg9klBV2DHgMm/RRO/Ie8MWliTrlAm19S+tfHPQsf9xUtSytB mr1A== 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:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=nJC0NNPKN/Uv1V6q9cs49qJxbI0zyIuZrqxHAYI0mSU=; b=ArypdyPLsErAK+fqlfkh93ehCxnXkRZyzLQ9Vlqbc48mc7epc5iVC8/US4Bf+KGIvM oClD+Qc4pUHBNe0bGVpLSj9ZqZhYODgoBoi1mJiHmD3BqBVz39EyvIxVksj7dYWvECrh uo9ybMMiRl3rWtqgHAiQuPeYyN+WIpku2dni7WlIX7QmBnDuzaaw/TrnwdfEH9Kqn+Z6 O/H30P0ZHijmcl4fkAemfX/vUBE17fgQ26yZiHqUB70STODOmZcUKVmk90qpagQzi98p V9s130h62IJeN+waJVZSTi6aKVvutYaIr5DXXeKqgL7AlHhPQBN2attX4veZKdnI5XVU cOSw== ARC-Authentication-Results: i=1; mx.google.com; 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 c126-v6si9112077pfg.215.2018.10.29.11.15.37; Mon, 29 Oct 2018 11:15:53 -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; 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 S1728742AbeJ3DEw (ORCPT + 99 others); Mon, 29 Oct 2018 23:04:52 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36205 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbeJ3DEw (ORCPT ); Mon, 29 Oct 2018 23:04:52 -0400 Received: by mail-pf1-f196.google.com with SMTP id j22-v6so623008pfh.3; Mon, 29 Oct 2018 11:15:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=nJC0NNPKN/Uv1V6q9cs49qJxbI0zyIuZrqxHAYI0mSU=; b=QxiYQIV63br1mR2LUr0c6D/Q+RwpTn0VBOHn0bBMpq9SqQ4AsVJy7iW+ZNmZQ0yD5V UZcgEVMAgPril46EscwqDcO/2gNzseufF70jR6qlkTxHyt7ND2XEZyIrsFhz2+RBImA6 ynE0IpJS08M50EWR1YspbjMFbbRmf4p7PL4oiOIbT6Kfm8LwJL7RhFAp9CdAt7lAmlii sqi9+jiF7lOXzwlrvEcNOgQTTcpY6UjERNa7SFmCmktsgmL24GoxBReuOdeKmPOFN5cl pgbXmC5YpNufpZSqzD36IE2pOLB4pFg18kzMsp/TO27mIaoLR3Suv9GS83/MIqRBJEQd 3dwg== X-Gm-Message-State: AGRZ1gJkI7ljrF5U6BeyyFTOX4yg5C9t/MVDVW8rKMDL4S4mIuVrSkDq +Mdj7Zn8Sy0ODqiv69uSC8VUrrUe X-Received: by 2002:a63:bd51:: with SMTP id d17mr4132675pgp.443.1540836906129; Mon, 29 Oct 2018 11:15:06 -0700 (PDT) Received: from ?IPv6:2620:15c:2cd:203:5cdc:422c:7b28:ebb5? ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id o9-v6sm28511626pgn.30.2018.10.29.11.15.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 11:15:04 -0700 (PDT) Message-ID: <1540836903.196084.70.camel@acm.org> Subject: Re: [PATCH 07/14] blk-mq: support multiple hctx maps From: Bart Van Assche To: Jens Axboe , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 29 Oct 2018 11:15:03 -0700 In-Reply-To: <20181029163738.10172-8-axboe@kernel.dk> References: <20181029163738.10172-1-axboe@kernel.dk> <20181029163738.10172-8-axboe@kernel.dk> Content-Type: text/plain; charset="UTF-7" X-Mailer: Evolution 3.26.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: +AD4 -static inline struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-blk+AF8-mq+AF8-map+AF8-queue(struct request+AF8-queue +ACo-q, +AD4 - unsigned int flags, +AD4 - int cpu) +AD4 +-static inline struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-blk+AF8-mq+AF8-map+AF8-queue+AF8-type(struct request+AF8-queue +ACo-q, +AD4 +- int type, int cpu) +AD4 +AHs +AD4 struct blk+AF8-mq+AF8-tag+AF8-set +ACo-set +AD0 q-+AD4-tag+AF8-set+ADs +AD4 +AD4 - return q-+AD4-queue+AF8-hw+AF8-ctx+AFs-set-+AD4-map+AFs-0+AF0.mq+AF8-map+AFs-cpu+AF0AXQA7 +AD4 +- return q-+AD4-queue+AF8-hw+AF8-ctx+AFs-set-+AD4-map+AFs-type+AF0.mq+AF8-map+AFs-cpu+AF0AXQA7 +AD4 +AH0 +AD4 +AD4 -static inline struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-blk+AF8-mq+AF8-map+AF8-queue+AF8-type(struct request+AF8-queue +ACo-q, +AD4 - int type, int cpu) +AD4 +-static inline struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-blk+AF8-mq+AF8-map+AF8-queue(struct request+AF8-queue +ACo-q, +AD4 +- unsigned int flags, +AD4 +- int cpu) +AD4 +AHs +AD4 - return blk+AF8-mq+AF8-map+AF8-queue(q, type, cpu)+ADs +AD4 +- int type +AD0 0+ADs +AD4 +- +AD4 +- if (q-+AD4-mq+AF8-ops-+AD4-flags+AF8-to+AF8-type) +AD4 +- type +AD0 q-+AD4-mq+AF8-ops-+AD4-flags+AF8-to+AF8-type(q, flags)+ADs +AD4 +- +AD4 +- return blk+AF8-mq+AF8-map+AF8-queue+AF8-type(q, type, cpu)+ADs +AD4 +AH0 How about adding a comment above both these functions that explains their purpose? Since blk+AF8-mq+AF8-map+AF8-queue() maps rq-+AD4-cmd+AF8-flags and the cpu index to a hardware context, how about renaming blk+AF8-mq+AF8-map+AF8-queue() into blk+AF8-mq+AF8-map+AF8-cmd+AF8-flags()? +AD4 /+ACo +AD4 diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h +AD4 index f9e19962a22f..837087cf07cc 100644 +AD4 --- a/include/linux/blk-mq.h +AD4 +-+-+- b/include/linux/blk-mq.h +AD4 +AEAAQA -86,6 +-86,7 +AEAAQA enum +AHs +AD4 +AD4 struct blk+AF8-mq+AF8-tag+AF8-set +AHs +AD4 struct blk+AF8-mq+AF8-queue+AF8-map map+AFs-HCTX+AF8-MAX+AF8-TYPES+AF0AOw +AD4 +- unsigned int nr+AF8-maps+ADs +AD4 const struct blk+AF8-mq+AF8-ops +ACo-ops+ADs +AD4 unsigned int nr+AF8-hw+AF8-queues+ADs +AD4 unsigned int queue+AF8-depth+ADs /+ACo max hw supported +ACo-/ +AD4 +AEAAQA -109,6 +-110,7 +AEAAQA struct blk+AF8-mq+AF8-queue+AF8-data +AHs +AD4 +AD4 typedef blk+AF8-status+AF8-t (queue+AF8-rq+AF8-fn)(struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo, +AD4 const struct blk+AF8-mq+AF8-queue+AF8-data +ACo)+ADs +AD4 +-typedef int (flags+AF8-to+AF8-type+AF8-fn)(struct request+AF8-queue +ACo, unsigned int)+ADs How about adding a comment that the format of the second argument of flags+AF8-to+AF8-type+AF8-fn is the same as that of rq-+AD4-cmd+AF8-flags? Thanks, Bart.