Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbcCBU4l (ORCPT ); Wed, 2 Mar 2016 15:56:41 -0500 Received: from mail-db3on0092.outbound.protection.outlook.com ([157.55.234.92]:43496 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750745AbcCBU4j (ORCPT ); Wed, 2 Mar 2016 15:56:39 -0500 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=mellanox.com; Subject: Re: [PATCH v10 07/12] task_isolation: add debug boot flag To: Peter Zijlstra References: <1456949376-4910-1-git-send-email-cmetcalf@ezchip.com> <1456949376-4910-8-git-send-email-cmetcalf@ezchip.com> <20160302203748.GH6356@twins.programming.kicks-ass.net> CC: Gilad Ben Yossef , Steven Rostedt , Ingo Molnar , Andrew Morton , Rik van Riel , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Will Deacon , Andy Lutomirski , , , Oleg Nesterov From: Chris Metcalf Message-ID: <56D7537B.5040804@mellanox.com> Date: Wed, 2 Mar 2016 15:56:27 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160302203748.GH6356@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [173.76.23.146] X-ClientProxiedBy: AM2PR03CA0039.eurprd03.prod.outlook.com (25.160.207.49) To AM4PR05MB1681.eurprd05.prod.outlook.com (25.165.245.152) X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1681;2:wpCkGxfVkubcZIO4Eg62sSDQRxkuUrRkyzGajRiiK/mzJGXIzK7cYdkXjEMtaVBLgjqj+7xfGuAT4xBoSuEleZ/VBi88dxjpM9IEqKnS3Z/hFhqgkaS8jQrvhtd8VJBWLXoQ9ngF/hdRlj7DKfhz4A==;3:srJCXMGv12sgozxfXdSRR21cv8J8h1mZSPidg9j467hMaDTs+Hhq050h2ST68lFV/gSnmjS47kkjwiTM4fEdHCP8OJW02wVMpwWF9rtrbbxCXcJM37UHYjpEuSTcdpd6;25:324gktDra5PuLmwE22reqaw5ehS1JeT5nGcIertPXaAmdEaVmsxx/py0QHwRHIqmbNc0GmOB9tYeWU8ws4pyIFw8OMmJZvLSZv1wQMAc/NBbIR0rNIn+2kuCwMV8VlHPM1FBmCHiQtI5mIOYJ3fYqxcl9LVoOTOEZO9yyHSq7LOfQMkjPTxa6uf+Nc6+DQKwcpSJgcc4k/jMeDeKMqm7cS/OsT6+l/cZlITsz/f5CK3Rjw6pwZo7Ok9CeWRGxPR3NtQNToin37evjf1+5VxXZhQhL+QUJxr3FVlsWcVJzEWPO0mkWEEL2WBHknZsoCvTQrbPpPJj76JYaHpG332OwQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR05MB1681; X-MS-Office365-Filtering-Correlation-Id: 5756fcaa-57fe-49f2-94fe-08d342dd2455 X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1681;20:o5yyaZuo3r6vtdRqxVuy3B4fPR2gHvLrf8SRlNYlNbD16NYfSetQQtjQ+KLsbYjYGPQpvkRjc7J/IEK37rMOw7mAUEDBRFuc4at6GpMQ1tShFmaAugyp7jZWQauC0M7GFIefEypGCYfmmvLowbbwh3Ndum7yVCtrrBpWjwh0CGJiHlkQpM0Z/I5e5dvDtgeHE4RuaB/b+YmvX2blw7DCXl5myaUiq+P5DZGe1Jdue91o0FiC1soMg0pxGm17ZRMhDyNaBalNR28soQrXskzWUxKXb7Ewz5TFungVrYCLXdN+gzvrlJdPyP0z1Z6qfsr0/mm/H2T21A4J/0TiX0AYd8ew8w+iZgii1rXOQ/0DIyaCie6GtCbvSPZIAT6SZHk9a28WKkckwQuqq7j5OjphHUFsbJljeQ/ac7j7LCJEa0+8iPWPLMV/SyM9Ddtet+qbXsdU/kugiCKey3yxsE0V4n4x5ddvr3UDK6kDtv36aopaRmzeC4cfVQcAmE3z3Kk9;4:vM3iwWnsxrBztnlUS9THo/vTBe+NVeXzVgQ5nMdwZi68wL687dSQFMxY3o+1cgankw40GqqVzxzbOzOszh/8BEl6Gdtn0lPBDc26kv7DWmP5DQwa7WnLqZT3vQT3YpUDK7pJl23A8/8pj5k+3fneFa0In0Jlfu5vqjkHClbgReNhMEDDvbYpXoLWmq6yAhlwmtdUA4Hi14kK2X7UzfzAjFDHMb3i7q1vQdltWDJDw51+MvYbYyVGHGBrhiyoY7AnFiFinZ+OWU8wLvlNQEW9XYQguMq0DMg6geUddkuPcAERCgS3+Rzqy8WJ3AX23+6hyW4/gveKCqjMX3LKFlSuh5oFew/36RGVC4A/xXo5DZL3rveKrwWn7UDnGLC4cRpx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:AM4PR05MB1681;BCL:0;PCL:0;RULEID:;SRVR:AM4PR05MB1681; X-Forefront-PRVS: 086943A159 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(377454003)(24454002)(479174004)(3846002)(6116002)(586003)(50986999)(40100003)(80316001)(33656002)(23746002)(122386002)(19580395003)(87266999)(54356999)(65816999)(81156012)(117156001)(76176999)(42186005)(59896002)(230700001)(92566002)(86362001)(50466002)(2906002)(110136002)(4001350100001)(36756003)(65956001)(5001960100004)(47776003)(1096002)(2950100001)(5008740100001)(4326007)(15975445007)(77096005)(87976001)(189998001)(66066001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR05MB1681;H:[192.168.1.158];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;AM4PR05MB1681;23:Y/7UZDzWXM4juF9R/vrkedBCJmL4WkPRSmYG8?= =?Windows-1252?Q?rVpLFBYHFJUlLSXDZ/CPyKxH7EgkYtnXXJSJe9jWF7UZjUGzEO3aHTa1?= =?Windows-1252?Q?NhVaSppLb3HFcb2Y26FLTUinUVMePvpe6WtkyvW2BZZUXRRf5Z7O+FUY?= =?Windows-1252?Q?am20PffGATDyYUeDDXf94NWu2zopmXtYAFAXKTB0qrCLnpw7+hVuYpBl?= =?Windows-1252?Q?Rf6QxKC2HGMthR6ePImJmVNf+elrmPvJ0jd6paw4VxfMq7jPP8q/dTYy?= =?Windows-1252?Q?SBlPr0bBk1NH2n+XoOM2N774T2bl2BhkRj6pYcYhnitrOg/nV3KnauN6?= =?Windows-1252?Q?LxZSxRfVjYpxSHXjYAO2zOE/vCaNkc+RTFxx7Qwygo/XS4wKJ0AFJTO1?= =?Windows-1252?Q?GwIysmRkOZYt7LPAM8K9pIqYZaPxpgV0S0NjWLBT23bCejQrJx2mGlKV?= =?Windows-1252?Q?w3ESrmMe+e55Fg/+UZb2XygmxKFwsyHZ4EBv5ELpcTRG6Jsk+gW1kqYQ?= =?Windows-1252?Q?VfY3HrJIRsc+KpWHFG9euWc4kcgZNJexWd4mOH8Zdtmp64/N553loC9S?= =?Windows-1252?Q?ypfdmHGmYqANrOWbVcRWAKjOFbTNI6lCQZwOHG6gultyot3bCneRWF3j?= =?Windows-1252?Q?9Dq5TWvBPkwmN8pPDXSmxfzI/S2jsma129Ok9asKwhaTeXE3BAThhNzE?= =?Windows-1252?Q?YK+KUOi7LjM+ubKgYX4pTpFOmHiM46Muj1iIiCuviG8AcgW0YnhyArfY?= =?Windows-1252?Q?Jiq/52ikEcbd+YJpetamUhINwf74CuqJM0XZ8a3/SMcyoYmoqjJRx9ze?= =?Windows-1252?Q?1oqhQK3RZ5N1SDJo+zYhmkK49IOFh+ixGtKdQK1GHwj1hMqEDUT2ZL0M?= =?Windows-1252?Q?uJ75GE/ik5VW1F4hJdJkJydqe7e+1HSqpclKTljOXtAIFf1KszeJVrY4?= =?Windows-1252?Q?8Az5EC+2d9hgJAXNr5a6TtC9HOVRXrBLe1r3AALiWuHZ6HpbXRpPnQlV?= =?Windows-1252?Q?BmHb4sMJRIFad7enEMLcpPmpcACpHBbe1/jmBHECw0Mgee/gyKws5jYY?= =?Windows-1252?Q?c17XyPDhsMH2W5edAD9WZYEz/eH4pGoIBQ2lROsrZkg0oXGBPuQ3pVDg?= =?Windows-1252?Q?FSm0groQjFqsBZJLtlu/xGUMFIsraaR0xuQjfpohMcYX6atjqhX7+j6S?= =?Windows-1252?Q?JYBJBXyyjfuEOizi5ZEm2dCa37TLaGpAitmfYPmx2viGD6klN8efsbI2?= =?Windows-1252?Q?BiAvuzzgO/xdCHZrHU5RitGlfVjqrEihdz+8UU=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR05MB1681;5:Wz3R2l2YOLnYXjtv+Tmnn+kQMRXul8gIwEFiIg4bLzAl1nVBbSKQev09czwPqkvN2NYti13zCXLnhh3qiXU3oi9vF7947NSRWbtko3FyKPlKBxG5471VOYamo2uyhjAeZQ/I+x7aY+y46gaYUwBPLg==;24:Ch0KvOJhJru5H45Z+fecNtqf28Nb5b0KHjGz7S+IxNYqOphDYceHUDV5VuJrOFKOTqcpG3+57UiQLWFX3zQgX1TrOKcWcbeAxr+cyCHyOis= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2016 20:56:33.1977 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1681 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1053 Lines: 29 On 3/2/2016 3:37 PM, Peter Zijlstra wrote: > On Wed, Mar 02, 2016 at 03:09:31PM -0500, Chris Metcalf wrote: >> +void task_isolation_debug(int cpu) >> +{ >> + struct task_struct *p; >> + >> + if (!task_isolation_possible(cpu)) >> + return; >> + >> + rcu_read_lock(); >> + p = cpu_curr(cpu); >> + get_task_struct(p); > As I think Oleg keeps reminding me, this is not actually a safe thing to > do. So what's the right solution? The fast path in task_isolation_debug_task basically just uses the new "task_isolation_flags", and "pid" and "comm". I would think those would all have to be safe because of the get_task_struct(). The piece that might be problematic is the eventual call to send_sig_info() using the task_struct pointer (called via task_isolation_debug_task -> task_isolation_interrupt). Clearly this is safe at some level, since that's more or less what sys_kill() does and the process could similarly evaporate half way through sending the signal. Suggestions? Thanks! -- Chris Metcalf, Mellanox Technologies http://www.mellanox.com