Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5026766imd; Tue, 30 Oct 2018 10:49:21 -0700 (PDT) X-Google-Smtp-Source: AJdET5ej7IJ6FZcpexOFHtG826j1kGfjsU5qiCKgysNgtmJj4oVpX8xBbbsMduPOfEi1FIM0mU6r X-Received: by 2002:a17:902:b709:: with SMTP id d9-v6mr379462pls.199.1540921761351; Tue, 30 Oct 2018 10:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540921761; cv=none; d=google.com; s=arc-20160816; b=JOWMt6Mg403fVhl8ptdU4rGCb7queS/NYGFsZm6tJsXVnCQgHJI74fG8soerD6yQMl Kf3opUGhR7oMpNoJR7jrj+El25TbQRD9yoTj7h020xk7OWJhCqvp72SeKObi9yl8Gxpm 0skKHInk50dFwSpBi/kCLexMbidJ6HRY9wDzb9rCZf4c+bM6vMhtYQcvmiFrdNCPgMy6 NmtsApBQReO5NuP17huYwVYbwequhbQVqSXlDJFDUfvGX555c3OdrR7SnHrGL9/ZJM0e EzU8EdPvex6dnRSX8Lk/GJ9oGFPbIRbCcdd4gMfIyQOL+gQDwq+lUb0e/jr/WNATCt8p 5skQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=qab+1aQJJivRwfWtN9pbYqgppFr9e/VfqfU0ts1atXE=; b=EoVRohnRKRPG95Cf78+oWkrJ4CRccBMkjRzzuQ1ychv8p/1gkkWRkZRyQX1DDMC626 9ETMM9isQEW6Oq3s3Fom/ym64/yiWblpBQ5z6ll4wTOAJIXSTM6boxq+FzCumlA5OHG1 mHwp3Z2rQrz6xVeg+iDfzB8vzPBKDrUspABamBF2Pf7yEXSob83002zLtKtr5F+yxPaE qCJTsq7vAXsJwLaLAcoIzNund/iXRuKnvpZkktML43JV5l8k4Qj4bBbV6Ncy10O77Yig Pz3bt6Ch0oSsgA/sgU5O4UfmOKawUO7z+oUlly81L5y5HB+d870lniMKqCuijr0fQPz3 J2vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=bdLqLOwP; 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 91-v6si25074343ply.48.2018.10.30.10.49.05; Tue, 30 Oct 2018 10:49:21 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=bdLqLOwP; 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 S1728027AbeJaCmK (ORCPT + 99 others); Tue, 30 Oct 2018 22:42:10 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:56172 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727771AbeJaCmJ (ORCPT ); Tue, 30 Oct 2018 22:42:09 -0400 Received: by mail-it1-f195.google.com with SMTP id e17so13158818itk.5 for ; Tue, 30 Oct 2018 10:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qab+1aQJJivRwfWtN9pbYqgppFr9e/VfqfU0ts1atXE=; b=bdLqLOwP7Ucs/Vj04rXZ+MNc0AbPnfoLDsU3LvvndV5K26o/nvjTTMyge6CADiMHCE pZDn8o7ncKKHalzu6XqUoggal3+PTO3D6J6O4eCD/3ry6EmqPPJLo+M0fEKVuURJD03W +4JyzcJMqGBn/PRLQhCBP9+vlUW149wombIOVqeiWsGbYcO58PQUIOEJwJk1jkWV6/k5 3jZkegxx4NhSW82pPSkgZoMKHwRl2x1jR6jq5Vf5pgS+mAwMNXnfPs8mG9uS+h7WsLOP SZ8j4d8OZDIayNOD3+Cym9leeoDJIKGcff6IODmKicyE5vNwB647oGMivYWhFv3c3z+D fkHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qab+1aQJJivRwfWtN9pbYqgppFr9e/VfqfU0ts1atXE=; b=MTZcM/uvvObWLSc0tbS+Pl7dEFRnAW1ovPhJWKMvy0Hzt4zfDhKvU0RX9HETHQ99QC LnDkuBOnLvUC275kp1X2XWwJMFVxv43Tbv7Biv023uRPmVx5szXPwZs9O1+i4J/OOlCu 0nb60fQIxfXrH/mS+ZtOhKM8cj5hxpFI2WuRTHwhLWmDGyyHpmPy0UXN5flDAez9NWAp fJaHKlZYiczJd8HkvqsnG7FOD95wV+nMRaXgRbpqcYNHtonv+yagmczgBmscZFZqj6kQ ENveD97a47IXdlEkJry/2jm1z2ZYkyuPb6/H5VwbsCG6e0Nng7ScM4dYG/BeR6pLsiHc Xebg== X-Gm-Message-State: AGRZ1gJa1dv03BJsJR5PjUbwA0DDrJHZhf+xNvgcGwOi4Fx1jEpj7fYZ Sbp5iNbp3btABHNzKS9MFkrpyGbhpfI= X-Received: by 2002:a02:900b:: with SMTP id w11-v6mr2161804jaf.120.1540921661903; Tue, 30 Oct 2018 10:47:41 -0700 (PDT) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id f6-v6sm8098681iob.36.2018.10.30.10.47.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 10:47:40 -0700 (PDT) Subject: Re: [PATCH 11/14] irq: add support for allocating (and affinitizing) sets of IRQs To: Thomas Gleixner Cc: Keith Busch , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org 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> From: Jens Axboe Message-ID: Date: Tue, 30 Oct 2018 11:47:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30/18 11:46 AM, Thomas Gleixner wrote: > 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 :) I'll re-post the series with the updated combo some time later today. > lazytglx I understand :-) -- Jens Axboe