Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933062AbcJHCJ0 (ORCPT ); Fri, 7 Oct 2016 22:09:26 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:56870 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751425AbcJHCJU (ORCPT ); Fri, 7 Oct 2016 22:09:20 -0400 To: Linus Torvalds CC: "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" From: Jens Axboe Subject: [GIT PULL] blk-mq irq/cpu mapping updates Message-ID: Date: Fri, 7 Oct 2016 20:09:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E46A1E35ADB7677398403FBE" X-Originating-IP: [66.29.164.166] X-ClientProxiedBy: BY2PR06CA0065.namprd06.prod.outlook.com (10.166.106.161) To DM5PR15MB1195.namprd15.prod.outlook.com (10.173.209.13) X-MS-Office365-Filtering-Correlation-Id: f014505a-e97c-4b08-8c77-08d3ef201aa0 X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1195;2:pabaRtlXmh8f4jQ5H0zxX/PsTgPQDfMHsLwzs9FQxhdrRTYZcKEZjqhTk3LXj5s38aVB1I2lYB5vJP1aJqD7pcklsR3uFemWT7SpYj895zQWq/ITGMp3mr3AqqqFgRXFkBSFdQg6Yj8/1AWq+K1aUewECGFaCq5ME77+wFAOliVmEi6c1juoWv9OynOCd621;3:zQ/zgKqIxtyFXLIS774kA311ucMUI01gg9rL0/Agr191fghl/t4SGWh4Tzj2wiC3jZO9fGC1n1aELGOIks6dhWhrXrXznsCQxE5RuqJLn3szP8+HMyOUzNetnlRutX8l X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1195; X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1195;25:BjJvbyx2wXaP5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82erJGd0bxkSlHN7uQxiuyqW8UW4bTawlXNRMscjHEg34X7YpvCQ+yyvRejK4L0oRv300bB5SF/HjJU6x66wpWejcAbotq;20:X/meIR25uYIOgzOgJiRw6wxGJ1gQ3m0RKOngw+MGLAh1PHpdlHXPD1xMtcUqk1PNBvl4ykXhZDU44068+GCFRcXTzi/KrOOicP9v5m/JtdPgHtCb6I2t8N0eH5Ap+ygGnBIv3hDtTz3qSeOdtcEE9pKkiZhYM6iiI8SR7vhuVi8=;4:Fb+JwKx9af4OC5Oz3SQ6uIzvToXMAzu6ExtZ0+dlYTxOMnqQMPwqil6xCKt7OxnKwowVB0IWLdj19d2xonX68sNwvlU852T30GzU7CSnmunhtQY2AJ4zYlMCI9hMbpde5TLUowxSz3sK1LbfeEswjosHu9H/kqkfNNGctqZMe3s6qrM28X9/Qj27WMVG0Q2ULV5cfFEbUkOqPejagwv79q80+u+gQNmSy8mAJQxQ2MottqtwXKzBmUnJSSyyBiEd6gXUp0vH9VHPywahU600bQkqbJtxRyt5iJiihzmCJHZniH8nQip/T8QuxNRNhGLsj4R2qw2eyiLmdFzf12H647aHJ14I+qpEiIHpC9WOMSJZ8NyoJ7JDPT9dadXvhZ9G2nyzTJTgZe+PYd/codb3w3TjHJBeSnJKpnIVKlN8laAGkSgZVcoRbvHq5gMu24GyVpkJGKokiAuYJ2F4l8D7TA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(84791874153150); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(102415321)(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DM5PR15MB1195;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1195; X-Forefront-PRVS: 008960E8EC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(199003)(189002)(66066001)(50986999)(110136003)(65956001)(36756003)(65806001)(5660300001)(68736007)(101416001)(31686004)(512874002)(42186005)(19580395003)(81166006)(2906002)(31696002)(4001350100001)(7846002)(97736004)(5890100001)(64126003)(8676002)(117156001)(65826007)(4326007)(189998001)(77096005)(54356999)(2476003)(586003)(84326002)(81156014)(270700001)(92566002)(229853001)(4610100001)(6666003)(3846002)(6116002)(6916009)(7736002)(83506001)(568964002)(33646002)(86362001)(106356001)(105586002)(305945005);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1195;H:[192.168.1.176];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR15MB1195;23:EYPicUugBWgfq6ely4QvCGSKHDkJL3OXKVsWrVpwq?= =?us-ascii?Q?JSPsvxv/Uo8HTNMNkUsJDrO3JPCl3qTR/hMNiprTj89RX7s9Wv4iRWy4Hs7H?= =?us-ascii?Q?aPX8xwqLwgU8mCaMkqDkiitSsX5qZBobC2D/sJJt66cBmuYOvJXg2v1A1I7i?= =?us-ascii?Q?qKnKh3Te1GrvrfzW2lc3/bqf6uqQ/KML60kJ8+AbAAVN4LdV9srQ+HV0uZIK?= =?us-ascii?Q?Xk8JfQWl4QFJ40iSdlPYmlDzEYl/ABomyPnaXnKzW76lXKfX5jxhBat61nou?= =?us-ascii?Q?Sjv6W5eDVWb0epN6EOwIhEnsT41+XeVW5zouowXQs1LS0nabv7DfdI6FjVZR?= =?us-ascii?Q?i8JL/wsect64BBegQXZIuv+hliA4ZjxjFgISSw3DJBNNZiVmeDclF+sddAkU?= =?us-ascii?Q?jHb5vHSZhjKqDJ2Quy/0GIwD/8d2E3T+qs5vE8TLRMksu9amUKT5C7zgF9Vu?= =?us-ascii?Q?Ey5asOI/09J83LTCaQQGsuUWwXTKr3NpE2g2ZopT9zOpjAxPtY/5MRLZbBVr?= =?us-ascii?Q?KWZo1+U6+yvRxdwV9LpP5Eo7m8NeW9My2Bo8uPBUfc57mGpfzTJ3SqCYkYCc?= =?us-ascii?Q?mS8+Li/RxWP6JmtB+/ua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HfUQXhYOX9SWma0RxORiGBNYwDqcs7r9mRy//6HZkJz1qIfO/5pbvGjvGG1EjGATsk6TEF7jvHlBP7bRozhW6aZ0Iv80JCnUVk2r8vs/fTrO80YU4p1hbDt1iOJWJLULzjMzYAly85S90rYN/Rchd2lpGxkNqmLPqm+Ervtdpw=;5:Taq3A37+mEn0+gZYA10CtSi7kv03bxleZ0HZbFVJTD2/rPGY/L39vPtzxSnINybvZBYRYLCbAGat9yU7fD3KDCeehJGGwtr1cWfHKOhPhN6Kzp8CTtnkRs1RS8XIa3f2KxpyyrUxrsNXzfsQOoKLFw==;24:rxXEq97KkrYsxz4NYCzDwwdpRKPwX74nWgUswfz3l2kacCQPgKVFOBgkFGJlxQrxFb3FgU7IsMJ2qiIw1KBcLd3VBMqDBYEKiRrZm8hjYL4=;7:E8wPgK5SxmD2owlqMqWgMEwatTxnHfggCIcPpyGLBSQHxkBmWqQXZTa2+3gV4dKqbUTJg/208XWVPSlo+l5JCd0GY9CVqNZqdEgFnCq0Y1apn30WL+AjlS3ReGLcPs5fXF4+BRwCaDuU5qJm4HarKkE4ezZP7O/CnmrtEp6lKWuk22KiBnOZly/5clLkLUsChOrlLkpHLZ53XnsmgW8L1QtNUpNsKy4XHXNmNGhD3xyzAX8GtZM9BEZ0rACaWshEvObFqWBmHzhlZVr2u5PB50ZJyysvwyeoNxHZK4zygp5W3BpQ6xHvAA3A1kTqvLhU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1195;20:C8D+trEx29ePoZG0RsT/dIi8M63aFbE/BWcSGcm0UKMAurDwB10v5UhY7H/qfZ0snCE7IzNpUghdvEbTSGAZk4qYg3BH+a+syuLfBSg6iIrbdXm10LmyeSC6chzbkt++HO5AsKlQRG44hbkUIWGfD69eUGo4JgWWNVf/adO0KbI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2016 02:09:14.8155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1195 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-07_11:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5410 Lines: 157 --------------E46A1E35ADB7677398403FBE Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Hi Linus, This is the block-irq topic branch for 4.9-rc. It's mostly from Christoph, and it allows drivers to specify their own mappings, and more importantly, to share the blk-mq mappings with the IRQ affinity mappings. It's a good step towards making this work better out of the box. This will throw a few merge conflicts with later patches in the main branch that you already pulled. I kept this a private branch due to the pci dependencies. I have attached the diff of how I resolved it, just in case. Please pull! git://git.kernel.dk/linux-block.git for-4.9/block-irq ---------------------------------------------------------------- Christoph Hellwig (8): blk-mq: don't redistribute hardware queues on a CPU hotplug event blk-mq: only allocate a single mq_map per tag_set blk-mq: remove ->map_queue blk-mq: allow the driver to pass in a queue mapping blk-mq: provide a default queue mapping for PCI device nvme: switch to use pci_alloc_irq_vectors nvme: remove the post_scan callout blk-mq: get rid of the cpumask in struct blk_mq_tags Jens Axboe (2): Merge branch 'irq/for-block' of git://git.kernel.org/.../tip/tip into for-4.9/msi-irq blk-mq: kill unused blk_mq_create_mq_map() Stephen Rothwell (1): blk_mq: linux/blk-mq.h does not include all the headers it depends on Documentation/block/biodoc.txt | 4 +- block/Kconfig | 5 + block/Makefile | 2 +- block/bio.c | 2 +- block/blk-core.c | 16 +- block/blk-flush.c | 6 +- block/blk-mq-cpumap.c | 25 +-- block/blk-mq-pci.c | 47 +++++ block/blk-mq-sysfs.c | 15 +- block/blk-mq-tag.c | 11 +- block/blk-mq-tag.h | 1 - block/blk-mq.c | 117 +++++------ block/blk-mq.h | 10 +- block/blk.h | 11 +- drivers/block/loop.c | 1 - drivers/block/mtip32xx/mtip32xx.c | 3 +- drivers/block/nbd.c | 411 +++++++++++++++----------------------- drivers/block/null_blk.c | 1 - drivers/block/rbd.c | 1 - drivers/block/virtio_blk.c | 1 - drivers/block/xen-blkfront.c | 1 - drivers/md/dm-crypt.c | 2 +- drivers/md/dm-rq.c | 1 - drivers/mtd/ubi/block.c | 1 - drivers/nvme/host/core.c | 3 - drivers/nvme/host/nvme.h | 1 - drivers/nvme/host/pci.c | 109 ++++------ drivers/nvme/host/rdma.c | 2 - drivers/nvme/target/loop.c | 2 - drivers/scsi/scsi_lib.c | 1 - fs/befs/linuxvfs.c | 2 +- fs/block_dev.c | 11 +- fs/btrfs/inode.c | 5 +- include/linux/bio.h | 2 - include/linux/blk-mq-pci.h | 9 + include/linux/blk-mq.h | 26 ++- include/linux/blk_types.h | 21 +- include/linux/blkdev.h | 4 +- include/linux/ioprio.h | 1 - include/linux/workqueue.h | 1 + kernel/workqueue.c | 40 ++-- 41 files changed, 429 insertions(+), 506 deletions(-) create mode 100644 block/blk-mq-pci.c create mode 100644 include/linux/blk-mq-pci.h -- Jens Axboe --------------E46A1E35ADB7677398403FBE Content-Type: text/x-patch; name="block-irq-resolve.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="block-irq-resolve.patch" diff --cc block/blk-mq-tag.c index cef618f6fc92,2eae3d5f7145..000000000000 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@@ -412,9 -673,8 +406,8 @@@ struct blk_mq_tags *blk_mq_init_tags(un void blk_mq_free_tags(struct blk_mq_tags *tags) { - bt_free(&tags->bitmap_tags); - bt_free(&tags->breserved_tags); + sbitmap_queue_free(&tags->bitmap_tags); + sbitmap_queue_free(&tags->breserved_tags); - free_cpumask_var(tags->cpumask); kfree(tags); } diff --cc block/blk-mq-tag.h index 09f4cc0aaa84,556964134d1c..000000000000 --- a/block/blk-mq-tag.h +++ b/block/blk-mq-tag.h @@@ -17,8 -42,8 +17,6 @@@ struct blk_mq_tags struct request **rqs; struct list_head page_list; -- - cpumask_var_t cpumask; - int alloc_policy; }; diff --cc block/blk-mq.c index dc5f47f60931,f1c5263c44e8..000000000000 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@@ -224,11 -245,21 +224,11 @@@ struct request *blk_mq_alloc_request(st return ERR_PTR(ret); ctx = blk_mq_get_ctx(q); - hctx = q->mq_ops->map_queue(q, ctx->cpu); + hctx = blk_mq_map_queue(q, ctx->cpu); blk_mq_set_alloc_data(&alloc_data, q, flags, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw, 0); - if (!rq && !(flags & BLK_MQ_REQ_NOWAIT)) { - __blk_mq_run_hw_queue(hctx); - blk_mq_put_ctx(ctx); - - ctx = blk_mq_get_ctx(q); - hctx = blk_mq_map_queue(q, ctx->cpu); - blk_mq_set_alloc_data(&alloc_data, q, flags, ctx, hctx); - rq = __blk_mq_alloc_request(&alloc_data, rw, 0); - ctx = alloc_data.ctx; - } blk_mq_put_ctx(ctx); + if (!rq) { blk_queue_exit(q); return ERR_PTR(-EWOULDBLOCK); --------------E46A1E35ADB7677398403FBE--