Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp966020pxb; Fri, 22 Apr 2022 15:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKzSy5CxBO5Jr7tlzQmeC0WpAXWnlpwJCbEd2IJM7jFBI2FWjSwR+8JQDwIqkiUCpxFRL9 X-Received: by 2002:a17:90b:1d84:b0:1d0:3c19:e1c9 with SMTP id pf4-20020a17090b1d8400b001d03c19e1c9mr18985300pjb.130.1650666632863; Fri, 22 Apr 2022 15:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650666632; cv=none; d=google.com; s=arc-20160816; b=onGCS0wV8uHmoNpumRVqMH/6ZutbjLkWYvV52K4cJmBrvYPXZ1gYBGn14wdQ4BRbKD SyNM7mzTE41BduIjGIXZSU8zLoku0fyPN7k49EFO8nXdcMh8Y/m4rw9wr8cZTWjXJcma IjGST39iMmP6CwkBvAaKm5wpjizGvA4DknT3nx+TFfbkmmp4416crqXMEAZ2wnjoPIPk 8OP8rm1QKFgSAA9bTNSuyIZbjTGHOtcQ8VUYaQoA0TwsFGVWjO3UnKTig5bc0CV2gmtQ a2RQ+6AGVSqpZ2fnB7fSmwU8hMpEDMU5y2Nd9p6lq55rWajnTss7C5NleVlp35/9tlSM 9RAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rvKMiQM5BxmRRC7ajbQUzyS9sRzOBfLb0jjIwCaRIP8=; b=QueBcyGbqp6FumaXuWs4/U60Hs5lgWjxW3gt3zJQQC74brLLYLdzOt7QeSKhwyGnaH 7sFVItqFbFe/VhAczN/X/CBy2blwKPc5FnE8HjkN60Lel6D/QsS0SBUtGM6G0IMXI4fE YiiZ1vdDmZE3DWfHCjATu82AxsqyhUnZ6bcPOrpOL48eiF05sErKdOXL/BWLoIOEN0+V WBjg+FB4grfZkdiPY8X98mo9nirRvmzgT0pWJCsPg9QmnPlwQCvkEYZuanj6in/4DJ8o 9c9MmTS8d9IY7fDchlmKLqHH1+YxlkjiG4SbxBkMA/ozwdiByEi40srM1A8WdVuryNv7 9isA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pKZncDd/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x9-20020a1709027c0900b00153b2d1663bsi8461252pll.579.2022.04.22.15.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="pKZncDd/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2CEC1BD5C2; Fri, 22 Apr 2022 13:37:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbiDVTcP (ORCPT + 99 others); Fri, 22 Apr 2022 15:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbiDVTcI (ORCPT ); Fri, 22 Apr 2022 15:32:08 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1160921A674 for ; Fri, 22 Apr 2022 12:10:10 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id b5so5663197ile.0 for ; Fri, 22 Apr 2022 12:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rvKMiQM5BxmRRC7ajbQUzyS9sRzOBfLb0jjIwCaRIP8=; b=pKZncDd/5eiUgfslYCwu3tEWPP063ruyoXjkcSv5TL48nBr3RJhhYsYKPjXTpJCSdi PiqbG4yiv+A4ScSJHD4yr0oJk37m+CR9dqa1bgXCYI0IGIvlS0JcextYhtgEZtReQVU3 m4fg5q2gcIdBy9zau0hMnyvYLKpn96oL/t4H6e4258anB6CTpvNL0iRtVW8kLsnT2u5d 82+cCLl9pWNEdiMHQ9nLvAhbiszzCL8epAnWF+4klY/SaLYzaM+juCF2df+MMD2ZE2hr 66r6rfP3njCPNXcUzxVmGwM/a1x9DmY10eCTrv8hEO079moteOdVZ47cCpM9RiBIH+Lc KYvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rvKMiQM5BxmRRC7ajbQUzyS9sRzOBfLb0jjIwCaRIP8=; b=E7GPII9kBJW58ib28M9KkkcvNFvfr8y2TWkv0XBRVIYnJqinNaiZSwG2/Ins2A2Hkd 5oSb4H7H6GsCA2emm35g6luGOe7jxT7cJxdYGfE4/bOuvHjWU+hCSOl47IjgoVd/KF/1 rQz+5Z4WrOAToKP2HrRQorf1KhoWs021CZImcUXYs+Yjp/s66FWJM5muodVanR55aWy4 0Hew/cJIx7xozFvvzaqXV8tm4Xt9Ey1nRqOikGGWQlKEE314GeD3qNQ2V/SZYW/2S+3q 3PY1jQRl0oAQUanhROh1NiOhrJmcRwIvdzPxhABKzlAqsWyOmF+SAw20w8VpHh6hAlmY Y5QA== X-Gm-Message-State: AOAM531H82MtbZmq0SAIDJwjmx+YGVrFJa2ZKtJaAJT0DyJjxaIM+LfB pZx6Fbi69RvF4L/6gg8wzvmdOufEtzypIiubW8BNLFfEhV8= X-Received: by 2002:a63:2b4f:0:b0:398:49ba:a268 with SMTP id r76-20020a632b4f000000b0039849baa268mr4959451pgr.546.1650652223336; Fri, 22 Apr 2022 11:30:23 -0700 (PDT) MIME-Version: 1.0 References: <20220120162520.570782-1-valentin.schneider@arm.com> <93a20759600c05b6d9e4359a1517c88e06b44834.camel@fb.com> <20220422110903.GW2731@worktop.programming.kicks-ass.net> <056e9bb0d0e3fc20572d42db7386face1d0665d6.camel@fb.com> In-Reply-To: <056e9bb0d0e3fc20572d42db7386face1d0665d6.camel@fb.com> From: Alexei Starovoitov Date: Fri, 22 Apr 2022 11:30:12 -0700 Message-ID: Subject: Re: [PATCH] sched/tracing: append prev_state to tp args instead To: Delyan Kratunov , Namhyung Kim , Arnaldo Carvalho de Melo Cc: "peterz@infradead.org" , "bigeasy@linutronix.de" , "dietmar.eggemann@arm.com" , "keescook@chromium.org" , "x86@kernel.org" , "andrii@kernel.org" , "u.kleine-koenig@pengutronix.de" , "vincent.guittot@linaro.org" , "akpm@linux-foundation.org" , "mingo@kernel.org" , "linux-kernel@vger.kernel.org" , "rdunlap@infradead.org" , "rostedt@goodmis.org" , "Kenta.Tada@sony.com" , "tglx@linutronix.de" , "bristot@redhat.com" , "ebiederm@xmission.com" , "ast@kernel.org" , "legion@kernel.org" , "adharmap@quicinc.com" , "valentin.schneider@arm.com" , "ed.tsai@mediatek.com" , "juri.lelli@redhat.com" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2022 at 10:22 AM Delyan Kratunov wrote: > > On Fri, 2022-04-22 at 13:09 +0200, Peter Zijlstra wrote: > > And on the other hand; those users need to be fixed anyway, right? > > Accessing prev->__state is equally broken. > > The users that access prev->__state would most likely have to be fixed, for sure. > > However, not all users access prev->__state. `offcputime` for example just takes a > stack trace and associates it with the switched out task. This kind of user > would continue working with the proposed patch. > > > If bpf wants to ride on them, it needs to suffer the pain of doing so. > > Sure, I'm just advocating for a fairly trivial patch to avoid some of the suffering, > hopefully without being a burden to development. If that's not the case, then it's a > clear no-go. Namhyung just sent this patch set: https://patchwork.kernel.org/project/netdevbpf/patch/20220422053401.208207-3-namhyung@kernel.org/ to add off-cpu profiling to perf. It also hooks into sched_switch tracepoint. Notice it deals with state->__state rename just fine. But it will have a hard time without this patch until we add all the extra CO-RE features to detect and automatically adjust bpf progs when tracepoint arguments order changed. We will do it eventually, of course. There will be additional work in llvm, libbpf, kernel, etc. But for now I think it would be good to land Delyan's patch to avoid unnecessary pain to all the users. Peter, do you mind?