Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5026131imd; Tue, 30 Oct 2018 10:48:40 -0700 (PDT) X-Google-Smtp-Source: AJdET5dL2WvNlbOXiv09qZLl9hSutyFG9MP4JQy6QWhOAs22M24g6rY/cE8o59SLORobgjG90XJp X-Received: by 2002:a17:902:7c0b:: with SMTP id x11-v6mr19477130pll.60.1540921720419; Tue, 30 Oct 2018 10:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540921720; cv=none; d=google.com; s=arc-20160816; b=cRUjYe+zX6uAH7Gy4O6oSBnc9GP76E08al9e7T54jnT5XddCC2o67PyDDpB9bXK4VH 47opGJwaB85p7Z9rbQma2cZmWQ/yt2lQWAEwGs09lPKyyWxkHW4Vyhx/8y1wiIK0itki 6o3KeVz4WuDTCyfTL+aRluPUYrWCMy7NDh0LInx1DCIVih5ruugXks4816kJtTp1ZOLc QHSw6/HFjwuPFCG5/Z3s8cwGvWDh2nW+qeJ/ExheADCtcZEOcUuDesDmyHNGMh0VCg1I dICw0Dmk8wnzb8asl6W2Y0Y0xOj0H1BBJ8hoR2G2TfKbXQThxl66kOmE0q92cDjTGRp2 WPAQ== 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=bULrKZ9WQhM3b8pvUBc/V/8VZhMLTT3cc6NGa2CmenM=; b=B1hsfP72jkTpEMdDZGA2or0VTSMq142wcYxJ94gAUuRvPJhxsXwq0N3n51opMrqeR1 cRULohjoV7BbHNHf/aysJGJgDUsdlv65L/ZX8ubu1vLHp5O33tB0q6OT1buBvVKaST4r 2ejh91RHummwvtRTjI/Wvx2SSFecOOwEh7DVArPpdM0QbaHRP65fR/T7ruSWX3YuMFkU G3ChXD9xK6CVSXKXbKs02gmUGRKB7m93uqhjIvrLutqvmulXTzYtkzBYQWb0BM7vnYP6 HMV/BwYXLxcATi+6mtBj024Fkr/awNGnlCl7xVOIhxqSyvXmb/QfwpG7D3uARr2dVRCD wYvQ== 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 a6-v6si25548306pln.78.2018.10.30.10.48.23; Tue, 30 Oct 2018 10:48:40 -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 S1728014AbeJaCkl (ORCPT + 99 others); Tue, 30 Oct 2018 22:40:41 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:54471 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727679AbeJaCkl (ORCPT ); Tue, 30 Oct 2018 22:40:41 -0400 Received: from tmo-115-37.customers.d1-online.com ([80.187.115.37] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gHY5g-0003zq-5j; Tue, 30 Oct 2018 18:46:08 +0100 Date: Tue, 30 Oct 2018 18:46:06 +0100 (CET) From: Thomas Gleixner To: Jens Axboe cc: Keith Busch , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/14] irq: add support for allocating (and affinitizing) sets of IRQs In-Reply-To: Message-ID: References: <20181029163738.10172-1-axboe@kernel.dk> <20181029163738.10172-12-axboe@kernel.dk> <20181030142601.GA18906@localhost.localdomain> <20181030144527.GB18906@localhost.localdomain> <46dbcbcd-799f-9970-a68f-de7e96b1a6bb@kernel.dk> <20181030150840.GC18906@localhost.localdomain> <20181030160242.GD18906@localhost.localdomain> <27c1017a-9560-80cb-038d-f64727a162c3@kernel.dk> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Oct 2018, Jens Axboe wrote: > On 10/30/18 11:25 AM, Thomas Gleixner wrote: > > Jens, > > > > On Tue, 30 Oct 2018, Jens Axboe wrote: > >> On 10/30/18 10:02 AM, Keith Busch wrote: > >>> pci_alloc_irq_vectors_affinity() starts at the provided max_vecs. If > >>> that doesn't work, it will iterate down to min_vecs without returning to > >>> the caller. The caller doesn't have a chance to adjust its sets between > >>> iterations when you provide a range. > >>> > >>> The 'masks' overrun problem happens if the caller provides min_vecs > >>> as a smaller value than the sum of the set (plus any reserved). > >>> > >>> If it's up to the caller to ensure that doesn't happen, then min and > >>> max must both be the same value, and that value must also be the same as > >>> the set sum + reserved vectors. The range just becomes redundant since > >>> it is already bounded by the set. > >>> > >>> Using the nvme example, it would need something like this to prevent the > >>> 'masks' overrun: > >> > >> OK, now I hear what you are saying. And you are right, the callers needs > >> to provide minvec == maxvec for sets, and then have a loop around that > >> to adjust as needed. > > > > But then we should enforce it in the core code, right? > > Yes, I was going to ask you if you want a followup patch for that, or > an updated version of the original? Updated combo patch would be nice :) Thanks lazytglx