Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751120AbbGKPE5 (ORCPT ); Sat, 11 Jul 2015 11:04:57 -0400 Received: from mail-db3on0079.outbound.protection.outlook.com ([157.55.234.79]:42400 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750820AbbGKPE4 convert rfc822-to-8bit (ORCPT ); Sat, 11 Jul 2015 11:04:56 -0400 X-Greylist: delayed 71973 seconds by postgrey-1.27 at vger.kernel.org; Sat, 11 Jul 2015 11:04:55 EDT From: Chris Metcalf To: Frederic Weisbecker CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] nohz: prevent tilegx network driver interrupts Thread-Topic: [PATCH v2] nohz: prevent tilegx network driver interrupts Thread-Index: AQHQu0ghiiJZFrk2sUW2G/j3SoC7aJ3WWagAgAAFqWU= Date: Sat, 11 Jul 2015 15:04:52 +0000 Message-ID: References: <55A0175E.2010200@ezchip.com> <1436557045-5392-1-git-send-email-cmetcalf@ezchip.com>,<20150711144436.GF10257@lerouge> In-Reply-To: <20150711144436.GF10257@lerouge> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none; x-originating-ip: [173.76.21.154] x-microsoft-exchange-diagnostics: 1;DB5PR02MB0775;5:lIelzheMtsFGhxNd3dDdN0bxGWkjXRwEBBdrnKRT3FsWFdTTyW+aCeQtjlIJwr1kcTtiXeZywqf+MTC5tsZ3pz2ALC4sQzH6EFLWpj9fHBh+5NoOvsfKgaCc6qPnxlyMQb6SoAkjvjR2WyP4O3K2EA==;24:MvpyeO2N8htwLUCANV5WVBQo1riale26CHiABlUn4I4h1ie55dqY5NTCBNMvxCxyJ0Uzg5SfpV9kM/8WSzARQLqWvSqqM4Z0XnyNvdYIS9k=;20:ikoM2uOrEBLxDNeM+AlDXrh9CD+c3mYs1hc2gux6mi1p/I+u2Dbz2R1UvrjCq6W/VXNEz7isSJlz1N8x0atOaQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; 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:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; x-forefront-prvs: 0634F37BFF x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(377454003)(92566002)(102836002)(2900100001)(83716003)(106116001)(46102003)(5002640100001)(110136002)(36756003)(2950100001)(189998001)(77096005)(5001960100002)(66066001)(19580395003)(77156002)(19580405001)(40100003)(122556002)(86362001)(87936001)(1411001)(50986999)(575784001)(76176999)(2656002)(54356999)(62966003)(82746002)(33656002)(104396002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:DB5PR02MB0776.eurprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2015 15:04:52.9139 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0775 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2764 Lines: 81 > On Jul 11, 2015, at 10:44 AM, Frederic Weisbecker wrote: > >> On Fri, Jul 10, 2015 at 03:37:25PM -0400, Chris Metcalf wrote: >> 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 > > Looks good. Since it modifies nohz core stuff, do you mind if I take it? > > Thanks. Sure, that's fine. Thanks. > >> --- >> 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/