Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754867AbdLODQv (ORCPT ); Thu, 14 Dec 2017 22:16:51 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:44102 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754797AbdLODQs (ORCPT ); Thu, 14 Dec 2017 22:16:48 -0500 Subject: Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints To: Peter Zijlstra , Teng Qin References: <20171214202044.1629279-1-qinteng@fb.com> <20171214204932.GH3326@worktop> CC: , , , , , From: Alexei Starovoitov Message-ID: <1632e487-ee65-b50d-85e5-82f42c69fea1@fb.com> Date: Thu, 14 Dec 2017 19:16:00 -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: <20171214204932.GH3326@worktop> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:180::3bdf] X-ClientProxiedBy: CY4PR06CA0039.namprd06.prod.outlook.com (2603:10b6:903:77::25) To CO1PR15MB0966.namprd15.prod.outlook.com (2a01:111:e400:7b64::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ce03644-9714-4741-414d-08d5436a2d9b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:CO1PR15MB0966; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0966;3:mf6FlFtyMl9syTjELapM9G/7kunyR71dZ2Mh7A8tVnG15JuxLWb4zK+2e/9H1Qn1Cw+P0lsPcxaYrGdCZbjVLmv4pInh+evjVYK2QFluS0diw1Q1GakLoqAQAQ1924k6nunTig3UqGHvE2JLJWC5hhAnjcEZLMqSrvbM0xCOKOSRPqz1O30W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LanTW9iN9s13tnEFtCvAUouWTwuFspkvvYuiu+W30rMvsyoJztGXDKjLj0NFXxknRa3kimdKt1bfOxM4riq3OGm4+Yn34P/riZWmythKzj38R81QWYqSyfZW4Rv9IO0rQk/OSsOixKdBkLEQs5pp9syK9uTs1quSpqnoNWFo;4:JZ4FAVEgBTOSv5qZ80n+TfcY63/w7miWxMmZiZlYbuGqlubkQD7TYrsYJCD5OoQmczYKTgwcaCRMfABkosLB3wD7T1OYi7yHjoYFftkiO6eqPSqCKnhMpM7AP3eR0IfAgNoXwVnOTmuUcHY5sBxMiWUjGmlpS54f9rQRgRCnBmd6OjVppLFBuSc68r+bZAy0wGXtQ7rhHH6Oy0wMKT7OLTPENZYeLDQM537FnYcPruuegTCFeUCnX/Lkm835SHSsu2pNQ01oN27eVqezZhhhqg== 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)(93006095)(93001095)(3231023)(11241501184)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CO1PR15MB0966;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CO1PR15MB0966; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(396003)(366004)(346002)(24454002)(199004)(189003)(110136005)(58126008)(316002)(386003)(97736004)(6246003)(65826007)(53546011)(106356001)(53936002)(5660300001)(47776003)(68736007)(8936002)(31696002)(4326008)(6666003)(50466002)(86362001)(23746002)(5890100001)(36756003)(2950100002)(230700001)(52116002)(64126003)(2906002)(478600001)(76176011)(229853002)(6636002)(25786009)(83506002)(67846002)(52396003)(1706002)(7736002)(65956001)(6486002)(305945005)(105586002)(65806001)(81156014)(81166006)(8676002)(31686004)(6116002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB0966;H:[IPv6:2620:10d:c081:1131::10a6];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CO1PR15MB0966;23:UZpWOknWW1RtUURyPcjHQGvdNETF+w9B1ONfk?= =?Windows-1252?Q?3kUI/k8PDV3ZiGcy2V1MpA74LXQ/jksHAjYbthFVtWN3h5e3SJXzVTyD?= =?Windows-1252?Q?ByicJct3+cV+ZPFsTSfjJpt3ZBOStSaIo4q/Atn/KeuKpcacCE4j8LcX?= =?Windows-1252?Q?835ZT83QGAsPiPHPzJWQ1cj053trUl5RzVx3+2Tv1nlECKRFX/hvkp60?= =?Windows-1252?Q?Rz+sU+6BAMV/GzVK+E0P9WEwQ2BtyzkZyKRDaKXTpgznEbbNoAoaeGRT?= =?Windows-1252?Q?U0/LlLhbPexQzicVUejIWsSltTzKsURhFJh3I18up4WLm0HMRuCisvvE?= =?Windows-1252?Q?wB3BeLhbZNXt949Ysy1xRjx/4XYGZ5XrtIX3vpkcVyxwS40v+IzwU/AT?= =?Windows-1252?Q?v+Dk8TUc7hYefQg+w73NuhkOhaeb1FGTWnSCSwwk6ZRNg5WjW1lbzvhc?= =?Windows-1252?Q?3yDmBcQB8nxZQq4pMfXIaqrHKPvxgjD5U0g2oVMJ3KRXJXX0ytDmr56j?= =?Windows-1252?Q?jn9d2qkwLb53jleqJokw4o7p9V1KoERCecNa6iJijqk16ahXMBh+jP5p?= =?Windows-1252?Q?Ou/EAeBItJ3+TEGtpMhQYXAFsdc5C4a0mkf+5YD1xlnBgSI9oWRf7zwJ?= =?Windows-1252?Q?i0tb9HbDGo7fQmUsPl8jyYP/B09RALEj1S4E1hEWo9rQparAzYbw2dx3?= =?Windows-1252?Q?asqZsyDFpZon8vBpFBkB2oKKJKnOFTIYDOEh9PLAGWA1E9qmFrNlqQlG?= =?Windows-1252?Q?7lVgsYImRLTC/IOi/N0DkaPhrntYy3YqqtPuJCMepoDfg7Sy4co3h8LW?= =?Windows-1252?Q?NTz2TcXXW8+NoGEMVYt4ldkzxl6iHJfFTkG0w3j8x2Nh61LHsmqIuTRy?= =?Windows-1252?Q?2iLw1oG6vnmAeV2N6SnAcYZTLekX3z21uvu8ShoCeNu/p7mgUZ3c8O+4?= =?Windows-1252?Q?TLNzfaT+a38mY1eZN/VwYRYamVHFS2wg6xaJPNkyO49/CsCPKrFcnsrZ?= =?Windows-1252?Q?XHKU1DCvo1YKyPnHxCHSzuA+ouiozfj5cSb42HYsbi+H/XP3VX6j1XzQ?= =?Windows-1252?Q?Q2fyXsXs7vGlj5Vv66fqGKTAmlWKN2fw9DUhi1v7Xm2NS8nAJp+DIj3z?= =?Windows-1252?Q?xVU11DH8ajia68ptTl+hkBq+anRl33TaJ6h1HAe73ecpkoJSZSxDo5CJ?= =?Windows-1252?Q?zchZluQ1L+pfRokPIBGq08CHIgkKfkLsKkYztonadLKwg1TX6dvQoTzr?= =?Windows-1252?Q?uchF9/9xGzsyXfRz8ru0bTJKe8qAsu98UtovUk3bC+RqHm4KbluNVF5y?= =?Windows-1252?Q?piI7q7jW11D/e3ZEBXR4NHsVAXIAkchX2RjXVdvXJoxaQyJ8yz2VQqZp?= =?Windows-1252?Q?zPlDM0nNYCqBDzRRqRoJecClSMaSzZHIA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0966;6:GzQuEI3HdKYpMF4qZdqsLr+14bDvsQRp1VYQEL6cO+vJ4SrIt40+ch9vSi9JiS9tT/NaI79wAl5wtRpSQvVvFTILszIoNQABGsAr3qarVCHl/SYdUl7t4dDViUScSAP+b9TMI2mQfgGksxgJkEMI+wnQJEHG1Vx8iBQl8kvTfLqDrr281Ky0jdBy0WTn70L8sHIjIl41mH6V9yh4fw88EJLWXPq3cjxKOTgL5WpzamCMiIq0OJdAREC9Lbcc/pZpatJp0FpsFHZ5Nd2uNsyhSA4UYkQ30r5H+JI9rMJ61xWOECGyOyknqUQ6D6I/R470fKSie9Vb04JOUML9RhFAc2fC/V9EKI7Suaw8iFz5nNs=;5:ePlPTA2L4GTsrPIQLDh95teUrueNc2BQUcNrAAbS1/S6eAXlaVhKH1Lu7GfBvySsa1fiV2hlqNA5OLbkvSMS6bL5AU2MMvXtTDzbCq3aL1kq45tvXE8vSAQFq5LomVZZbkPtxQkJaL7lg/nFd6/rJIJtpO3/CiPDeynPQRjBJt0=;24:DD3XzEcW10/DJlSXgTBv4qc0BOWO07Iu3DpW13j8sann3gxYVOuvSSPU/lV6/JmwlO2tuboVtJF+HDyoLhW9raUuBUXUSSXeCjw09uI1aAg=;7:jgijNADwV5djFvZiDUkPbCsP+HidpEMulPt5fxvGtmCLigd35jeNhyXeqNSQSvgqnho/yY5k6qyMXV2fZxVWEubNES0fi0ysTMq5KoeW1iehs+VT75AwWDuABSL0dXCG50M9S16XCJebwfdnuZ0BQbWOHfVmlmpgtd0KNFdBqWsZ3NJqKG8u+CI8q4A60SnBvzusrM2T3V1WpzBeOmsHp/hKUNKVRMQ4X/GOe5kyT7wwa5dxfVzs9dHnqFMmyP/a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0966;20:Kdrxrv2M5ByiUq7aTqo5+GPOkauzlIO0JOLd8TSxdZ4oHEQmwN4BMog1wM5tqgdGllJHWbBVyPwEkeDebkPtvFqpqo09Dz04v8ONyOrK16THN/Rp/YsH8tqlgD/hlFsa/clagkzXYfcP0rejivzH40msKyTvnOjTBcWUkoVFmzU= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 03:16:04.1974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce03644-9714-4741-414d-08d5436a2d9b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB0966 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-15_01:,, 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: 1659 Lines: 34 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 ? preempt and group_dead are bool and clone_flags has uapi defined flags, so no kernel internals being exposed. Two task_struct pointers are unusable outside of bpf progs. There are plenty of other tracepoints that store pointers to kernel structs and bpf progs are looking into them. So nothing new being exposed here as well. Note that TP_printk() kept unchanged, so typical user tracing that parses trace_pipe won't see any difference. Apps that use binary apis are using libs like libtracecmd and also fine.