From patchwork Mon Jun 24 20:05:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Duyck, Alexander H" X-Patchwork-Id: 253953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6DDD92C0096 for ; Tue, 25 Jun 2013 06:08:20 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751776Ab3FXUIC (ORCPT ); Mon, 24 Jun 2013 16:08:02 -0400 Received: from mga14.intel.com ([143.182.124.37]:8370 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219Ab3FXUHw (ORCPT ); Mon, 24 Jun 2013 16:07:52 -0400 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 24 Jun 2013 13:07:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,930,1363158000"; d="scan'208";a="259521962" Received: from ahduyck-cp1.jf.intel.com ([10.23.152.162]) by AZSMGA002.ch.intel.com with ESMTP; 24 Jun 2013 13:07:47 -0700 Subject: [PATCH] pci: Avoid unnecessary calls to work_on_cpu To: bhelgaas@google.com From: Alexander Duyck Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 24 Jun 2013 13:05:01 -0700 Message-ID: <20130624195942.40795.27292.stgit@ahduyck-cp1.jf.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch is meant to address the fact that we are making unnecessary calls to work_on_cpu. To resolve this I have added a check to see if the current node is the correct node for the device before we decide to assign the probe task to another CPU. The advantages to this approach is that we can avoid reentrant calls to work_on_cpu. In addition we should not make any calls to setup the work remotely in the case of a single node system that has NUMA enabled. Signed-off-by: Alexander Duyck --- This patch is based off of work I submitted in an earlier patch that I never heard back on. The change was originally submitted in: pci: Avoid reentrant calls to work_on_cpu I'm not sure what ever happened with that patch, however after reviewing it some myself I decided I could do without the change to the comments since they were unneeded. As such I am resubmitting this as a much simpler patch that only adds the line of code needed to avoid calling work_on_cpu for every call to probe on an NUMA node specific device. drivers/pci/pci-driver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 79277fb..7d81713 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -282,7 +282,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, its local memory on the right node without any need to change it. */ node = dev_to_node(&dev->dev); - if (node >= 0) { + if ((node >= 0) && (node != numa_node_id())) { int cpu; get_online_cpus();