Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932797AbbGJTFc (ORCPT ); Fri, 10 Jul 2015 15:05:32 -0400 Received: from mail-db3on0099.outbound.protection.outlook.com ([157.55.234.99]:56609 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932584AbbGJTFW (ORCPT ); Fri, 10 Jul 2015 15:05:22 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; Message-ID: <55A0175E.2010200@ezchip.com> Date: Fri, 10 Jul 2015 15:05:02 -0400 From: Chris Metcalf User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Frederic Weisbecker CC: , Subject: Re: [PATCH] nohz: prevent tilegx network driver interrupts References: <1436549624-16104-1-git-send-email-cmetcalf@ezchip.com> <20150710182406.GC26428@lerouge> In-Reply-To: <20150710182406.GC26428@lerouge> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: CY1PR21CA0100.namprd21.prod.outlook.com (25.164.213.26) To VI1PR02MB0782.eurprd02.prod.outlook.com (25.162.14.144) X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB0782;2:oTIuVIn9Ee0JaCA7iwjwcqH+gjLB84EhJ9LHEcbexb+Y9ajBoQc0pN0IdO0839K9;3:ZS3lGVebx2HR5FYXpVcnxLzM03PevSNJHcKwu91xFVR2eJf0D12d3aWzxv6DukQ470TB8nOUW+UPzWxazFgoRWN0TypcWHbOwezTq/P7WCAXsZvGcwSr/Rzx/x6QdhW2ffk3ypbeH2I5yG8dLDkTQA==;25:4PEIawdXOg9HIHlvKB26RBQetwSCkJ82HFEkt7QFmV58podLTvC7SBq+GFFVmaHz1B29WvAMqJY3l8lnl8jlCEefz7Ptmi6IQbAbV2+Q/O0SFNdRDYpCXFFe65euxXhhLvR4Q3WdNJ9D4bA7EhukG39RBC0hf99tBzAcGWtToTdzbhTb6/Vmo2cFGFVX3yFiEPCfSn1qHU1fuv/mtsd1PaBbfld/d96NCJ3MYsXfUKJ7kw/q7l6NNE5F1yWGGFqGIbCTWj7Z1h14Z+KFFpY79g==;20:nM+RXrsh+pdBB0VmfAJ6OJOmOU6VNbxkKDYSy6KAaPtIwLC7w6YDt0p+3JcsrIqEOY7W4Kx++ofchIx7ivoAoN3ag9/e7tIaa3Q6noXXhLNyG43HE2NIt8NJaE61d7YqPFQ5rLsb2DJgQvh4ub2J5yHigM9yH3HhDEiebpuk5b4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0782; 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:VI1PR02MB0782;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0782; X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB0782;4:qA+v47VGWk5y8dNlvr5m4ZaqEpjbBDDNJbrjobLBRL8aajh6Hj2xjC++jlfUMupTcD/QQXSRbfIjeQgi2ywurMs6jLwAJeEnzE11Wmmk500wob32adf40wT7fwDcomml16IeAFyXAWKFlZ/PhnPzMHyyQ57/dkrPM1JxnlaWml8dIt7BtblLcguTBumO9ozz1dL3qMow4BnKaxRXLKofB+ekyAUrRUIBwJ7/dD6dMDlEBc5mVUHmPiuev+4qkvMN56DLTzFwcMiavk+XwU3hmc1npBv+LiQkjQucK1E9eX4= X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(54534003)(51704005)(24454002)(377454003)(479174004)(52314003)(110136002)(80316001)(50466002)(33656002)(92566002)(5001960100002)(4001350100001)(189998001)(1411001)(19580405001)(46102003)(65806001)(47776003)(59896002)(36756003)(66066001)(19580395003)(65956001)(62966003)(42186005)(87266999)(64126003)(50986999)(65816999)(86362001)(54356999)(40100003)(122386002)(76176999)(23746002)(15975445007)(87976001)(77096005)(77156002)(83506001)(2950100001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR02MB0782;H:[10.7.0.41];FPR:;SPF:None;MLV:nov;PTR:InfoNoRecords;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR02MB0782;23:M0jsL283w0VKOtVzuBvpeH4WlPZSMc/ZSZyET?= =?Windows-1252?Q?6PbJZvUgSZg4eroosW8Z59ek6Mmo65Luf73bBw3LF0zBQDNC3da35Lke?= =?Windows-1252?Q?S2wFqyY3kieP3WyYa5A+/fOZg8PHcBWq1IH++a7nMaZaunyaaggcVBPj?= =?Windows-1252?Q?vHRjtmSaTB/OWnA7Y0rnaGvVhqkufUCTP/Z3OSCEiM9lUIweUHjnJKmn?= =?Windows-1252?Q?ht+3lvjOZD3j8VA2Z31r8dzotDnlu8P72VNUk3jH7BAvbOssrZL3V/o7?= =?Windows-1252?Q?aSSV7G8w8Sz24pemEfSJzd4Uv2QILAi7TpJTprv69mavrU8xUKyjdILp?= =?Windows-1252?Q?xoMqVI9M0gswkEjwYj4yXdx1KJRVXUyZacTv5umybgW8dsytmg6xqw3h?= =?Windows-1252?Q?XF0PS5PpaFZqh1DEh3TANe8eNrEJyC7p969bTqP/KbZisBMkBCvy57jc?= =?Windows-1252?Q?kjY3hrRKUVHN7VcmDzSW/FutiRmzWLDawDymUSxAzigdRNjtUe8ljoin?= =?Windows-1252?Q?2XOIgm3sHex18T/bG/mEsk+OokCVlCZdxb+/goWsaihZShi/xraFmieB?= =?Windows-1252?Q?X/SpWCrMeR3YwUsLjHs1Qv1CuCulo/E++976xCwdmA5l8gOhz6Gnuy+Y?= =?Windows-1252?Q?zR2kQxqtBrAbwtpj+Wk1QI0UgxQ1DygCH+CFOzJC2AjotTXZD/c1jzjd?= =?Windows-1252?Q?6dYgltQbtgwIT9S6tslgNqMwYBsebUTXdsEJT1k04fjf5vZCNzjxiOo2?= =?Windows-1252?Q?Wuu71xcNAUg+Q2R7Nk5yE1R3cOvSU5vjBX3OYWJTHrZUw+ittTwfdHZH?= =?Windows-1252?Q?RC96nkmiUKAqezIQDH7x9hOki8Ob3E+2utNCsB/WzyFnjPqCbEaNWd6B?= =?Windows-1252?Q?3Gl1Gf98Q5qkWhdZLhuzjwgl657V3W6AIJ4MIJuwpUqDyZ0dPvTbYki1?= =?Windows-1252?Q?ZFvhqpPVmG8Vc2R5QfTDHC0H9IyPVol3T6OXGw8rnw+NuezemZmCsTF1?= =?Windows-1252?Q?qOtHdgazK7eiX5+65QYDnkLLW2wbaao0i0ANsLc6n5/uowTJ77uYqxgg?= =?Windows-1252?Q?HR9j0WQERuIw3ha8ibQURZYSeRhOBlRypE1LwiB9+lLTjGRilh8/t0md?= =?Windows-1252?Q?TM9Os68iFUk6A4MP5kJxW+3u9Nt2/+USkypGO6Cr43ctE/HSduS+qSPX?= =?Windows-1252?Q?gY2iRjVttZOmMu9xQVfB4/YdlbU+Nm/cqgKnfHfMBFBrC3Ict1B7iXvW?= =?Windows-1252?Q?04XCO0dckgsgRmg1w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB0782;5:LxNqFduKSmmPl9qothgpf9rDDusDe7XU3XmleoMyPbigk5vhVgKokPoyiG7F5aki8XKv+C1l+H8ule0a4vSzKJbIcHp8npyD797BU6sbZ5j92fGqtzVCIZK4qz4Y46i+uaDUwGFY/+R6G91Ju2EBMw==;24:VpwO9Op4Xp6A1I6/JgcSVfmSp4RnsPLFuItPCKIyKfT4zQeWvgglOHqnmwZkSK1hYML/guWaqp1LtukrdWi/guRNxjxpr5PGGLGgRP/6U78=;20:DdsdsLWjlvtfcoQftMEjfMbZUxmLmxJg0ZOSUJg0OeZN0+qS2Q0B+UyyEvyxngUXpB0grpok/74Vrp9YEI/IqQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2015 19:05:18.1068 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB0782 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2857 Lines: 67 On 07/10/2015 02:24 PM, Frederic Weisbecker wrote: > On Fri, Jul 10, 2015 at 01:33:44PM -0400, Chris Metcalf wrote: >> In nohz_full mode, by default distribute networking shim >> interrupts across the housekeeping cores, not all the cores. > I can't really tell, I have no idea what this driver does. It seems > to be about networking CPUs but I have no idea what we are affining > here. Whether it is task, interrupt, ... And what those affine things do, > if it is safe to do that reduce affinity etc.. > > I looked at the driver but I can't make my way there. I think you > need a more detailed changelog :-) Fair enough! :-) See updated changelog to follow. >> Signed-off-by: Chris Metcalf >> --- >> The alternate approaches to this might be: >> >> 1. "#define housekeeping_mask cpu_online_mask" in the non-nohz_full >> arm in , then just unconditionally use >> "housekeeping_mask". > Indeed we are doing more and more references on housekeeping_mask, so > we should probably think about an off-case. > > Now the nohz-full off-case should rather be cpu_possible_mask than > cpu_online_mask. housekeeping_mask doesn't take into account onlining > at all. That suggests that in this case, we might want to default to something like "housekeeping_mask & cpu_online_mask", since you really don't want to send irqs to offline cores to process your packets :-) The tilegx chips typically don't do cpu offlining anyway, since we've never really found a usecase, so whatever you boot with you always have available. We do have support for a bare-metal mode which you can run on some of the cores, so you may start with fewer than cpu_possible actually running, but it will always be that same set of cores. So this does suggest that my original patch is wrong for that same reason. >> 2. Provide an accessor that returns the cpumask to use for housekeeping >> chores and implement it in the obvious ways for both nohz_full >> and non-nohz_full. >> >> The latter seems like arguably the most satisfying approach, but >> the patch below is, if nothing else, suitable to push for 4.3 >> without any further API development work. > I don't know. 1) looks easier. On reflection, the problem with (1) is that if you are in NO_HZ_FULL mode but !tick_nohz_full_enabled(), you want to fall back to just using cpu_possible_mask anyway. So I think a simple accessor that returns an appropriate cpumask pointer is probably the best bet (along the lines of the existing is_housekeeping_cpu() accessor). -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com -- 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/