Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6971861ybh; Thu, 8 Aug 2019 08:22:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqErOtR+9AITu/dh1G9ihfWv84+wAQYMjK+VbL9AdAjpNHcJehKmEnX49HhnbnWpbcYe+9 X-Received: by 2002:a17:902:b68f:: with SMTP id c15mr14394020pls.104.1565277767186; Thu, 08 Aug 2019 08:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565277767; cv=none; d=google.com; s=arc-20160816; b=vV2J2BFzlKm3fd+/r1WEBI0irKgFV1TGMdJY4H81LSXwd3NX0CFR4nrbzIO297W4tW cMA+I7MMnKCHov9JWfqa5hzNvmra/oITfa3wuSmBWWhGNck1X5ig7FnVl1zFOcOlwf2E ffrN7vh72tz7kn6PCW/if0ocbZS9QKmU5gwzodckmpiK2y6wBh8juUxxO2YuSZsEFPRy hn40mus492yIUSjeItfc+Qm8lPvY2PuhxqIoFwqGHwyFkSzLr1xNNwSMFlwBnZaOmOeh NEECUKf8oPvH7OjGp6hVhwbET4VtpQG5o2/QGdeQlkFq2p7QpExw7oNVoAwNJu0Wtpv9 Hahw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LCnhcZk8TNcNdDBsV4G6C0mBmeqAcclkscVMz4VaXbI=; b=CaD5DrGDSaX1EAQ7UPT0vaYlHtHJ8b6R/7i+Jg5pJ/cSndyTxBYrwVTmTditsulhe6 54ldCy6zMicYx9GnQC/DZmhfWtgtvGwTELqdg8+oRM0RS4nq2GYEkKb4pxJ7MOU0tvGY ergbwFTTFyXX5DGO6ytiFK5f6RVn/MhcgGh7zCJHePHfJWjk5FcU6u5Yi2WC+xoAzIz9 /LA12kIPsMgHL3AwXnkIFznnKfk5lLZ7L+ScD5Bw12RQ5byLL7Od6GcuCHQvv3KJddE/ 7I/jbBPQe9Q6KUwutfHohFVfUUYLLBkKhNVPL7Mu6f+aUvQI+SEWkwfZ9flgbba4q5Z3 dZ/g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15si4884778plr.87.2019.08.08.08.22.31; Thu, 08 Aug 2019 08:22:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403778AbfHHPUH (ORCPT + 99 others); Thu, 8 Aug 2019 11:20:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:46713 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfHHPUH (ORCPT ); Thu, 8 Aug 2019 11:20:07 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2019 08:20:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,361,1559545200"; d="scan'208";a="203611641" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga002.fm.intel.com with ESMTP; 08 Aug 2019 08:20:06 -0700 Date: Thu, 8 Aug 2019 09:17:40 -0600 From: Keith Busch To: Ming Lei Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Marc Zyngier , Christoph Hellwig , Bjorn Helgaas , Jens Axboe , linux-block@vger.kernel.org, Sagi Grimberg , linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, Keith Busch , Sumit Saxena , Kashyap Desai , Shivasharan Srikanteshwara Subject: Re: [PATCH] genirq/affinity: create affinity mask for single vector Message-ID: <20190808151740.GA27077@localhost.localdomain> References: <20190805011906.5020-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805011906.5020-1-ming.lei@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 09:19:06AM +0800, Ming Lei wrote: > Since commit c66d4bd110a1f8 ("genirq/affinity: Add new callback for > (re)calculating interrupt sets"), irq_create_affinity_masks() returns > NULL in case of single vector. This change has caused regression on some > drivers, such as lpfc. > > The problem is that single vector may be triggered in some generic cases: > 1) kdump kernel 2) irq vectors resource is close to exhaustion. > > If we don't create affinity mask for single vector, almost every caller > has to handle the special case. > > So still create affinity mask for single vector, since irq_create_affinity_masks() > is capable of handling that. Hi Ming, Looks good to me. Reviewed-by: Keith Busch > --- > kernel/irq/affinity.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c > index 4352b08ae48d..6fef48033f96 100644 > --- a/kernel/irq/affinity.c > +++ b/kernel/irq/affinity.c > @@ -251,11 +251,9 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) > * Determine the number of vectors which need interrupt affinities > * assigned. If the pre/post request exhausts the available vectors > * then nothing to do here except for invoking the calc_sets() > - * callback so the device driver can adjust to the situation. If there > - * is only a single vector, then managing the queue is pointless as > - * well. > + * callback so the device driver can adjust to the situation. > */ > - if (nvecs > 1 && nvecs > affd->pre_vectors + affd->post_vectors) > + if (nvecs > affd->pre_vectors + affd->post_vectors) > affvecs = nvecs - affd->pre_vectors - affd->post_vectors; > else > affvecs = 0; > --