Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933090AbbGJTjf (ORCPT ); Fri, 10 Jul 2015 15:39:35 -0400 Received: from mail-am1on0093.outbound.protection.outlook.com ([157.56.112.93]:65302 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932615AbbGJTj1 (ORCPT ); Fri, 10 Jul 2015 15:39:27 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; From: Chris Metcalf To: Frederic Weisbecker , , CC: Chris Metcalf Subject: [PATCH v2] nohz: prevent tilegx network driver interrupts Date: Fri, 10 Jul 2015 15:37:25 -0400 Message-ID: <1436557045-5392-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <55A0175E.2010200@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD014;1:mOA5ZkZE4OTgij9K1Og0xTj9SH+3e84abnw242Kcgbx4IHyTh7uNpYMULGRSrsHS8KGyuHTCoNH9mMkVxexce01CATfZ5Ngr0nOPCbzUSIM4wm+VFUbCfGDF/x7b6mGOk1WDMXB+GJgXNjXZtJwoNXMm+hHHBDClLf2QsqwuYT8OF3iGINfR8gR6OqhUAWx9mzbri/VgLiIsiQLTwz3rfE8oeKSLKasyIPfOfq71UKADDeOBU4EXq9De2sjWZlbshpvk+p2zeyh6sFEn6YRFDl7aERXHBlRMUbmO7PeZkzUf1VHZzaC6Y9tJntaOYgGIWc8ShEWikwUQ0coykuPtmX1wBJtQwlE2f9NuZu1IAM4h+JEvEgwJx2d39AybZqVJ38gIS1ia5K3kxsX/jARy2JYR5vun4YxtcDgdZnOdXpkFHq0am0afLxl6Kftyvxwp X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(339900001)(199003)(189002)(106466001)(105606002)(77156002)(5001960100002)(107886002)(46102003)(62966003)(42186005)(33646002)(575784001)(104016003)(189998001)(2950100001)(86362001)(2201001)(5003940100001)(229853001)(19580395003)(50226001)(47776003)(85426001)(6806004)(87936001)(5001770100001)(19580405001)(5001920100001)(48376002)(36756003)(92566002)(50986999)(50466002)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0776;H:lab-2.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0776;2:uxe2tQL0Sh2gvgIpn4PJZyXB1oyB+HF/LRsFcIATBmG8ScVcLmHwVw/rC5u8FxYA;3:Wh8OP5F5eG9Er5pBtB7d8nO3zTPKe8jTZkLe1bT1yoOKBySK/WNpOuvKPx3m2KEu7iyPijpiWy/Det69KG1czG9S6h7bffi3WyL/nWKvgH/zhVAqiVWaYAP83lXJdV1Uvi0jNg90NMuIeHp1gRoPVQTNFWoVtDCw01hE1OcL3avl4SXMrN4xh+mrZoslcCRqB1Jv5EXg5THM/zvJpXTHbp/QNit6qoJMoNimQ0wM1/HizknGmSPx1Zve9r1mlWWv;25:t80JDE1NZiCk3cvLpg60uhWBhz6NOXcw+jTP0ajZxhragvSb+jYYmZt8kUIoAO96hNnPyKX3zeQswBhW/84MifpXpg6qqBrhsQQXedDpg+Xr+HtmI8saRxACuB/SRl22xfQmyhsXM094XZ9ULpK/8CF16Gm+49rbn/E3ymiE6HHKyamUiRE97NY/h3d1mLcA4MJmzoam5PXmF+Zy/iP5SsvPFFCW1+lDxL9mzKGFbesGfIjVSPgVGh9XXqD91s6oH7KiX+JSf+OSqYU49HLpPg==;20:zAbJfEVjWVP5kTI64b6jW+urFKaqDk1QBwaTeVRSFBHNbswXccCYU+BHKRwJJKf1tdmi8KAS4P1pYGFwvJdj0Fvg6TBLsRVJSDK95HbJ4cr2bm4RXEpGOpHdKDNwyosDUyWykjDUHAO0pDdJolTCuO+UoCipoV/2hN/47a61YIg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0776; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DB5PR02MB0776;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0776; X-Microsoft-Exchange-Diagnostics: 1;DB5PR02MB0776;4:VfC7LE8O4CSABeKKQUIARGTDoLgFXFpNanyRJPcBC89U38gfkVmhIaCNf9J7rXkyjVgjnvEflqukg3znHAlJJN60iatWoYGM5iQ35qu+BiWIjqiU8bGmchHjyq7q4Cla1XEpjo1R4blxkLSgSAuo5KC03fof4rQKn+JIg+nVsmkxptYHug97sRrutChXjcSESJzsZD0GX8lxlIEdY3JrRSOEs7c0gbpb6KcMQVwbQe/g/Dlxlf3WF7c7dwErU2VTXGcePvJiIXBadXkmyvKHukODXmOYJXoiDpEjye+f4jk= X-Forefront-PRVS: 06339BAE63 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DB5PR02MB0776;23:Xm5aRt6FZg9cTMplOdhajhDi7IgXDGr3N/B+l7EZe?= =?us-ascii?Q?wZGrOSfZ9zbD4ZsMRStX0ocl4FERI+i8bEDz+8WzYCIpPvJVsRsj7CcpXtLC?= =?us-ascii?Q?NRoS6Ce5nKySV2uyIS6ILRDw4NoIl4kmApins3KYIGG2AWVOWoNsMRKCCTq2?= =?us-ascii?Q?6U4cAZ28CondRx9lBDWmWxNTbHprWXtxCawCa8Y/Vo8tn77N7oXqSteobT3Q?= =?us-ascii?Q?q9MW0VCDs+qDy2s+Nuz7rHXs0BEVP3FtWoOwcrtUkI1mZb2YnTCDfwB75fUV?= =?us-ascii?Q?ECXXvakNp27D4MMupYWWkUFj0mQi335xa0KAesW2lBCyV/FyslF5czLVq0NM?= =?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ZS7lmUOyYlLQa40qrKg1fHSoqEurTbD7dXciFM2Qgcyf+RFLXoa7srZzPwGwnnVS8CA2I8=;20:U4mO0sAY/t2EA9Bu4V9yvL/xc9Mkm4y3fKeG0vcp+X9f3APSIC7+4G0D9nwYqHQatlw6H7Dugb219ysTESBWMQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2015 19:39:22.8960 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[lab-2.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0776 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2276 Lines: 69 Normally the tilegx networking shim sends irqs to all the cores to distribute the load of processing incoming-packet interrupts, so that you can get to multiple Gb's of traffic inbound. However, in nohz_full mode we don't want to interrupt the nohz_full cores by default, so we limit the set of cores we use to only the online housekeeping cores. To make client code easier to read, we introduce a new nohz_full accessor, housekeeping_cpumask(), which returns a pointer to the housekeeping_mask if nohz_full is enabled, and otherwise returns the cpu_possible_mask. Signed-off-by: Chris Metcalf --- drivers/net/ethernet/tile/tilegx.c | 4 +++- include/linux/tick.h | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index a3f7610002aa..0a15acc075b3 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -2273,7 +2274,8 @@ static int __init tile_net_init_module(void) tile_net_dev_init(name, mac); if (!network_cpus_init()) - network_cpus_map = *cpu_online_mask; + cpumask_and(&network_cpus_map, housekeeping_cpumask(), + cpu_online_mask); return 0; } diff --git a/include/linux/tick.h b/include/linux/tick.h index 3741ba1a652c..d3b00f0b2221 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -160,6 +160,15 @@ static inline void tick_nohz_full_kick_all(void) { } static inline void __tick_nohz_task_switch(struct task_struct *tsk) { } #endif +static inline const struct cpumask *housekeeping_cpumask(void) +{ +#ifdef CONFIG_NO_HZ_FULL + if (tick_nohz_full_enabled()) + return housekeeping_mask; +#endif + return cpu_possible_mask; +} + static inline bool is_housekeeping_cpu(int cpu) { #ifdef CONFIG_NO_HZ_FULL -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/