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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 72F36C433FF for ; Tue, 13 Aug 2019 08:15:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45E5A206C2 for ; Tue, 13 Aug 2019 08:15:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728007AbfHMIPF (ORCPT ); Tue, 13 Aug 2019 04:15:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbfHMIPD (ORCPT ); Tue, 13 Aug 2019 04:15:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C15BDC04959E; Tue, 13 Aug 2019 08:15:02 +0000 (UTC) Received: from localhost (ovpn-8-25.pek2.redhat.com [10.72.8.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 651F73796; Tue, 13 Aug 2019 08:14:59 +0000 (UTC) From: Ming Lei To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Ming Lei , Christoph Hellwig , Keith Busch , linux-nvme@lists.infradead.org, Jon Derrick , Jens Axboe Subject: [PATCH V3 1/3] genirq/affinity: Enhance warning check Date: Tue, 13 Aug 2019 16:14:45 +0800 Message-Id: <20190813081447.1396-2-ming.lei@redhat.com> In-Reply-To: <20190813081447.1396-1-ming.lei@redhat.com> References: <20190813081447.1396-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 13 Aug 2019 08:15:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The two-stage spread is done on same irq vectors, and we just need that either one stage covers all vector, not two stage work together to cover all vectors. So enhance the warning check to make sure all vectors are spread. Cc: Christoph Hellwig Cc: Keith Busch Cc: linux-nvme@lists.infradead.org, Cc: Jon Derrick Cc: Jens Axboe Fixes: 6da4b3ab9a6 ("genirq/affinity: Add support for allocating interrupt sets") Signed-off-by: Ming Lei --- kernel/irq/affinity.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index 6fef48033f96..265b3076f16b 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -215,8 +215,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, npresmsk, nmsk, masks); put_online_cpus(); - if (nr_present < numvecs) - WARN_ON(nr_present + nr_others < numvecs); + WARN_ON(max(nr_present, nr_others) < numvecs); free_node_to_cpumask(node_to_cpumask); -- 2.20.1