Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4898687pxb; Tue, 5 Oct 2021 12:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjcAn0NhBHpBdCzWWvyEJMNwT8FmPkPvS29Kcv/x1BtbTBh6P2w0CowlcpPZ9OGix7ixmo X-Received: by 2002:a17:906:c317:: with SMTP id s23mr23916091ejz.127.1633463425240; Tue, 05 Oct 2021 12:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633463425; cv=none; d=google.com; s=arc-20160816; b=it6VlkiZvqEafN4XwS66VtnQ4AjU9vB0UiUj7+7HBBJ/ybFKe8FDezRcihvndVfgu5 0178814yzyRFH7IsfuXPk3pYZwoXUaZX96voBZHCg6+qED6MUZig4mXEBeZuvD1CsC+p msyI9Dll6wcwPDKzSPmHD2iItFTzC3vxSXlN9k91bt/iwkNr994yo9JmyZzAEHy2QM5L NLf8bGgzz4fukNxtZ7y17NlnobE6PSrgyIdRuo2pVOrOqQ/xi+Trug+YlTuYAJM+NaCR J9IMc0wkPTgdP0ckm8YrYYbjPbGRAwFYADssj7W3o0ZhImIRUn5Nu22hu5jEs6pCW76e JZtw== 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=ugWGt9Pg5upI+OifuSoHCXw7NKwxQ1vrKgVTrc521LA=; b=hQdLd4J9hD/VB787ak8D17kIZ9Pnx6V8YUu6q6PMxiBu2/QWzr1HdCCpMniwTXqSX0 q4ZUi6IsnwDJuo70hpGmaB1SqeIvqji+esa2BkXPndTx2xMvejsEGppYUV232pQSfvXg +Rq/qAdEcWg6GYTJlKBDjZ1oO/LOaK/8v0h1xd9if1AQpUSs39MrA7y3rfqSHatClTNE 1JQLs5Vw22XHX+DEm1iSToxEjgi41dW3MRTKZFomdZ2vhCMqRAJlLD7CY3pez9f56fMs M3YfEH2CljYUGC17dnrNPVvsqPPwcjt34pnfG6BJqgZU10ZMMZCgkO5bnlOB4NYYs85S djKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T7PyJHg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si28118083ejx.341.2021.10.05.12.49.57; Tue, 05 Oct 2021 12:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T7PyJHg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235546AbhJETs4 (ORCPT + 99 others); Tue, 5 Oct 2021 15:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbhJETsz (ORCPT ); Tue, 5 Oct 2021 15:48:55 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2CEC061749 for ; Tue, 5 Oct 2021 12:47:04 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id y23so807345lfb.0 for ; Tue, 05 Oct 2021 12:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ugWGt9Pg5upI+OifuSoHCXw7NKwxQ1vrKgVTrc521LA=; b=T7PyJHg80nfkPUQJ7wSKYwTRhSmMLdv+QAUUhPStrfcNo/FY2KObTGqH8VI91mm2de in0tGoxNF7Pfx7awFKAakx9kDhOZoB9oYhggSaw/Q0JWtGGgV/+n3HELHjYLUkWJV3N/ 5K95Wh43Bw4IeM9lQCzUeqH0Sb/e/rUuWf6Eo= 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=ugWGt9Pg5upI+OifuSoHCXw7NKwxQ1vrKgVTrc521LA=; b=PMCYXZ/6mlJskP69GFrHZXjjsP45xpAyW8t+4LL58lD/ASlaCHZEVOVyNrsdRKs849 bDj6zEcL3YDCszz35g4dEObzyKY7gHzIeIp9Sw1QnUEMkhIy3Cy805EOsYXgpjZ1xgZL HSdBxcNr9re8r+XwIfB+YI57MojZRjIKzlB1Olb5m8MB4yEqcYvRXsJhyQDkFDLxJHx2 2yvOBz52uif1JXQqDikvsqIFJmo6iPNSOas69dIsmxxH3naKInRhC8EsIgkv21GDxTzw jOp9WanMDAUhKutvUgs9lxNga7IQ5PBUJQjxLAi9lOWsZgukfBbaOSXSQCti0r4I3neU O/Aw== X-Gm-Message-State: AOAM5334FK9p1GzvASMdjhMQgaQFFee1KZL2oDVYeYLOtrBs6jO0Ojkp 8QzDzgQb8CV9D62nmfPspAL27TGgfA0gIAK6H3s= X-Received: by 2002:a05:6512:33cb:: with SMTP id d11mr5062862lfg.566.1633463222142; Tue, 05 Oct 2021 12:47:02 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id o21sm2053336lfu.81.2021.10.05.12.47.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 12:47:01 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id y23so806957lfb.0 for ; Tue, 05 Oct 2021 12:47:00 -0700 (PDT) X-Received: by 2002:a05:6512:12c4:: with SMTP id p4mr5337511lfg.280.1633463219864; Tue, 05 Oct 2021 12:46:59 -0700 (PDT) MIME-Version: 1.0 References: <20211005094728.203ecef2@gandalf.local.home> <639278914.2878.1633457192964.JavaMail.zimbra@efficios.com> <826o327o-3r46-3oop-r430-8qr0ssp537o3@vanv.qr> <20211005144002.34008ea0@gandalf.local.home> <20211005154029.46f9c596@gandalf.local.home> In-Reply-To: <20211005154029.46f9c596@gandalf.local.home> From: Linus Torvalds Date: Tue, 5 Oct 2021 12:46:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * To: Steven Rostedt Cc: Jan Engelhardt , Mathieu Desnoyers , Rasmus Villemoes , linux-kernel , Paul , Josh Triplett , Lai Jiangshan , "Joel Fernandes, Google" , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , rcu , netfilter-devel , coreteam , netdev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 5, 2021 at 12:40 PM Steven Rostedt wrote: > > I may try it, because exposing the structure I want to hide, is pulling out > a lot of other crap with it :-p One option is just "don't do rcu_access of a pointer that you're not supposed to touch in a file that isn't supposed to touch it". IOW, why are you doing that pid_list = rcu_dereference_sched(tr->function_pids); in a place that isn't supposed to look at the pid_list in the first place? Yeah, yeah, I see how you just pass it to trace_ignore_this_task() as an argument, but maybe the real fix is to just pass that trace_array pointer instead? IOW, if you want to keep that structure private, maybe you really just shouldn't have non-private users of it randomly doing RCU lookups of it? Linus