From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97521C07E96 for ; Tue, 6 Jul 2021 10:33:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D843619B5 for ; Tue, 6 Jul 2021 10:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhGFKfs (ORCPT ); Tue, 6 Jul 2021 06:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbhGFKfr (ORCPT ); Tue, 6 Jul 2021 06:35:47 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A47C061574 for ; Tue, 6 Jul 2021 03:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=n2Vzx/jD6M+1KgcgpN/qKExJDJdXYiAmzmysfJfl01o=; b=n2viB8M4RXVDiYLyvvYbcTNk3V A8ED53F16U0tzR1oqzalTVtNxY6CqG8RT3RRiyHx9Bp0s5oLHeakV28w6smscQiQ/bQnKfQQsWPch JZEBlV9ueq0x0+chJEIyG0NhmnrJdFyON/uSXcOTpdx1Urmtagd+XyxdudMeh6r1qhRu35H45muhL /XW32kjz3gapDCvQhLZ9S7IhY/R81+UdFtOgaj4Z6dj7U1Q0C6PYAOMJ9yJqu+6CZ8MWaMejr1OdZ orh8JFn17EqmlfPnSAd2lLUpaxQjyrL/gZ50A2V9VHR9xEmK+GxcyOJfqjvwaMR4fKY6zgGzJKwU5 u1DAOP2g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0iO2-00F17E-Ea; Tue, 06 Jul 2021 10:33:06 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 05EEC300233; Tue, 6 Jul 2021 12:33:04 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E708F200D9D6C; Tue, 6 Jul 2021 12:33:04 +0200 (CEST) Date: Tue, 6 Jul 2021 12:33:04 +0200 From: Peter Zijlstra To: Marco Elver Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org Subject: Re: RCU vs data_race() Message-ID: References: <20210618204800.GK4397@paulmck-ThinkPad-P17-Gen-1> <20210620210127.GR4397@paulmck-ThinkPad-P17-Gen-1> <20210621133757.GS4397@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021 at 10:44:46AM +0200, Marco Elver wrote: > On Tue, 6 Jul 2021 at 10:00, Peter Zijlstra wrote: > [...] > > In that case, would not an explicit: data_debug(addr) call (implemented > > by KASAN/KCSAN/whoever), which would report whatever knowledge they have > > about that address, be even more useful? > > KCSAN/KASAN report data-races/memory errors as soon as they encounter > them, but before they do, cannot give you any more than that (metadata > if it exists, but not sure it can be interpreted in any useful way > before an error occurs). > > But maybe I misunderstood. Is data_debug() meant to not return > anything and instead just be a "fake access"? Mostly just print any meta data that you might have. Like who allocated it, or which code touched it. I'm thinking KASAN/KCSAN need to keep track of such stuff for when a violation is detected. If I understand Paul right; and there's a fair chance I didn't; I tihnk the issue is that when RCU finds a double call_rcu() (or some other fail), it has very little clue how we got there, and any addition information might be useful.