Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5753241ybf; Thu, 5 Mar 2020 06:27:24 -0800 (PST) X-Google-Smtp-Source: ADFU+vsfbzVzgGtlIfM0FpfGc+/vpDL+y9weiG07v+pZJUJCE1pHniZ+a0rdoU76fEw8svcLdk2o X-Received: by 2002:aca:c5ca:: with SMTP id v193mr5984850oif.62.1583418444798; Thu, 05 Mar 2020 06:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583418444; cv=none; d=google.com; s=arc-20160816; b=ONj/5iVYdcnvtgekwmuaC7NjhhldxkMadJ6pNzCSDS5doqS4TUNxJdHbYPdCBCE6+y XqUEaB5Mv33U73LFFIXvjG54Cso3LtfnSurYnL21mogIPwfgJtm17bZN9HMLQ+g4INA0 rPq2Bx/91iVt9eY8rvctBX/NkvzFtdCTVWniZxenujrqVA3pVtztleAH3pzaE6w8pmCe /QKlKOQj7UCDSfnidQeD06+QrBMadC+KJDGzwdJrX5MlAzEHaQsVHWVE8Z0G1gcuJEfM CrD4YVF8MpcfO8dttzRDWuIeWdkdeuZhSWZ1l3UiHAuC3h5Heu7T7FjSj/a1cRL6fszL ymTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WdOkNe1i6CaMq0tiqi6obtIyviMmK0f4VHBh6zrGclw=; b=vuXi5my78IW9Spn86MuLqSzDYQAXrwm0df2IR29zV/p5ehRf6eTcMKqN2sQa3YcVre n/83XBRUU9kp6H4P7/xPcMmvNThw9l0+zbItzeKhRqkzfAZ/RPgDMtW8m/etXxJabXCB RIEfifhEFgsVhGDbAnIAqbSCVXhRvmclJDJC7zi1eF6m/Pw0Tc259hBCcG5cTJ85ohvE 37XGazy7h9WE1tqotaToEoHoafw79vnxvsPutgJw8t1GWY3J8jqsrduumD02MYX5SLME /dhwFSFsNY3GvaBarxL7Dfu2iw3PEYgtaaNM1vsBS8Gf8Kh6qaESLHyNLyxlhgAd9FKp YYzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OM4RnwdM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si946920otk.6.2020.03.05.06.26.37; Thu, 05 Mar 2020 06:27:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OM4RnwdM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726211AbgCEOYw (ORCPT + 99 others); Thu, 5 Mar 2020 09:24:52 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:36582 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgCEOYw (ORCPT ); Thu, 5 Mar 2020 09:24:52 -0500 Received: by mail-oi1-f195.google.com with SMTP id t24so6128172oij.3 for ; Thu, 05 Mar 2020 06:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WdOkNe1i6CaMq0tiqi6obtIyviMmK0f4VHBh6zrGclw=; b=OM4RnwdMX0NZkgJ/bEYRwZ4DEKC9CqL3GBqgB8jycaaqqfeXg4lCg8xta+B7KQUVGs 6yn/PGd0NC3SFcK2Z4nefBFb4svzBNCUxxDuENwEjpAX0tDsxqDEdobHJxUBAZ9o4Y2F 6xoEW56RCfHhbtG7zEVcrIUdAvz8z9XNfxAT0/n8b5u8bgWpLAgLnT7cORPAukLkjbq0 DORieg5PQ+BpZ512yIPBK6NfXHcYzoue7gSMVLbEb454lIS6YUAA2xcu29HgTaT3Cwjr fAQBqGwylxeeR369m+wuS+ozCghE6Fbg2L0ccY6GE7oCyjYnUgDHPEAlUPFJIboW3og1 INMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WdOkNe1i6CaMq0tiqi6obtIyviMmK0f4VHBh6zrGclw=; b=afITdGJdFJoRbM0GpCZ0Lh0QL3JqaB4QLmAlNZN5hBTO2OsBEBpuiPkrVBEPXYOPsX +EWK8Uowercbo8XARMk2Up4Ae41km5mrDJit7DRZgjB48NdUUDYU67QYmSJ71g5zAtjE cY6VMHTibCnfo80FJLFArSUiUokRvFtFPeESfTE/kwS1e228eYvMn8bS6E3C25AiuMvJ w5zPUAxUbknK8HYAnEp0rssS5SdCNIWBtwV7pocWZQmYiuQXz6l9N+DARX7Yztpr+cym dhLqPyN5FyaxXafx68It2/nJ4avojvv1h5rC7HLGo4ShL4vRHk72rDhB+AFmoAzGMoVc Licg== X-Gm-Message-State: ANhLgQ1uVnECrUBErOkvDPNlUJEljLr3u7oedL+SwbHJxZ8ZHEOTeyDf euX0ZSFYswjhXJbzk2VQ3yCxH24TyZAmEWTebIFu4w== X-Received: by 2002:a05:6808:8d5:: with SMTP id k21mr5897489oij.121.1583418291263; Thu, 05 Mar 2020 06:24:51 -0800 (PST) MIME-Version: 1.0 References: <20200304162541.46663-1-elver@google.com> <20200304162541.46663-2-elver@google.com> <1583340277.7365.153.camel@lca.pw> In-Reply-To: From: Marco Elver Date: Thu, 5 Mar 2020 15:24:39 +0100 Message-ID: Subject: Re: [PATCH 2/3] kcsan: Update Documentation/dev-tools/kcsan.rst To: Qian Cai Cc: "Paul E. McKenney" , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , kasan-dev , LKML , Jonathan Corbet , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2020 at 17:57, Marco Elver wrote: > > On Wed, 4 Mar 2020 at 17:44, Qian Cai wrote: > > > > On Wed, 2020-03-04 at 17:25 +0100, 'Marco Elver' via kasan-dev wrote: > > > Selective analysis > > > ~~~~~~~~~~~~~~~~~~ > > > @@ -111,8 +107,8 @@ the below options are available: > > > > > > * Disabling data race detection for entire functions can be accomplished by > > > using the function attribute ``__no_kcsan`` (or ``__no_kcsan_or_inline`` for > > > - ``__always_inline`` functions). To dynamically control for which functions > > > - data races are reported, see the `debugfs`_ blacklist/whitelist feature. > > > + ``__always_inline`` functions). To dynamically limit for which functions to > > > + generate reports, see the `DebugFS interface`_ blacklist/whitelist feature. > > > > As mentioned in [1], do it worth mentioning "using __no_kcsan_or_inline for > > inline functions as well when CONFIG_OPTIMIZE_INLINING=y" ? > > > > [1] https://lore.kernel.org/lkml/E9162CDC-BBC5-4D69-87FB-C93AB8B3D581@lca.pw/ > > Strictly speaking it shouldn't be necessary. Only __always_inline is > incompatible with __no_kcsan. > > AFAIK what you noticed is a bug with some versions of GCC. I think > with GCC >=9 and Clang there is no problem. > > The bigger problem is turning a bunch of 'inline' functions into > '__always_inline' accidentally, that's why the text only mentions > '__no_kcsan_or_inline' for '__always_inline'. For extremely small > functions, that's probably ok, but it's not general advice we should > give for that reason. > > I will try to write something about this here, but sadly there is no > clear rule for this until the misbehaving compilers are no longer > supported. I've sent v2 of the comment/documentation update series: http://lkml.kernel.org/r/20200305142109.50945-1-elver@google.com (only this patch changed) Please check it captures the current caveat around "__no_kcsan inline" with old compilers. Thank you, -- Marco