Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5515706rwb; Sun, 4 Dec 2022 23:30:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7PBT1OVBDUOaXvIa0cwOppc0YuGZM8lFujkxU5Xn95MTkIdg7Rfvpxq96gIqZCaSB75gj/ X-Received: by 2002:aa7:8d5a:0:b0:560:eec2:d0ab with SMTP id s26-20020aa78d5a000000b00560eec2d0abmr84020219pfe.43.1670225433635; Sun, 04 Dec 2022 23:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670225433; cv=none; d=google.com; s=arc-20160816; b=c3T9+irOsJU0MI0ZeA+KiyPNSkYg+7v2g06cQgQ9aTwrYTeWipMuiA2yH/RO011Y4l zEMAmBQWq4vRh3BH4izMQHM+sbPgeNX2fDFVec+C7YGuOridhSAfVHoXQG+1r/uwBA48 SvWpDF1D2qygiah1qIYakIYD6BcXS0WKu71Q+BkFzAhdsyDjpzadSYizpoISPTKVKkVN Do9c8VoELG/itoo8bCbbu7A9YuxSZav0yTzDP/DO++ZwygV57FBaTXgwdLOWcgeAc5Bv E3BZEzcig2yJtWCoWkUbPz9TgmEkKx5EqabEtC9J09Al02u9HfS4L8fJTQP2Rjm0o6hl JgNA== 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 :dkim-signature; bh=2/E7M28jlzB+tOHKj9EI5rF1sUTSmV05NM5sZZy2Ges=; b=Risl4IJrDaVK+Jz3kEIMhMG6AAzvqVkdx4qwN/t7GdqUFCutPEMjq2eEvCdUGH1fAW +PzxrrsiHq5aWIGKaFNOAx9ymk1cyQCdGhBq+DLzUgLqgT8tf9aYLAAzb5wWE3MMqsCI jP/iyIztJfOVMfoA3DeBjvgPbDoOh4TXi0OjOS/VqBjSKffVRMeQ6kFsDL8JHL9oao0S Wanb2iZ3zwEyWDoAbtu9DtfgndM+CFs3CXTSaT2anVntWqM9MtZm8qFb2hkSmKiwVRqY 0HGYB5Rgn4yzsDjrhZudNLwqc38w7cbHEQkMOkg1AjOsgxo2QcK0jal2DCgySTTHEQGd HZZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=B0zWuxAW; dkim=pass header.i=@codewreck.org header.s=2 header.b=KxQeiB3T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m29-20020a63581d000000b004772ac33cdesi14207741pgb.688.2022.12.04.23.30.22; Sun, 04 Dec 2022 23:30:33 -0800 (PST) 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=@codewreck.org header.s=2 header.b=B0zWuxAW; dkim=pass header.i=@codewreck.org header.s=2 header.b=KxQeiB3T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbiLEHNp (ORCPT + 82 others); Mon, 5 Dec 2022 02:13:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231582AbiLEHNn (ORCPT ); Mon, 5 Dec 2022 02:13:43 -0500 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04BD8DF00; Sun, 4 Dec 2022 23:13:41 -0800 (PST) Received: by nautica.notk.org (Postfix, from userid 108) id 40ED9C009; Mon, 5 Dec 2022 08:13:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1670224429; bh=2/E7M28jlzB+tOHKj9EI5rF1sUTSmV05NM5sZZy2Ges=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B0zWuxAWobbgFEMxbhwX4lp5iaDuYpVNfYEbFdypNE9BAEAUfyDNFOZ9FJxGQIdsa b8O8XLAwsW93DcGQ3Q4PU3/Lta6koQ9lky6cmm3lfMhbiiA46TsCstjXBH999VsiNu +g+UGbZ/ZI0sN+KWbwUv/pRW69a6gCgVxnjLgvbFBVlTAWRndzp8T/zJdsaVi0zHgy w5r04KLoMbSVP7SFddKajyEj99IP8NkLmjCPuzsE1nZVZ5mvPDyRV144nm9oICY2Cy 1whWO7gJ3/KnNTjVIH5LIa0I6FJlll7IosmDfBEZKVNGoLLzb0Wyt/2gFNpM4NB9uD TY9Y5Y2mDRT+g== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 60CC5C009; Mon, 5 Dec 2022 08:13:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1670224428; bh=2/E7M28jlzB+tOHKj9EI5rF1sUTSmV05NM5sZZy2Ges=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KxQeiB3TMfEP8TdHuiQ+mAFsfqmEjCtnUMdRLDavqny0AJ9quC85bvFEBSntRx1EW kjheht3Ihlt2CF/xQPWMOwq5Hp75OT1K383041mHB0mzWog1mpMI4WaQBmkJkYT7Ut qc0RVIfxvC04axDWpXmw086FQ2t/l35XCHSiqlIzYMqDz+K9YUpMXV5nxgGYli3Hrw Kgq6sdVe8hA1CS/X51+825I4x+cBiWzHHw2YUdFUClSMpRA3HGpm2UG+i+a0wx3vZb xKkm9DY1ftW3CzJ8CI0eeoJ+3T+iZoug4LvDwB+Nn8oZ4GFo/0dv5qbuFR9SS2ESgJ QV9Y9Zr30M2zg== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id d99753f1; Mon, 5 Dec 2022 07:13:32 +0000 (UTC) Date: Mon, 5 Dec 2022 16:13:17 +0900 From: Dominique Martinet To: Marco Elver Cc: Naresh Kamboju , rcu , open list , kunit-dev@googlegroups.com, lkft-triage@lists.linaro.org, kasan-dev , "Paul E. McKenney" , Netdev , Anders Roxell Subject: Re: arm64: allmodconfig: BUG: KCSAN: data-race in p9_client_cb / p9_client_rpc Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Marco Elver wrote on Mon, Dec 05, 2022 at 08:00:00AM +0100: > > Should I just update the wrapped condition, as below? > > > > - err = wait_event_killable(req->wq, req->status >= REQ_STATUS_RCVD); > > + err = wait_event_killable(req->wq, > > + READ_ONCE(req->status) >= REQ_STATUS_RCVD); > > Yes, this looks good! > > > The writes all are straightforward, there's all the error paths to > > convert to WRITE_ONCE too but that's not difficult (leaving only the > > init without such a marker); I'll send a patch when you've confirmed the > > read looks good. > > (the other reads are a bit less obvious as some are protected by a lock > > in trans_fd, which should cover all cases of possible concurrent updates > > there as far as I can see, but this mixed model is definitely hard to > > reason with... Well, that's how it was written and I won't ever have time > > to rewrite any of this. Enough ranting.) > > If the lock-protected accesses indeed are non-racy, they should be > left unmarked. If some assumption here turns out to be wrong, KCSAN > would (hopefully) tell us one way or another. Great, that makes sense. I've left the commit at home, will submit it tonight -- you and Naresh will be in Cc from suggested/reported-by tags. -- Dominique