From nobody Thu Oct 9 08:30:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1582638028; cv=none; d=zohomail.com; s=zohoarc; b=I99Ds02bWmXy1Bii0A1/Bg2KQPlVSw6hEUTI4gpJ+7gqE7m5M8hRO5f6E6IQsCryihQJDJ0YAy89xWjberSsXIe+XOkoeaKVDdCEkDVlDfDbyJ1OGpxWebKPAozMj/hwbE98sHYRNEOOzcwHrnU9i/2Eql6PXyIm3sZ5fHZP4/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582638028; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V4YbJuHMHTKZppvspX7lYfndG26GXtbu1NuW0h2HVeE=; b=bRODlZXCRqRGykqITcIKhhKruFFgvYZ1jczOlWQCXrGKkG4TqlwQSXeEzC+PobjieDkUrBJFHNtmLqmNgGmKFcxwSI63k/1eIzPBSZNmnTpQ///h2cxmBQl2d9yWZJDIu82JNUzGZsZHzEUL6J5Ws8CCbqHxuUPiKozjKRcGULY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158263802826883.93401064919408; Tue, 25 Feb 2020 05:40:28 -0800 (PST) Received: from localhost ([::1]:56220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6aRn-0003Pb-5o for importer@patchew.org; Tue, 25 Feb 2020 08:40:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59115) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZcL-0005MO-Vl for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZcK-0007CW-Vv for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:17 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6ZcK-0007Br-Pd for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:16 -0500 Received: by mail-wr1-x441.google.com with SMTP id m16so14544316wrx.11 for ; Tue, 25 Feb 2020 04:47:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d9sm24247090wrx.94.2020.02.25.04.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:47:13 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8866F1FF90; Tue, 25 Feb 2020 12:47:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V4YbJuHMHTKZppvspX7lYfndG26GXtbu1NuW0h2HVeE=; b=Wuf1amqSb6UKAG6mhYgdyoZiZV1IQ6vCZpGsVhYf2nby1Vtx3XfNAEsb17LWHvARL4 XirsQO8AnDLr/Glnmn+xAmjVWHtswngc/ImRZ6mEodPOosUhKlbmCttXCC52syugLrN/ JX/Kkl+qtqNNNiTGu32234FM53bsZRXXcpu/yHhV28fYNRU7ZtJzNLbmfbUoQZZOoHdQ gU+ZrWyG51v44iIUJRzQTPb6+cg2wBGp88Bw7+Yb0j2YgfT45lldJVb2dfZGM1bjA9V1 oLdnGQ6tFNv+wICC4UcfhhHK5O/oC5oq6p7ZnqEueM61908hwTOC3NqZGa1t7hFImWjw LArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V4YbJuHMHTKZppvspX7lYfndG26GXtbu1NuW0h2HVeE=; b=PdafRgygvD98hkBahNFBWkvV6KZhnTGU9Dc6LHi0PI0q3m9jKwjQa2ECLDgwcAvrzA 9kkMJzePQEJOTcsJhJ0/2DqLXMlDH8Vle/+m6z0khyD/SjuRmfg6BNggMFhNVECoGCON lrA4ORxkrgfKAQbYkTpo2QlaFqaLz78q4gee192jimp4BWyr2ebiflYi6AEmsN6J9dPc 4fkHrugDS+SVMn7UCtz8ddlobhpudSmQOgLi7vadg5r260RXAeX1Mf0QKoQTWHJibW9h E3KNitQQkL5mz4bHauYR/LYseNMGkjjiSchRXurzolLSEYftS0qBb29DuI9eUNXntGbr 1m8w== X-Gm-Message-State: APjAAAVgmb0KyoPwHupYWOpjoOYhFrrDFGv4t7+BiadNKyAVxDb/rIUC nmTyEttMKrBKB2WHVbsB4R6lJA== X-Google-Smtp-Source: APXvYqzfgppssIo3WIVKveBTketq4Dx8xYCq8CFlWQylfopmueOORCHIki6dEGOC4+IZ1qi3koWchw== X-Received: by 2002:adf:94a3:: with SMTP id 32mr1769240wrr.276.1582634835609; Tue, 25 Feb 2020 04:47:15 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 03/19] tests/rcutorture: better document locking of stats Date: Tue, 25 Feb 2020 12:46:54 +0000 Message-Id: <20200225124710.14152-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200225124710.14152-1-alex.bennee@linaro.org> References: <20200225124710.14152-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, robert.foley@linaro.org, pbonzini@redhat.com, stefanb@linux.vnet.ibm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , marcandre.lureau@redhat.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This is pure code motion with no functional effect. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/rcutorture.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/rcutorture.c b/tests/rcutorture.c index e8b2169e7dd..256d24ed5ba 100644 --- a/tests/rcutorture.c +++ b/tests/rcutorture.c @@ -65,8 +65,6 @@ #include "qemu/rcu.h" #include "qemu/thread.h" =20 -long long n_reads =3D 0LL; -long n_updates =3D 0L; int nthreadsrunning; =20 #define GOFLAG_INIT 0 @@ -78,11 +76,20 @@ static volatile int goflag =3D GOFLAG_INIT; #define RCU_READ_RUN 1000 =20 #define NR_THREADS 100 -static QemuMutex counts_mutex; static QemuThread threads[NR_THREADS]; static struct rcu_reader_data *data[NR_THREADS]; static int n_threads; =20 +/* + * Statistical counts + * + * These are the sum of local counters at the end of a run. + * Updates are protected by a mutex. + */ +static QemuMutex counts_mutex; +long long n_reads =3D 0LL; +long n_updates =3D 0L; + static void create_thread(void *(*func)(void *)) { if (n_threads >=3D NR_THREADS) { @@ -230,8 +237,9 @@ struct rcu_stress { struct rcu_stress rcu_stress_array[RCU_STRESS_PIPE_LEN] =3D { { 0 } }; struct rcu_stress *rcu_stress_current; int rcu_stress_idx; - int n_mberror; + +/* Updates protected by counts_mutex */ long long rcu_stress_count[RCU_STRESS_PIPE_LEN + 1]; =20 =20 --=20 2.20.1