From patchwork Fri Jan 25 09:53:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10780875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 050301399 for ; Fri, 25 Jan 2019 09:54:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E92BB2C6E0 for ; Fri, 25 Jan 2019 09:54:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCE892C792; Fri, 25 Jan 2019 09:54:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96D052C6E0 for ; Fri, 25 Jan 2019 09:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbfAYJyE (ORCPT ); Fri, 25 Jan 2019 04:54:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727975AbfAYJyE (ORCPT ); Fri, 25 Jan 2019 04:54:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E81787F6B0; Fri, 25 Jan 2019 09:54:03 +0000 (UTC) Received: from localhost (ovpn-8-28.pek2.redhat.com [10.72.8.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A7D160F93; Fri, 25 Jan 2019 09:53:58 +0000 (UTC) From: Ming Lei To: Christoph Hellwig , Bjorn Helgaas , Thomas Gleixner Cc: Jens Axboe , linux-block@vger.kernel.org, Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Ming Lei Subject: [PATCH 0/5] genirq/affinity: introduce .setup_affinity to support allocating interrupt sets Date: Fri, 25 Jan 2019 17:53:42 +0800 Message-Id: <20190125095347.17950-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 25 Jan 2019 09:54:04 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, The current support for allocating interrupt sets requires that same 'max_vec' and 'min_vec' is passed to pci_alloc_irq_vectors_affinity(), then driver has to try to allocate again and again until it succeeds. This patch introduces .setup_affinity callback, and we can use it to re-caculate interrupt sets and build affinity for each set after irq vectors are allocated. Turns out both genirq/affinity and nvme code get simplified a lot. Please review and comment! Ming Lei (5): genirq/affinity: move allocation of 'node_to_cpumask' to irq_build_affinity_masks genirq/affinity: allow driver to setup managed IRQ's affinity genirq/affinity: introduce irq_build_affinity() nvme-pci: simplify nvme_setup_irqs() via .setup_affinity callback genirq/affinity: remove support for allocating interrupt sets drivers/nvme/host/pci.c | 97 +++++++++++++++++++++-------------------- drivers/pci/msi.c | 14 ------ include/linux/interrupt.h | 42 ++++++++++++------ kernel/irq/affinity.c | 108 ++++++++++++++++++++++++---------------------- 4 files changed, 133 insertions(+), 128 deletions(-)