From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9DFA4B3A1 for ; Thu, 11 Sep 2014 16:18:21 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by orsmga101.jf.intel.com with ESMTP; 11 Sep 2014 07:23:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,506,1406617200"; d="scan'208";a="476889863" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by azsmga001.ch.intel.com with ESMTP; 11 Sep 2014 07:23:09 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s8BEN8Wg013319; Thu, 11 Sep 2014 15:23:08 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s8BEN7cS004910; Thu, 11 Sep 2014 15:23:07 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s8BEN777004906; Thu, 11 Sep 2014 15:23:07 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Thu, 11 Sep 2014 15:23:07 +0100 Message-Id: <1410445387-4849-4-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1410445387-4849-1-git-send-email-bruce.richardson@intel.com> References: <1410445387-4849-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 3/3] eal: affinitize low-priority threads to lcore 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 14:18:22 -0000 There are extra utility threads inside the linuxapp EAL, for managing things like interrupts, requests for the vfio file handle for multi-process, and hpet timer management. These are mostly sleeping, but to avoid any possibility of conflict with threads handling packets, this patch affinitizes those threads to lcore 0 explicitly. Signed-off-by: Bruce Richardson --- lib/librte_eal/linuxapp/eal/eal_interrupts.c | 5 +++++ lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c | 6 ++++++ lib/librte_eal/linuxapp/eal/eal_timer.c | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index dc2668a..6227f2b 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -739,6 +739,11 @@ eal_intr_thread_main(__rte_unused void *arg) { struct epoll_event ev; + /* set our affinity to lcore 0 so we never interfere with the normal + * data-plane threads. Lcore 0 is used by Linux so is subject to + * interruptions anyway. */ + rte_eal_thread_set_affinity(0); + /* host thread, never break out */ for (;;) { /* build up the epoll fd with all descriptors we are to diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c index 6588fb1..ccccbdb 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c @@ -53,6 +53,7 @@ #include #include +#include #include "eal_filesystem.h" #include "eal_pci_init.h" @@ -268,6 +269,11 @@ pci_vfio_mp_sync_thread(void __rte_unused * arg) { int ret, fd, vfio_group_no; + /* set our affinity to lcore 0 so we never interfere with the normal + * data-plane threads. Lcore 0 is used by Linux so is subject to + * interruptions anyway. */ + rte_eal_thread_set_affinity(0); + /* wait for requests on the socket */ for (;;) { int conn_sock; diff --git a/lib/librte_eal/linuxapp/eal/eal_timer.c b/lib/librte_eal/linuxapp/eal/eal_timer.c index ca57916..f61e303 100644 --- a/lib/librte_eal/linuxapp/eal/eal_timer.c +++ b/lib/librte_eal/linuxapp/eal/eal_timer.c @@ -125,6 +125,11 @@ hpet_msb_inc(__attribute__((unused)) void *arg) { uint32_t t; + /* set our affinity to lcore 0 so we never interfere with the normal + * data-plane threads. Lcore 0 is used by Linux so is subject to + * interruptions anyway. */ + rte_eal_thread_set_affinity(0); + while (1) { t = (eal_hpet->counter_l >> 30); if (t != (eal_hpet_msb & 3)) -- 1.9.3