Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965665AbdDTOID (ORCPT ); Thu, 20 Apr 2017 10:08:03 -0400 Received: from terminus.zytor.com ([65.50.211.136]:44905 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S946229AbdDTOH7 (ORCPT ); Thu, 20 Apr 2017 10:07:59 -0400 Date: Thu, 20 Apr 2017 07:06:49 -0700 From: tip-bot for Keith Busch Message-ID: Cc: hpa@zytor.com, tglx@linutronix.de, keith.busch@intel.com, mingo@kernel.org, avagin@virtuozzo.com, linux-kernel@vger.kernel.org Reply-To: keith.busch@intel.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, avagin@virtuozzo.com, mingo@kernel.org In-Reply-To: <1492645870-13019-1-git-send-email-keith.busch@intel.com> References: <1492645870-13019-1-git-send-email-keith.busch@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] genirq/affinity: Fix calculating vectors to assign Git-Commit-ID: b72f8051f34b8164a62391e3676edc34523c5952 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 37 Commit-ID: b72f8051f34b8164a62391e3676edc34523c5952 Gitweb: http://git.kernel.org/tip/b72f8051f34b8164a62391e3676edc34523c5952 Author: Keith Busch AuthorDate: Wed, 19 Apr 2017 19:51:10 -0400 Committer: Thomas Gleixner CommitDate: Thu, 20 Apr 2017 16:03:09 +0200 genirq/affinity: Fix calculating vectors to assign The vectors_per_node is calculated from the remaining available vectors. The current vector starts after pre_vectors, so we need to subtract that from the current to properly account for the number of remaining vectors to assign. Fixes: 3412386b531 ("irq/affinity: Fix extra vecs calculation") Reported-by: Andrei Vagin Signed-off-by: Keith Busch Link: http://lkml.kernel.org/r/1492645870-13019-1-git-send-email-keith.busch@intel.com Signed-off-by: Thomas Gleixner --- kernel/irq/affinity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c index d052947..e2d356d 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -98,7 +98,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) int ncpus, v, vecs_to_assign, vecs_per_node; /* Spread the vectors per node */ - vecs_per_node = (affv - curvec) / nodes; + vecs_per_node = (affv - (curvec - affd->pre_vectors)) / nodes; /* Get the cpus on this node which are in the mask */ cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n));