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: 2773511 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1E7E9F3A0 for ; Mon, 24 Jun 2013 20:08:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A8412027C for ; Mon, 24 Jun 2013 20:08:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C3722020F for ; Mon, 24 Jun 2013 20:08:20 +0000 (UTC) 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 X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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();