Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/952896/?format=api
{ "id": 952896, "url": "http://patchwork.ozlabs.org/api/patches/952896/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180802171310.9295-1-jeffrey.t.kirsher@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180802171310.9295-1-jeffrey.t.kirsher@intel.com>", "list_archive_url": null, "date": "2018-08-02T17:13:10", "name": "igb: reduce CPU0 latency when updating statistics", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "8f17f4cb60173b2dc73a257d2672cce5e80faefd", "submitter": { "id": 473, "url": "http://patchwork.ozlabs.org/api/people/473/?format=api", "name": "Kirsher, Jeffrey T", "email": "jeffrey.t.kirsher@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180802171310.9295-1-jeffrey.t.kirsher@intel.com/mbox/", "series": [ { "id": 59049, "url": "http://patchwork.ozlabs.org/api/series/59049/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=59049", "date": "2018-08-02T17:13:10", "name": "igb: reduce CPU0 latency when updating statistics", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/59049/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/952896/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/952896/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41hGwG1vcfz9s2g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 3 Aug 2018 03:13:18 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B2D9987FDC;\n\tThu, 2 Aug 2018 17:13:16 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 8K8wA44fD1AR; Thu, 2 Aug 2018 17:13:15 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 26E2C87F36;\n\tThu, 2 Aug 2018 17:13:15 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 508FC1BFBD2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 2 Aug 2018 17:13:14 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4A43C889A9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 2 Aug 2018 17:13:14 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TUfGUb8tqZox for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 2 Aug 2018 17:13:13 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 8ED3C889A7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 2 Aug 2018 17:13:13 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Aug 2018 10:13:13 -0700", "from jtkirshe-nuc.jf.intel.com ([134.134.177.59])\n\tby fmsmga002.fm.intel.com with ESMTP; 02 Aug 2018 10:13:12 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,436,1526367600\"; d=\"scan'208\";a=\"72824313\"", "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 2 Aug 2018 10:13:10 -0700", "Message-Id": "<20180802171310.9295-1-jeffrey.t.kirsher@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[Intel-wired-lan] [PATCH] igb: reduce CPU0 latency when updating\n\tstatistics", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "Jan Jablonsky <jan.jablonsky@thalesgroup.com>,\n\tBernhard Kaindl <bernhard.kaindl@thalesgroup.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "This change is based off of the work and suggestion of Jan Jablonsky\n<jan.jablonsky@thalesgroup.com>.\n\nThe Watchdog workqueue in igb driver is scheduled every 2s for each\nnetwork interface. That includes updating a statistics protected by\nspinlock. Function igb_update_stats in this case will be protected\nagainst preemption. According to number of a statistics registers\n(cca 60), processing this function might cause additional cpu load\n on CPU0.\n\nIn case of statistics spinlock may be replaced with mutex, which\nreduce latency on CPU0.\n\nCC: Bernhard Kaindl <bernhard.kaindl@thalesgroup.com>\nCC: Jan Jablonsky <jan.jablonsky@thalesgroup.com>\nSigned-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\n---\n drivers/net/ethernet/intel/igb/igb.h | 2 +-\n drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ++--\n drivers/net/ethernet/intel/igb/igb_main.c | 14 +++++++-------\n 3 files changed, 10 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex ca54e268d157..fe1592ae8769 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -515,7 +515,7 @@ struct igb_adapter {\n \t/* OS defined structs */\n \tstruct pci_dev *pdev;\n \n-\tspinlock_t stats64_lock;\n+\tstruct mutex stats64_lock;\n \tstruct rtnl_link_stats64 stats64;\n \n \t/* structs defined in e1000_hw.h */\ndiff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c\nindex 5acf3b743876..e0a0e62b142a 100644\n--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c\n+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c\n@@ -2295,7 +2295,7 @@ static void igb_get_ethtool_stats(struct net_device *netdev,\n \tint i, j;\n \tchar *p;\n \n-\tspin_lock(&adapter->stats64_lock);\n+\tmutex_lock(&adapter->stats64_lock);\n \tigb_update_stats(adapter);\n \n \tfor (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {\n@@ -2338,7 +2338,7 @@ static void igb_get_ethtool_stats(struct net_device *netdev,\n \t\t} while (u64_stats_fetch_retry_irq(&ring->rx_syncp, start));\n \t\ti += IGB_RX_QUEUE_STATS_LEN;\n \t}\n-\tspin_unlock(&adapter->stats64_lock);\n+\tmutex_unlock(&adapter->stats64_lock);\n }\n \n static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 1ed4f073e7e0..3cca19dade84 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -2209,9 +2209,9 @@ void igb_down(struct igb_adapter *adapter)\n \tdel_timer_sync(&adapter->phy_info_timer);\n \n \t/* record the stats before reset*/\n-\tspin_lock(&adapter->stats64_lock);\n+\tmutex_lock(&adapter->stats64_lock);\n \tigb_update_stats(adapter);\n-\tspin_unlock(&adapter->stats64_lock);\n+\tmutex_unlock(&adapter->stats64_lock);\n \n \tadapter->link_speed = 0;\n \tadapter->link_duplex = 0;\n@@ -3849,7 +3849,7 @@ static int igb_sw_init(struct igb_adapter *adapter)\n \tadapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;\n \n \tspin_lock_init(&adapter->nfc_lock);\n-\tspin_lock_init(&adapter->stats64_lock);\n+\tmutex_init(&adapter->stats64_lock);\n #ifdef CONFIG_PCI_IOV\n \tswitch (hw->mac.type) {\n \tcase e1000_82576:\n@@ -5414,9 +5414,9 @@ static void igb_watchdog_task(struct work_struct *work)\n \t\t}\n \t}\n \n-\tspin_lock(&adapter->stats64_lock);\n+\tmutex_lock(&adapter->stats64_lock);\n \tigb_update_stats(adapter);\n-\tspin_unlock(&adapter->stats64_lock);\n+\tmutex_unlock(&adapter->stats64_lock);\n \n \tfor (i = 0; i < adapter->num_tx_queues; i++) {\n \t\tstruct igb_ring *tx_ring = adapter->tx_ring[i];\n@@ -6242,10 +6242,10 @@ static void igb_get_stats64(struct net_device *netdev,\n {\n \tstruct igb_adapter *adapter = netdev_priv(netdev);\n \n-\tspin_lock(&adapter->stats64_lock);\n+\tmutex_lock(&adapter->stats64_lock);\n \tigb_update_stats(adapter);\n \tmemcpy(stats, &adapter->stats64, sizeof(*stats));\n-\tspin_unlock(&adapter->stats64_lock);\n+\tmutex_unlock(&adapter->stats64_lock);\n }\n \n /**\n", "prefixes": [] }