Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2571202rwb; Mon, 15 Aug 2022 07:36:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/342ugmJ7RKwMC6kQxxgsZSDjRXus60PRh3d65UJtkPWdnHa7jsO8xl5Oe6yU1ks2h3BX X-Received: by 2002:a05:6402:3293:b0:43e:4a21:af84 with SMTP id f19-20020a056402329300b0043e4a21af84mr15042975eda.170.1660574185068; Mon, 15 Aug 2022 07:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660574185; cv=none; d=google.com; s=arc-20160816; b=wTkCcPuelfL0eI8flW7usx7IOJWcITCBozSw/VjmaOcGpFOj4DDFEBXCRgms9zXOeZ blP45HlsAR0HkVDK2hsqBtau+0qM1yZKAwPd5r2OLgGA6A2RwIUV+MaVgxwZlO/BU6Ho /jnsjYFdQ5UmDXXe5eGF4bS/3+uS5ueVmRjM25ZeEamjcXI9UukR+5XiFyfsaQ/3jqqP PCnfkrZE2Km+QPEN1pw0zvFG8ER8DIJtMi46/oj4VW9O1kWDoXoe2NS3zb/fLLApWoiv Z8N22YV1TvE+DzggtcoNz4YLULQALsdRjWdEMsNrVKk7MsyWHMrPbEul9y8ASFOqj0d4 9YVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vjSauRMX6lTklAqGe35XwanARw4Uk+6GG0LElIUJ4nU=; b=QgkcxqCHopCD7jaSqrq4Ay2LFxDaiAGyrZy+TZ44YLlI5ZHZwc7Gij/CtkZT1hFkP9 NMB5cluybtLWrLPfJl2OgN2vLI50cgzRFTo1kwBcB+sODrmGLd+zL8Ck8+D+N6G271tM Bwq8jEgTWBjM2UpTQi7zOCf6ZxgwW/LmuoTu6gyynQHYXeV62/Fg6rc37hsqCN6Ze3gm KKVjl5QfcSEDwxCJO7Gy+kG/j8Uabhk0HXj3LcfmoU+ZQ6JbwoFQ74gpsJ7Ndz1tx5XL GeFu95aUwQpZlStz3uI68Ludp+TTmZ7+he0kWRyJOeGacafB8ZedJ4f4t9nQpMQUiRtk NqgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kYO5LYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg30-20020a170907a41e00b007387740b9c2si270720ejc.2.2022.08.15.07.35.58; Mon, 15 Aug 2022 07:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kYO5LYDt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbiHOOdi (ORCPT + 99 others); Mon, 15 Aug 2022 10:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242201AbiHOOd0 (ORCPT ); Mon, 15 Aug 2022 10:33:26 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A9324F2D; Mon, 15 Aug 2022 07:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vjSauRMX6lTklAqGe35XwanARw4Uk+6GG0LElIUJ4nU=; b=kYO5LYDtCo7aS3KwRENHNp1AVR hVNK/WgcdT4gGqGdYDnpZHf3z4Ea9VmykBH0/dGM8Q3B5DTUU865iD79AohFJASEC9nS7AYESLmCX uR6niPOBt/N6TryyinJX44KHpmLtowwPIjGoe/mX8zlExHVK9329qxWIRFwwWqotYSNlqIHZjDeMD SvrQ2jbDO4Vea75cqkCU5vBm05q1LIXzQeAx87gOMkniXORVzm0t0EbktR6tbXrJgrvQFOAdSgbEQ /3HS/KecRfKn2KMHuAOjpNbjZD5wq1ygwxibIh3I1GvnVqYIXy0NzKd5nFClsqio7r6FrTYIM2UDB DZRTWdow==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNb9S-005n8I-15; Mon, 15 Aug 2022 14:33:10 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 37A84980153; Mon, 15 Aug 2022 16:33:09 +0200 (CEST) Date: Mon, 15 Aug 2022 16:33:09 +0200 From: Peter Zijlstra To: Alexei Starovoitov Cc: Jiri Olsa , Steven Rostedt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Ingo Molnar , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , LKML , Josh Poimboeuf Subject: Re: [RFC] ftrace: Add support to keep some functions out of ftrace Message-ID: References: <20220722122548.2db543ca@gandalf.local.home> <20220722174120.688768a3@gandalf.local.home> <20220813150252.5aa63650@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, Aug 15, 2022 at 07:25:24AM -0700, Alexei Starovoitov wrote: > On Mon, Aug 15, 2022 at 5:37 AM Peter Zijlstra wrote: > > > > On Mon, Aug 15, 2022 at 11:44:32AM +0200, Jiri Olsa wrote: > > > On Mon, Aug 15, 2022 at 10:03:17AM +0200, Peter Zijlstra wrote: > > > > On Sat, Aug 13, 2022 at 03:02:52PM -0400, Steven Rostedt wrote: > > > > > On Fri, 12 Aug 2022 23:18:15 +0200 > > > > > Jiri Olsa wrote: > > > > > > > > > > > the patch below moves the bpf function into sepatate object and switches > > > > > > off the -mrecord-mcount for it.. so the function gets profile call > > > > > > generated but it's not visible to ftrace > > > > > > > > Why ?!? > > > > > > there's bpf dispatcher code that updates bpf_dispatcher_xdp_func > > > function with bpf_arch_text_poke and that can race with ftrace update > > > if the function is traced > > > > I thought bpf_arch_text_poke() wasn't allowed to touch kernel code and > > ftrace is in full control of it ? > > ftrace is not in "full control" of nop5 and must not be. It is in full control of the 'call __fentry__'. Absolute full NAK on you trying to make it otherwise. > Soon we will have nop5 in the middle of the function. > ftrace must not touch it. How are you generating that NOP and what for?