Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755140AbdLOIy3 (ORCPT ); Fri, 15 Dec 2017 03:54:29 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40000 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753868AbdLOIy1 (ORCPT ); Fri, 15 Dec 2017 03:54:27 -0500 From: Teng Qin To: Peter Zijlstra , Alexei Starovoitov CC: "mingo@redhat.com" , "bgregg@netflix.com" , "daniel@iogearbox.net" , Yonghong Song , "linux-kernel@vger.kernel.org" , Kernel Team Subject: Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints Thread-Topic: [PATCH tip 0/3] Improvements of scheduler related Tracepoints Thread-Index: AQHTdRkZHKMDTTHuv0OHRgDZuT83S6NDT+MAgABr+gCAAEmFAP//jqqA Date: Fri, 15 Dec 2017 08:53:30 +0000 Message-ID: <935FB65D-395D-4122-8E40-75CA04FF2111@fb.com> References: <20171214202044.1629279-1-qinteng@fb.com> <20171214204932.GH3326@worktop> <1632e487-ee65-b50d-85e5-82f42c69fea1@fb.com> <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net> In-Reply-To: <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2620:10d:c090:180::40fa] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN2PR15MB0976;20:Ba0qKjxQo1CjfQUeirUjkXcjK+mgeH6C/F6Ocs7f+3Vcc5K0K9vZtwoAtn4OoLKYwbMgFl+YnYNQpa0pdQUxMolrjGuwQ7GIjT1O95NRK1vz9Irgg8SmX67uVhYm8Vu+HLK+I1WOtpmms4k4SGVkSjKpvKfhBL+4GRS/ZmsId14= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-correlation-id: ed3144f0-5085-4e0e-d666-08d5439950ba x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:SN2PR15MB0976; x-ms-traffictypediagnostic: SN2PR15MB0976: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(11241501184)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148)(201708071742011);SRVR:SN2PR15MB0976;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:SN2PR15MB0976; x-forefront-prvs: 05220145DE x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39860400002)(396003)(346002)(24454002)(189003)(199004)(110136005)(54906003)(53936002)(316002)(33656002)(105586002)(5660300001)(106356001)(86362001)(2900100001)(478600001)(4326008)(5890100001)(102836003)(68736007)(93886005)(6116002)(3660700001)(97736004)(83716003)(81156014)(77096006)(81166006)(3280700002)(8676002)(6512007)(59450400001)(6436002)(6486002)(14454004)(6246003)(25786009)(82746002)(8936002)(7736002)(99286004)(36756003)(229853002)(2906002)(76176011)(6506007)(305945005)(53546011)(2950100002)(6636002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR15MB0976;H:CY1PR15MB0677.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <89DA444A90581242B9D61DF299E2E0E3@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ed3144f0-5085-4e0e-d666-08d5439950ba X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2017 08:53:30.4709 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB0976 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-15_03:,, 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-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vBF8sXfX009406 Content-Length: 2590 Lines: 54 On 12/14/17, 23:40, "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. To have access to related task_struct is one of the main purposes of these patches. Take sched_switch as an example. We depend on the implementation of the Tracepoint is called from prev or next (which could, although unlikedly, change) and use current to get that task_struct, which feels, correct me if I'm wrong, kind of defeating the purpose of Tracepoints being more implementation-independent than kprobes. Then we have to figure out another Tracepoint or most likely a kprobe function to get the other (prev or next) task_struct. > 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.