From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C856C282CE for ; Tue, 12 Feb 2019 13:42:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37C1121773 for ; Tue, 12 Feb 2019 13:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729917AbfBLNmP (ORCPT ); Tue, 12 Feb 2019 08:42:15 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:43385 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729887AbfBLNmP (ORCPT ); Tue, 12 Feb 2019 08:42:15 -0500 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gtYK4-00041t-Ol; Tue, 12 Feb 2019 14:42:04 +0100 Date: Tue, 12 Feb 2019 14:42:04 +0100 (CET) From: Thomas Gleixner To: Ming Lei cc: Christoph Hellwig , Bjorn Helgaas , Jens Axboe , linux-block@vger.kernel.org, Sagi Grimberg , linux-nvme@lists.infradead.org, LKML , linux-pci@vger.kernel.org, Keith Busch Subject: Re: [PATCH V2 0/4] genirq/affinity: add .calc_sets for improving IRQ allocation & spread In-Reply-To: <20190212130439.14501-1-ming.lei@redhat.com> Message-ID: References: <20190212130439.14501-1-ming.lei@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Feb 2019, Ming Lei wrote: > Hi, > > Currently pre-caculated set vectors are provided by driver for > allocating & spread vectors. This way only works when drivers passes > same 'max_vecs' and 'min_vecs' to pci_alloc_irq_vectors_affinity(), > also requires driver to retry the allocating & spread. > > As Bjorn and Keith mentioned, the current usage & interface for irq sets > is a bit awkward because the retrying should have been avoided by providing > one resonable 'min_vecs'. However, if 'min_vecs' isn't same with > 'max_vecs', number of the allocated vectors is unknown before calling > pci_alloc_irq_vectors_affinity(), then each set's vectors can't be > pre-caculated. > > Add a new callback of .calc_sets into 'struct irq_affinity' so that > driver can caculate set vectors after IRQ vector is allocated and > before spread IRQ vectors. Add 'priv' so that driver may retrieve > its private data via the 'struct irq_affinity'. > > > V2: > - add .calc_sets instead of .setup_affinity() which is easy to > be abused by drivers This looks really well done. If you can address the minor nitpicks, then this is good to go, unless someone has objections. Thanks, tglx