Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755857AbdLORKq (ORCPT ); Fri, 15 Dec 2017 12:10:46 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:60104 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755624AbdLORKn (ORCPT ); Fri, 15 Dec 2017 12:10:43 -0500 Subject: Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints To: Peter Zijlstra References: <20171214202044.1629279-1-qinteng@fb.com> <20171214204932.GH3326@worktop> <1632e487-ee65-b50d-85e5-82f42c69fea1@fb.com> <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net> CC: Teng Qin , , , , , , From: Alexei Starovoitov Message-ID: Date: Fri, 15 Dec 2017 09:09:51 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::4:40b5] X-ClientProxiedBy: CY4PR1101CA0002.namprd11.prod.outlook.com (2603:10b6:910:15::12) To DM3PR15MB0972.namprd15.prod.outlook.com (2603:10b6:0:10::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96b825e4-c3ed-4f9e-7a30-08d543deaaa7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:DM3PR15MB0972; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0972;3:AuW1l/6tnyovHHg580uwrOVYU+88zEueT0W5PhlxQXXISaVYjHiNk7y1ofMufdpm1lclYsfUMZl+znwKKbu7loQAwdbPWTaFJAAKPlOC5N7Vd8SafXbg3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vI2Xnyl1BiFRqWPk4ybQ+uACOsVkpXC/OBfSUW0pS63uIGK5Bx6qr82moaFeyKm89dlmqxD4MdGp7X+SiK8gY18kaL9gp4ikyQob8p3RuKOY7MLsRHS1sY/k4MGV8JkLHlwW29SnGgcKtYHhA4es4Aky7/D6ARt39+pASW61nr+nTmvkTzIj25j94B6TAFgZ1e9ss//cGFQtofXq6QjDKciKtCLVXwBPt7t;4:6qOvSFryjyJuxoKZeru+jtXyjBiLQynW55t8S3gCxePi7Evg36oAuvUjXtogigwpSUuow58Zn8kuaoq6smntgwsTCUOutY5iwpMc26ZZ1u5FWQxLY9dqplXSPH7o22ZqaYp/mVwpkD95KAN0HY1bo1aq5FxyyvUojYT/Jwj3QdZoRBI38wDrlkfYywake8Y9+1Ze1fMfWG0pjdj5yKkbAhxGIZjsDKTHRdGeLI5o98N1ycMMn1a/OtN9q0kvqeWTl2dLF3fd6gMD+u2akXQZWw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(11241501184)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123558100)(6072148)(201708071742011);SRVR:DM3PR15MB0972;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM3PR15MB0972; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(376002)(346002)(39860400002)(366004)(24454002)(199004)(189003)(58126008)(31686004)(2906002)(966005)(6306002)(1706002)(8936002)(230700001)(64126003)(53936002)(6116002)(305945005)(478600001)(6486002)(52116002)(65826007)(5660300001)(52396003)(36756003)(316002)(25786009)(23746002)(68736007)(8676002)(386003)(53546011)(76176011)(4326008)(81166006)(65956001)(47776003)(229853002)(65806001)(7736002)(50466002)(86362001)(93886005)(31696002)(6916009)(83506002)(67846002)(97736004)(6666003)(6246003)(2950100002)(106356001)(105586002)(59450400001)(5890100001)(81156014)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB0972;H:[IPv6:2620:10d:c082:1055:50ec:796d:ae79:7849];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM3PR15MB0972;23:sj38A3wj8uFQU7L4WheYauaqtlgwAirQOybrx?= =?Windows-1252?Q?4zDcU+YExe7wx/kG6vFr453+ZwXydeIz2gxG3OzTEukaZ1Qvx1CCYlZe?= =?Windows-1252?Q?vHPcHqpJMyz2SOM1rbK9cAbK7j+fWqH4BkQItcIcMZBx1n4HKx1+AFHU?= =?Windows-1252?Q?dMUqWK+SDJXxAH6SeW4J/w4xq9wzOg3tDNQWfwLDAKAM814T8XTch4Ea?= =?Windows-1252?Q?NxoXJAUh3tD6+Wjnbw3psQE1s6L+o8lxOoKSd2KZCqXdYrT3P1yAn6P3?= =?Windows-1252?Q?lc2Rgk6jvMUY83cn8WZxiQqUXICanln1MNfEOaMK0aT5Las+4IAVudCY?= =?Windows-1252?Q?T6Tzs9QJ8PqePi/N4qcWEVDcTO2Ltf+8nf6/DimNlX/2LjJTcvtaW7nN?= =?Windows-1252?Q?QhUVGNLQM8TBpNjduGpCexn0BnSjydnQo8FHJQzuG9OYv8OTfVRTFv/c?= =?Windows-1252?Q?aazzKza4OTQwhfVP1fgSwbC5xcyBZ3CnQMH9z3LXKEIJ3v8NYHJ+w3Mt?= =?Windows-1252?Q?KLUtfTbRPz2GU2MaRu5Tzf3f3UXOQEoVXrWjFHkIkusaJiuOz7v02S0c?= =?Windows-1252?Q?wK62O+ATd7Rp8eamHWSt9UsAySCRKflO/CBIGjz+Scp/8nU+/8BrbV/e?= =?Windows-1252?Q?6lsZm+7Nsnohkz/HHbPKCCWYJzvuPjFBim8hLI+md0rcv3yIXNGD/Oic?= =?Windows-1252?Q?DKj118XaOY8PIb/g+fpQnQpATWFPNJAsqKt1fBiTMvNgSfUBfDMyZnoe?= =?Windows-1252?Q?VEiGdZuTzuld6xtSiCsy2lRU2oZ6VkQrbDAoKAZGnRSo++CbiOXP/GsO?= =?Windows-1252?Q?1En7aGhOwTTgneUzE88et1BwXMks0ErBAc0xcF1mu9uOggU36u6GOljr?= =?Windows-1252?Q?0hF9xVs9cBpbFUpNJ5lHq3B1KKGgd0u1j3jNnEbj3INrqmBSLV2DjvVd?= =?Windows-1252?Q?0I2ZFDqlNlmnOtd8Xuo/qyEKMgcHQ9JmLa5BAoQhjnoAJtIJHTM0AtNd?= =?Windows-1252?Q?HzFiAts5jUilPxZSYAQ+y5MAZlluA/D+1c/zfNWXSEI0BG+knqjuh9Lp?= =?Windows-1252?Q?LVVImwZtl9671fhbRCgSe5sSbeouWSWPd+RB7EoMVMbs22TKWt3U2f+j?= =?Windows-1252?Q?MPPLReN+MIg4Geav2tvvgyOBcOWb+MxiPzke8/PmXggt2p92+dF6oxWZ?= =?Windows-1252?Q?W7dNUx6ORM1x2iJQxrR+qC+84bSLVweloUdRsYpHEQHKn60Du1FiXbjq?= =?Windows-1252?Q?FcPiWYDgOiEtWsMKwpPF7ldEbzzGw5mXe0r+etOXCEQuVurQCoYhnLqW?= =?Windows-1252?Q?cF3vHOCg+f9sP+a7MXcBOTRePNJmhGAPQA21wo6wuwewb6pw/XfIQAkq?= =?Windows-1252?Q?sOjYfLCCLZg2/IcLkV7nr+ZVz7cyZWgEsMn4ZLyMn786u7iB0GhTVWH5?= =?Windows-1252?Q?8P4kdSdynCtSo8k3PaD97Wak5IZ3yZLf+u1/hrnFQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0972;6:HQ2fjXkCyFJkTNZe11oMGc+9tlchWCuCx0N2T25BJ7Rp8vjd8Gz4m2/LK+/sx9RHgwH0j7xiKrlyGpRmDR2cC6lyL7btPecRS3rgFndLF8hiGEOlee1MaMyG+Bxo73bZnjs5HoZ0Ss5dtrDQO7w8kKlWbWgaHCZhNOpCdskx2B+ElDNKvUoShoHvRN5GjtRae1nkOzAEybKcmI1inuUlgPxxEyhpwPimSYl0UfkI7Zhz55nll4X++IgKt4eEztnzf2KNk0uo4xqj+sRJ+YzF4azT3SBOL9NgJowyo2aSacJYtG60OX1qJdqXpXSGLbNG5llnKwNUaD4n6I0MZr60FsWAg94UO5HU6+/6EjTPqAE=;5:YdbzD7ajmknk6MK7ywcrTVpCe1lUm8n9DvEHQgW2MrSg57NEKirsQiQuXXOnk5QbNH6rVqWEI+Xb1as32nRcy4ZiCNORLVT/ZA0WFC9mhW1d6iSt/qLoNwP440/W9RCDl4d075tHYtux3DmHHp3BZ0mQkPl8q/6mnSV3rsc0RTA=;24:SMt27uMCxUjM/ZSFOc/NYLYVJPm6S2t+b5RjLF9/ONdi0wSqgGyYWbp30fDQ6rfNRlZcNZ3jUTXsRnASummfPUwYowPMfoIobWSuoNRnvhY=;7:sfLRbozSVWC5WOJofXz41bYLwUEE7L4NbAMqw1WsVcFpged7UnlzqdNRn8kJCrdnyutfLuMJ2B5JIHGCP46HbG+VpNhKJ8KCroKmUgrjKWn2H2r5+JfRJT4sDoncdAkaZ0sCmZH2ngEkVz+rzymjGJGPzco3juUmTo1gPWSGmuYmMV2NNbA6AK6G/PH1peF5puJ6h6nvvkh7detD/EBf8V6kRBBd/errdCt+NRf1HsxPKYhKgDRGXlxYUdsnYzZI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0972;20:dKy++WWznXIIiqNTD9fm6ILPea/Jy4syYbaQIxWionVwZHq5sDX7kRAodA0G5kdusyHAettXLE9I/+qLuEYReClLsI+rbUqBljsLwUjkyVLVjdKFPt/TT5QGqIQDCYAL6FfrNLR1dgk9mzjerUVS5JMSZP2Wfk4z41SMFXP3f4c= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 17:09:55.7383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96b825e4-c3ed-4f9e-7a30-08d543deaaa7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB0972 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-15_06:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2625 Lines: 63 On 12/14/17 11:39 PM, Peter Zijlstra wrote: > On Thu, Dec 14, 2017 at 07:16:00PM -0800, Alexei Starovoitov wrote: >> On 12/14/17 12:49 PM, Peter Zijlstra wrote: >>> On Thu, Dec 14, 2017 at 12:20:41PM -0800, Teng Qin wrote: >>>> This set of commits attempts to improve three scheduler related >>>> Tracepoints: sched_switch, sched_process_fork, sched_process_exit. >>>> >>>> Firstly, these commit add additional flag values, namely preempt, >>>> clone_flags and group_dead to these Tracepoints, to make information >>>> exposed via the Tracepoints more useful and complete. >>>> >>>> Secondly, these commits exposes task_struct pointers in these >>>> Tracepoints. The task_struct pointers are arguments of the Tracepoints >>>> and currently only used to compute struct field values. But for BPF >>>> programs attached to these Tracepoints, we may want to read additional >>>> task information via the task_struct pointers. This is currently either >>>> impossible, or we have to make assumption of whether the Tracepoint is >>>> running from previous / parent or next / child, and use current pointer >>>> instead. Exposing the task_struct pointers explicitly makes such use >>>> case easier and more reliable. >>>> >>> >>> NAK >> >> not sure what is the concern here. >> Is it first or second part of the above ? > > Definitely the second, but also the first. You know I would have ripped > out all scheduler tracepoints if I could have. They're a pain in the > arse. > > A lot of people want to add to the tracepoints, with the end result that > they'll end up a big bloated pile of useless crap. The first part is > just the pieces you want added. > > As to the second, that's complete crap; that just makes everything > slower for bodies benefit. If you register a traceprobe you already get > access to these things. > > I think your problem is that you use perf to get access to the > tracepoints, which them means you have to do disgusting things like > this. yeah. Currently bpf progs are called at the end of perf_trace_##call() { .. regular tracepoint copy craft perf_trace_run_bpf_submit( &copied args ) } from bpf pov we'd rather get access to raw args passed into perf_trace_##call. Sounds like you're suggesting to let bpf side register its progs directly via tracepoint_probe_register() ? That would solve the whole thing really nicely indeed. How such api would look like ? Something like extending kprobe/uprobe fd-based perf_event_open? https://www.spinics.net/lists/netdev/msg470567.html btw could you please apply that set to tip tree or you want us to route it via bpf-next -> net-next ? Thanks