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 1F623C31E40 for ; Mon, 12 Aug 2019 09:57:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFF152085A for ; Mon, 12 Aug 2019 09:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbfHLJ5g (ORCPT ); Mon, 12 Aug 2019 05:57:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35332 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727694AbfHLJ5f (ORCPT ); Mon, 12 Aug 2019 05:57:35 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73A573B551; Mon, 12 Aug 2019 09:57:35 +0000 (UTC) Received: from localhost (ovpn-8-23.pek2.redhat.com [10.72.8.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FBD1646CA; Mon, 12 Aug 2019 09:57:32 +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 V2 3/3] genirq/affinity: Enhance warning check Date: Mon, 12 Aug 2019 17:57:09 +0800 Message-Id: <20190812095709.25623-4-ming.lei@redhat.com> In-Reply-To: <20190812095709.25623-1-ming.lei@redhat.com> References: <20190812095709.25623-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Aug 2019 09:57:35 +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 927dcbe80482..178dc7eb7b35 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -318,8 +318,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