From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967290AbdDSQzS (ORCPT ); Wed, 19 Apr 2017 12:55:18 -0400 Received: from mga09.intel.com ([134.134.136.24]:9283 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967276AbdDSQzO (ORCPT ); Wed, 19 Apr 2017 12:55:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,222,1488873600"; d="scan'208";a="91428611" Date: Wed, 19 Apr 2017 13:03:59 -0400 From: Keith Busch To: Andrei Vagin Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Xiaolong Ye Subject: Re: irq/affinity: Fix extra vecs calculation Message-ID: <20170419170359.GE16224@localhost.localdomain> References: <1492104492-19943-1-git-send-email-keith.busch@intel.com> <20170419162027.GA7428@outlook.office365.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170419162027.GA7428@outlook.office365.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 19, 2017 at 09:20:27AM -0700, Andrei Vagin wrote: > Hi, > > Something is wrong with this patch. We run CRIU tests for upstream kernels. > And we found that a kernel with this patch can't be booted. > > https://travis-ci.org/avagin/linux/builds/223557750 > > We don't have access to console logs and I can't reproduce this issue on > my nodes. I tired to revert this patch and everything works as expected. > > https://travis-ci.org/avagin/linux/builds/223594172 > > Here is another report about this patch > https://lkml.org/lkml/2017/4/16/344 Yikes, okay, I've made a mistake somewhere. Sorry about that, I will look into this ASAP. If it's a divide by 0 as your last link indicates, that must mean there are possible nodes, but have no CPUs, and those should be skipped. If that's the case, the following should fix it, but I'm going to do some more qemu testing with various CPU topologies to confirm. --- diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d052947..80c45d0 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -105,6 +105,9 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) /* Calculate the number of cpus per vector */ ncpus = cpumask_weight(nmsk); + if (!ncpus) + continue; + vecs_to_assign = min(vecs_per_node, ncpus); /* Account for rounding errors */ --