Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3844118imj; Tue, 12 Feb 2019 05:43:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IZHzkZCDMkthW/7r2KFZKISVQRoF08n9ANxwYFj65EUkQekt909f+dI7WX3084DAer0zbeD X-Received: by 2002:a17:902:9893:: with SMTP id s19mr4118160plp.165.1549978996501; Tue, 12 Feb 2019 05:43:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549978996; cv=none; d=google.com; s=arc-20160816; b=xJrPh+fCRIa3l7FqII9ssuxJFoYrB0c3faHY2kid+TaFcpteKvKnYt12Qklgj0lru2 hx032jXqRx/I2dMFtNRD1VXwmPFIIx2U0WQERltESKhaqNvgK9V1NoAXU88AZSLAhwvy 1BSMFic/X6CZPVHud8gik9pDbjdS7pIXYI3IYoD4ZRvcqc82HqBPqQBfs6Q16bC+4bIS 7Z1NFir3SqgT/bFz5v/8E8LCcwDYOYT3Cq/2/WJJWACCnSsasWzbJ8WL1xdr4jPjcoib oAb/bD0WCRqRIEZoP+tWoE45rOrLSQ0STk4DfCPuO64JcYD4LJyY+w6ruiETVlOnl9N5 QcNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=ywVnYGZ/Rud/QmVCTiSKyiX7vfT1RWDdSfyrbqlgNB8=; b=f1m1d2P8R5+O9tVVRs/oQe0F34sEmr19JoVea1+E6VLqsLh1x8aNQ3TkXFJ+ci95+I WcVKnYOSrOgn4Dqi3FsyS2ry5lTOaWX4q5sQaEBTe8lSNwsqWjzVqGoaIjMmQb7gu5GL jfqrCKmkqsW+USoEyrvGSqm+JPk2E7WJaK0naKX5ijk9eHXB5uU6pufy/Hrs9uWmBnD8 QbuRY0o0YWjDNN4lconRxtTC0ugTsbQmkp4SDyjsIysBJc8USEIPZmuEcBdregJRUTl7 zvQAPYabPMH0aPTET4+Th2WzbDsaXdIEqX6XWnJX9btjv6KAZNy+C8llisTDjqx8CA2R O5Mg== 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 w4si6344047pgk.465.2019.02.12.05.42.55; Tue, 12 Feb 2019 05:43:16 -0800 (PST) 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 S1729913AbfBLNmP (ORCPT + 99 others); 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