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=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 86226C433FF for ; Wed, 7 Aug 2019 23:51:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59D5F214C6 for ; Wed, 7 Aug 2019 23:51:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hhTHm5Nw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389192AbfHGXvN (ORCPT ); Wed, 7 Aug 2019 19:51:13 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33603 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388123AbfHGXvN (ORCPT ); Wed, 7 Aug 2019 19:51:13 -0400 Received: by mail-wr1-f65.google.com with SMTP id n9so93153309wru.0; Wed, 07 Aug 2019 16:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=81W60zVYjF0WkGNMIxtxV/QpHZxdSDjYkRGFZyoC9NQ=; b=hhTHm5Nw3iub40WKb4H1rqVluoBt3pHck0QiywNeJGfgGNfnNjbzVrBPozkC5g8j9g 8aab+mE+4ulrI+yy3QFobs6H3wCMogQfTTEjQ5LK3wee/MLE5uYV9hg9P3EWlEO24S4A GGcRJ0l3FkefLaW5R2D6+IUs60CB3RRjd630LA8qt65E0pXuyLQuHc03dYbuendzW8it 7nEsYz/9xvm9+lK46TAYUqXDRS06we3dkaQ4lBBiwYFZJ6UCQRLZ6KAyHmrnHas1Yv09 Fsrqehj9A5Sp6lSVWLuV7I3FdqXigC8Jlton0NbJR+TCmrH+wznz/IqijdnDjUtkTRZ5 s6aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=81W60zVYjF0WkGNMIxtxV/QpHZxdSDjYkRGFZyoC9NQ=; b=LKpF5+OiYEksh0PzBiWhy7Q1YNJ4NDKSKTUKT7gNlVSHI8hph8oLR9dU06xGQgQM1w t0drqBh0ZUkrio4CxDhmsVfs2nxI2z/YqYE+Wr/u9vuBFuhZBwUQnLBkiuKWOk4NRzMN Ud16RCNUsRS/usoAS03J7mUAQg2EZgf2/H6wXY27CNqyCZuncmnEzSgQSHKV2jLmO9bv 1oFGSyR6NEd9a11C8Ou4U3LM++6tteTlXhTBa0XmueQAUY53Xw91j0YZyKPM9OEVEr7w 6nDVTVW7tkfTvENZqB2y8+soGujoKx5SGRC4LJu89pHBwowfyI6RkYZMV2xlkuEuueTV 383w== X-Gm-Message-State: APjAAAX7oRodd1yh/CXhAjj92nTqVKybRtVWCm5tBMoTtSWfzCgPNffW 6YfOa0BiMRsHns5A1Fr7HgSH8brNicnipIN3T8Q= X-Google-Smtp-Source: APXvYqwt7F5BkB58H5wD984WMZT43ugAcQRwg0VeBjol0Scsm8pOYOWjbYcauyyRwVif41pglTfX8hitoIVSFX1lIAs= X-Received: by 2002:adf:f088:: with SMTP id n8mr13084998wro.58.1565221870134; Wed, 07 Aug 2019 16:51:10 -0700 (PDT) MIME-Version: 1.0 References: <20190805011906.5020-1-ming.lei@redhat.com> In-Reply-To: <20190805011906.5020-1-ming.lei@redhat.com> From: Ming Lei Date: Thu, 8 Aug 2019 07:50:59 +0800 Message-ID: Subject: Re: [PATCH] genirq/affinity: create affinity mask for single vector To: Ming Lei Cc: Thomas Gleixner , Jens Axboe , Keith Busch , Sagi Grimberg , Marc Zyngier , linux-pci@vger.kernel.org, Shivasharan Srikanteshwara , Linux Kernel Mailing List , linux-nvme , linux-block , Sumit Saxena , Bjorn Helgaas , Kashyap Desai , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Thomas and Guys, On Mon, Aug 5, 2019 at 9:19 AM 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. > > Cc: Marc Zyngier > Cc: Christoph Hellwig > Cc: Bjorn Helgaas > Cc: Jens Axboe > Cc: linux-block@vger.kernel.org > Cc: Sagi Grimberg > Cc: linux-nvme@lists.infradead.org > Cc: linux-pci@vger.kernel.org > Cc: Keith Busch > Cc: Sumit Saxena > Cc: Kashyap Desai > Cc: Shivasharan Srikanteshwara > Fixes: c66d4bd110a1f8 ("genirq/affinity: Add new callback for (re)calculating interrupt sets") > Signed-off-by: Ming Lei > --- > 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; Without this patch, kdump kernel may not work, so could you take a look at this patch? Thanks, Ming Lei