Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp350744pxb; Sat, 18 Sep 2021 04:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvFWIPu/X/6fjpwsolnOsB9C2msUuBEeBi1AVYuh1e/k5Q1mS2a0Gwr/neGIi+PeNL/gTD X-Received: by 2002:a6b:5114:: with SMTP id f20mr958955iob.97.1631965736738; Sat, 18 Sep 2021 04:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631965736; cv=none; d=google.com; s=arc-20160816; b=ckqUkwZiQrmiGioW+g0RfM5opEy+c/vlYqUWt08hYqCjFc6xFlzd6ggUgfUrSBiz8A ldlSjAoVV31uqz6Gbv66JZma/n6O7rKIrNw6XZ/sRWeMtfOohwUEX1c2/UKoR047TaeY 5e4PUp+3Mq5caC2PhsfsWwAduEL65t3krE44vG6qWc/4qTMmwS2/7vLKjBxZQc0ms48d ElC6FfUJPr3ea+ujAqagkt7i5Ju59tdVUMVLOcph4oEZ1/dNI1FLr3GepxvNb3T8nPJq Qh+XgH7fEyNEPynEL7L+okIwJBEdGWHqfUmrjlVyxX60wqlIBM9b36ooPM3zCWrZCStd Zhlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dq5NAUNnuQNz4xykRs3WCZJi29irBQGvaHlCZa+2iL0=; b=vYyWqfL+TjDmhGQZWPpGSnBYh/9lfogGVzMNcTnrMt+UFCfKDMvq0q3kFIaUl+VNVS /FLgR7qT/KNckGCDF6Dy+lNLm8aeyZKFPfMYFcShgp9GTk4mgeP35i1xE6j8UDHSORSO 1trvfmwT2t8dA0bIUf6Jq+dS9l/bsxmxC6DN6v1oaGcm2sgUY4dWEk/AloEd53zWHOHM xJfh0YQPbEcUnqFSri1ogK+wDt0yc72KroUMFLHh+VRJWDtW3LiKUtcCV0Hdx2PJlL1B ADzy8Zf2K8/mHuZnXxb32IoOP5Rx/EspY6NFLVZ4vsdweKjTAJl99zMtCXlCvZQA67yt ov0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZMx3BcEs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si8693532ill.39.2021.09.18.04.48.44; Sat, 18 Sep 2021 04:48:56 -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=@gmail.com header.s=20210112 header.b=ZMx3BcEs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233893AbhIRB2n (ORCPT + 99 others); Fri, 17 Sep 2021 21:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbhIRB2m (ORCPT ); Fri, 17 Sep 2021 21:28:42 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C6F2C061574; Fri, 17 Sep 2021 18:27:20 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id e16so10781107pfc.6; Fri, 17 Sep 2021 18:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dq5NAUNnuQNz4xykRs3WCZJi29irBQGvaHlCZa+2iL0=; b=ZMx3BcEsTREXr2zFDd4dWEB/1hW4z4yKEKIJHajsDhjJTlx7vYAT06Tcrbck05mSpx 4TnoszT1uZUsSTJHsmR/7NlPGUf06c3sUSmZOfEc0W6lnVYjyn17l+KmAHVNhfYNzAUP vMaOZUPbUMAGhhUlbqpj8WODuQNaMIF83can/QlZVYveu/eqopuo8o7cAZBfZW8BzUaR W4fiiDo2BcKDfAJ4FunyGfeM4cXJIabjtg6iuJF8VxaG7uo1nX6e3SMxXKJq9ZWmkebc qKAaQZme5Pih44UhxvjlgeaRDp6fEbJeES6vT67pwKpx/yEI2eiXEnQCtsJVfC7GVop4 89VA== 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:content-transfer-encoding; bh=dq5NAUNnuQNz4xykRs3WCZJi29irBQGvaHlCZa+2iL0=; b=l65nBrZsi5eBjJBmIIElkVpnO9xI5SmqxgfjFUo7FeUSdfwkcyUkxmOtN4zlZphQjL KEEOR6/CpR10kWE113VTP48cFhDLvVHfe4q2oU23JFulGhHf7VD3q5IZXUWT7tNjXGaq Irt19AjFpX8wF02RKO3CGELyHMaU7AYhkqOUvyOUslqYIdqx1spHTpLmuOnkN1eutkOw J/HjWCDbGbi/QKck2l0LAXY/J73/eMxdRIQsfb8S/Cx7cXGnBRaS9GizZgJUXtcVN9at Gg8b8yUPTNNeWjNYdg44LQ0QzXcyg/+elQzpIoy5er3qo+um7mXDmX/y82yFTVt/yrOE Esbw== X-Gm-Message-State: AOAM532qC6MX3V2hpG8wmppd10tZ8QmJQXsl65tOu1l/25XbJsC4hpR+ RAYrDnh16rmvhuRCoMiDZPGoDySwHAxo6cKZfg== X-Received: by 2002:a05:6a00:2449:b0:43c:4a5e:55a6 with SMTP id d9-20020a056a00244900b0043c4a5e55a6mr13586668pfj.43.1631928439621; Fri, 17 Sep 2021 18:27:19 -0700 (PDT) MIME-Version: 1.0 References: <20210917164123.GA13346@blackbody.suse.cz> In-Reply-To: <20210917164123.GA13346@blackbody.suse.cz> From: Hao Sun Date: Sat, 18 Sep 2021 09:27:08 +0800 Message-ID: Subject: Re: KCSAN: data-race in cgroup_rstat_flush_locked / cgroup_rstat_updated To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Linux Kernel Mailing List , cgroups@vger.kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, tj@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, Michal Koutn=C3=BD =E4=BA=8E2021=E5=B9=B49=E6=9C=8818=E6= =97=A5=E5=91=A8=E5=85=AD =E4=B8=8A=E5=8D=8812:41=E5=86=99=E9=81=93=EF=BC=9A > > Hello Hao. > > On Thu, Sep 16, 2021 at 09:53:55PM +0800, Hao Sun w= rote: > > KCSAN reported the following data race during the kernel booting when > > using Healer to fuzz the latest Linux kernel. > > [...] > > cgroup_rstat_cpu_pop_updated kernel/cgroup/rstat.c:139 [inline] > > [...] > > cgroup_rstat_updated+0x53/0x1b0 kernel/cgroup/rstat.c:38 > > FWIW, it's a "safe" race between updaters and flushers (possibly > missing the latest update(s)). This is expected as explained in > cgroup_rstat_updated() comment. > Would it be better to add a `data_race` macro to the corresponding location so that the false report can be disabled? See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /tools/memory-model/Documentation/access-marking.txt#n58 for more details. Currently, fuzzer can not test the kernel with KCSAN enabled for a long time, because cgroups setup is the basic step before executing any test case. Regards Hao