Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752412AbbG3TxK (ORCPT ); Thu, 30 Jul 2015 15:53:10 -0400 Received: from mail-am1on0053.outbound.protection.outlook.com ([157.56.112.53]:41024 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752148AbbG3TxH (ORCPT ); Thu, 30 Jul 2015 15:53:07 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; Subject: Re: [PATCH 08/10] posix-cpu-timers: Migrate to use new tick dependency mask model To: Frederic Weisbecker References: <1437669735-8786-1-git-send-email-fweisbec@gmail.com> <1437669735-8786-9-git-send-email-fweisbec@gmail.com> <55B26E74.5040803@ezchip.com> <20150729132343.GC11554@lerouge> <55B90C40.5090000@ezchip.com> <20150730004444.GA14744@lerouge> <55BA7C6A.1050602@ezchip.com> <20150730194519.GA24607@lerouge> CC: LKML , Peter Zijlstra , Thomas Gleixner , Preeti U Murthy , Christoph Lameter , Ingo Molnar , Viresh Kumar , Rik van Riel From: Chris Metcalf Message-ID: <55BA8096.7030601@ezchip.com> Date: Thu, 30 Jul 2015 15:52:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150730194519.GA24607@lerouge> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [12.216.194.146] X-ClientProxiedBy: BLUPR07CA0046.namprd07.prod.outlook.com (10.255.223.159) To AM2PR02MB0771.eurprd02.prod.outlook.com (25.163.146.156) X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0771;2:c9PWm9Fm/npXC22bTTQcudHHfN8DrOO3UbkqEnF9p73NH2Cq/Nv/7g4Sx1mU01osErRZd+zK353RcJoK0d6Ml/P7X0InMWqzhEuFBOpHSNrCMZxEvd5ehOSExXcYhLS+a9CUijW6V2RkOHKpIklK9Al1vAwpcU+UrAHUlgZHmRg=;3:0CyhPhAII/2xh5L187gEzkE9zHQ600T8xVYfdqhEXHfbxY3cIJZVcTCitn6YVcPstMySgzmClovr4icT9O7AV1J0NB/on72Mr0rsor+5toZxlHw87Gw5B5tP9VQyYMGuqQ+vSPcY9hpQEasqiH/qpg==;25:mZWo8BH502HPquNXvm5MYLcX5QjQ1Xox/OzZxB1DReRm/V4cVr2vvaq3b3bzCYKjW8hCfaKXSTPTTjQstQVNLzGidsZXNwZtJQFVgQyjqY1SkWLLQfg6jH1Ah9RsiIChsWXYkJpqVksNoxRWQyrFwvnkA635Ln3EaGuK6Gm5EItY7iEQuwLR8ZJDgdnA0V+rGiV/Fm3GKmV02tac6XRj1NpUjzF2cib0Hgmt+Eju+Mdf3kdhfSMEuw9e20l2O3g4j/FMRP3Sk73X4udMnLnuOw==;20:75adVxrBkbV+sFqB+UCiBYRsS9uO3TGDp6k+NfJuY1QW4gWnmjf3LaC55IqviWRrG/AXlR2q9kDqC3QCMjf3RVAjG1+e6tollp0ddh4SSF/bpJcYqyTYu/3NmR5S0pqEzVv9/tgByXRlc3FjHpCaMi0IDAnE+RqNYME6NqSQlxg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0771; AM2PR02MB0771: X-MS-Exchange-Organization-RulesExecuted 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:AM2PR02MB0771;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0771; X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0771;4:1N+EL26onhiQBpIR7laJ2JsnImTPxcruiCziPqJTlZag70KGAl/jNczLpLdKaH5C5dD+13UmR/rlVJyC1MPfm2IKeT2j8n1Nu9sYLqeCzhU0ZG4CizQ0cvhHYniptLXiQV9wAw4umWxHtR+5TAIVK4LtMhJhAXEcPzcLql/NmoZLT4QSpeY8w2HMO2EjNdvGkdq3P+C3e4rLnY2AilPfot91BY45ym97gYz0UqeQd/2JkfAOzdfsYn9uWBNmOz2kHVNdqfZM+oAosVpQCWihKWDk8B98VO19Hfn+umRvJmQ= X-Forefront-PRVS: 06530126A4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(6009001)(479174004)(377454003)(24454002)(36756003)(110136002)(50466002)(76176999)(54356999)(65806001)(83506001)(50986999)(47776003)(1411001)(92566002)(23746002)(93886004)(42186005)(86362001)(33656002)(80316001)(122386002)(15975445007)(62966003)(19580395003)(230783001)(46102003)(5001960100002)(65956001)(189998001)(77156002)(2950100001)(77096005)(66066001)(4001350100001)(40100003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM2PR02MB0771;H:[10.7.0.41];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;AM2PR02MB0771;23:DIz0jeNii2yFvyc2Rn/gyVN/ds6wDlMrYfvvF?= =?Windows-1252?Q?/Jq+XnoMACQLS/5hOhxtIymzt+RQvXjTY+efapX4xVp9IAv9YUcJdLrL?= =?Windows-1252?Q?w2Jfkc6aHuCqs1kfLqN9O9BfgD3ji3tDjFtOcBs3iW4m6hNpiZh0+B2x?= =?Windows-1252?Q?0Z2Up6PYpj/bNej/iGqnntkRFyiwSikQWX4vsWcScL0/kOvSKpQ089Sn?= =?Windows-1252?Q?5zTAyd19VexJlfS++FqVdsi7q/C6fyK8aUcPMByNNFhtoejERcvpKPst?= =?Windows-1252?Q?1m1i9RlijFmgEq2iDNbXIIyVP1/3GpewB964Bh1XzfZ4TgVzNJSC4+mU?= =?Windows-1252?Q?rk952rKvSWNyFzVyZWibv13HG7m3kv7DYmEh6Seg8uyyBrB/82fgcFc4?= =?Windows-1252?Q?2z6IAsNZXB4XWnOTXw0B8awvXEJaCStMuP3E0eKIRxwxT581yxlrMXjN?= =?Windows-1252?Q?2RpG5t5ooZsxJ3Lnqc6EuzCb7lffv0J06UW6j4Hj414tdV0c5ZoM/Aug?= =?Windows-1252?Q?HLUd1mleUMpi5KCuuz94Jvr4Cjgi24wjhZ+8jjP/QJsFLnwdypyECStL?= =?Windows-1252?Q?q4ilAjKDa/7ELMOwem1H8YXDgtXeCfRIZYMZHVP6YnY/dBazDc+qSwDj?= =?Windows-1252?Q?rbqkIul0aODaLPuzTmKBoT/T/aEE5gEMcLk+tMMaAVbaKCkeXH0dE+91?= =?Windows-1252?Q?M045oko2Msxw7N0uEK5ORZ2QLJatndoxOmX2yJvVhU7haENg2SwelZMC?= =?Windows-1252?Q?whQYUYBRXuicYGnlM/bt2Eu8TnpxKlM+ivd8auds00rlDb2Re17XHnoK?= =?Windows-1252?Q?quiWO1smSSd1bB5O/cyJvhfFmOORTZpmjLR1xfUld1VBg0nhuPfFyc8b?= =?Windows-1252?Q?qwUREib863BNpviZlaP506I9Ig8kwhROyi3ixao6Q8OxbCJ15zgN7rou?= =?Windows-1252?Q?c5R117o1mMuC6LlNk+1Qs2o4TlBzSqGjJYMXJaGSJgI6cAqVCkQFpOM5?= =?Windows-1252?Q?KlI/wDTkBA1p1VbH1LWSNw5PW8Q4oBPsXI8Ku28kkTdwK1bQ6r0WuuNC?= =?Windows-1252?Q?oDegeoduo+zuP4=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM2PR02MB0771;5:tUZjLnaSdArqWQIAayW9noiyt2LdsF1jpJ4uKzSfaSzGQ03Htc5/o9waw+Xpf7VB2jIFbZb4niRuQfgXnufV0MD43lYmJrlZeCyem1Vld+dcT4CQz075R03Pi99ASHBGzj6ph5quuSk+T47BAiH/RQ==;24:5C5SaBovW4w0KN3g97a1De3eLevzhcmmBqT+PBwTyDvwWEjccJPDDJG69cptAcuYxqVMqpjLwfmV+toAY4X2RFcUxYLKKPVy0NX+8lAa2Yw=;20:p3YlDoGOZg11D14/8ndkTTMdOw3g2O77GB5zWBw9CtcNjlFHkRvsowELqJ0kdSjaSj0esB2ni9G+ELdjbrqaIg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2015 19:53:02.7401 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR02MB0771 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2341 Lines: 45 On 07/30/2015 03:45 PM, Frederic Weisbecker wrote: > >>>> You mentioned needing two fields, for task and for process, but in >>>> fact let's just add the one field to the one thing that needs it and >>>> not worry about additional possible future needs. And note that it's >>>> the task_struct->signal where we need to add the field for posix cpu >>>> timers (the signal_struct) since that's where the sharing occurs, and >>>> given CLONE_SIGHAND I imagine it could be different from the general >>>> "process" model anyway. >>> Well, posix cpu timers can be install per process (signal struct) or >>> per thread (task struct). >>> >>> But we can certainly simplify that with a per process flag and expand >>> the thread dependency to the process scope. >>> >>> Still there is the issue of telling the CPUs where a process runs when >>> a posix timer is installed there. There is no process-like tsk->cpus_allowed. >>> Either we send an IPI everywhere like we do now or we iterate through all >>> threads in the process to OR all their cpumasks in order to send that IPI. >> Is there a reason the actual timer can't run on a housekeeping >> core? Then when it does wake_up_process() or whatever, the >> specific target task will get an IPI to wake up at that point. > It makes sense if people run posix cpu timers on nohz full CPUs. But nobody > reported such usecase yet. The corner case I was trying to address with my comment above is when a process includes both housekeeping and nohz_full threads. This is generally a bad idea in my experience, but our customers do this sometimes (usually because they're porting a big pile of code from somewhere else), and if so it would be good if we didn't have to keep every thread in that task ticking; presumably it is enough to ensure the timer lands on a housekeeping core instead, possibly the one for the non-fast-path thread in question, and then the regular IPIs from wake_up_process() will be sufficient if for some lame reason the signal ends up handled on a nohz_full core. -- 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/