From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752170AbdDMVrM (ORCPT ); Thu, 13 Apr 2017 17:47:12 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57073 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbdDMVrK (ORCPT ); Thu, 13 Apr 2017 17:47:10 -0400 Date: Thu, 13 Apr 2017 14:46:03 -0700 From: tip-bot for Keith Busch Message-ID: Cc: keith.busch@intel.com, linux-kernel@vger.kernel.org, xiaolong.ye@intel.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org Reply-To: tglx@linutronix.de, keith.busch@intel.com, xiaolong.ye@intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com In-Reply-To: <1492104492-19943-1-git-send-email-keith.busch@intel.com> References: <1492104492-19943-1-git-send-email-keith.busch@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] irq/affinity: Fix extra vecs calculation Git-Commit-ID: 3412386b531244f24a27c79ee003506a52a00848 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 Commit-ID: 3412386b531244f24a27c79ee003506a52a00848 Gitweb: http://git.kernel.org/tip/3412386b531244f24a27c79ee003506a52a00848 Author: Keith Busch AuthorDate: Thu, 13 Apr 2017 13:28:12 -0400 Committer: Thomas Gleixner CommitDate: Thu, 13 Apr 2017 23:41:00 +0200 irq/affinity: Fix extra vecs calculation This fixes a math error calculating the extra_vecs. The error assumed only 1 cpu per vector, but the value needs to account for the actual number of cpus per vector in order to get the correct remainder for extra CPU assignment. Fixes: 7bf8222b9bd0 ("irq/affinity: Fix CPU spread for unbalanced nodes") Reported-by: Xiaolong Ye Signed-off-by: Keith Busch Link: http://lkml.kernel.org/r/1492104492-19943-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 dc52911..d052947 100644 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@ -108,7 +108,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) vecs_to_assign = min(vecs_per_node, ncpus); /* Account for rounding errors */ - extra_vecs = ncpus - vecs_to_assign; + extra_vecs = ncpus - vecs_to_assign * (ncpus / vecs_to_assign); for (v = 0; curvec < last_affv && v < vecs_to_assign; curvec++, v++) {