From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753938AbdF1DPo (ORCPT ); Tue, 27 Jun 2017 23:15:44 -0400 Received: from ozlabs.org ([103.22.144.67]:51193 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753603AbdF1DPg (ORCPT ); Tue, 27 Jun 2017 23:15:36 -0400 Date: Wed, 28 Jun 2017 13:15:34 +1000 From: Stephen Rothwell To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Bjorn Helgaas Cc: Linux-Next Mailing List , Linux Kernel Mailing List , Michael Hernandez , Himanshu Madhani , Christoph Hellwig Subject: linux-next: manual merge of the tip tree with the pci tree Message-ID: <20170628131534.1d549e19@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Today's linux-next merge of the tip tree got a conflict in: kernel/irq/affinity.c between commit: 6f9a22bc5775 ("PCI/MSI: Ignore affinity if pre/post vector count is more than min_vecs") from the pci tree and commit: 9a0ef98e186d ("genirq/affinity: Assign vectors to all present CPUs") from the tip tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. -- Cheers, Stephen Rothwell diff --cc kernel/irq/affinity.c index 9b71406d2eec,d2747f9c5707..000000000000 --- a/kernel/irq/affinity.c +++ b/kernel/irq/affinity.c @@@ -64,15 -108,8 +108,15 @@@ irq_create_affinity_masks(int nvecs, co int last_affv = affv + affd->pre_vectors; nodemask_t nodemsk = NODE_MASK_NONE; struct cpumask *masks; - cpumask_var_t nmsk; + cpumask_var_t nmsk, *node_to_present_cpumask; + /* + * If there aren't any vectors left after applying the pre/post + * vectors don't bother with assigning affinity. + */ + if (!affv) + return NULL; + if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL)) return NULL; @@@ -155,15 -199,10 +207,13 @@@ int irq_calc_affinity_vectors(int minve { int resv = affd->pre_vectors + affd->post_vectors; int vecs = maxvec - resv; - int cpus; + int ret; + if (resv > minvec) + return 0; + - /* Stabilize the cpumasks */ get_online_cpus(); - cpus = cpumask_weight(cpu_online_mask); + ret = min_t(int, cpumask_weight(cpu_present_mask), vecs) + resv; put_online_cpus(); - - return min(cpus, vecs) + resv; + return ret; }