qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Emilio G . Cota" <cota@braap.org>
Subject: [Qemu-devel] [PATCH 1/4] rcutorture: remove synchronize_rcu from readers
Date: Fri,  9 Mar 2018 14:29:19 +0100	[thread overview]
Message-ID: <20180309132922.24211-2-pbonzini@redhat.com> (raw)
In-Reply-To: <20180309132922.24211-1-pbonzini@redhat.com>

This gives much worse numbers for readers, especially if synchronize_rcu
is made more expensive as is the case with --enable-membarrier.  Before:

   $ tests/rcutorture 10 stress 10
   n_reads: 98304  n_updates: 529  n_mberror: 0
   rcu_stress_count: 98302 2 0 0 0 0 0 0 0 0 0

After:

   $ tests/rcutorture 10 stress 10
   n_reads: 165158482  n_updates: 429  n_mberror: 0
   rcu_stress_count: 165154364 4118 0 0 0 0 0 0 0 0 0

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/rcutorture.c | 4 ----
 1 file changed, 4 deletion(-)

diff --git a/tests/rcutorture.c b/tests/rcutorture.c
index 4002ecf123..2a7201549a 100644
--- a/tests/rcutorture.c
+++ b/tests/rcutorture.c
@@ -238,7 +238,6 @@ long long rcu_stress_count[RCU_STRESS_PIPE_LEN + 1];
 static void *rcu_read_stress_test(void *arg)
 {
     int i;
-    int itercnt = 0;
     struct rcu_stress *p;
     int pc;
     long long n_reads_local = 0;
@@ -269,9 +269,6 @@ static void *rcu_read_stress_test(void *arg)
         }
         rcu_stress_local[pc]++;
         n_reads_local++;
-        if ((++itercnt % 0x1000) == 0) {
-            synchronize_rcu();
-        }
     }
     qemu_mutex_lock(&counts_mutex);
     n_reads += n_reads_local;
-- 
2.14.3

  reply	other threads:[~2018-03-09 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 13:29 [Qemu-devel] [PATCH 0/4] Optionally use membarrier system call for RCU Paolo Bonzini
2018-03-09 13:29 ` Paolo Bonzini [this message]
2018-03-09 13:29 ` [Qemu-devel] [PATCH 2/4] rcu: make memory barriers more explicit Paolo Bonzini
2018-03-09 13:29 ` [Qemu-devel] [PATCH 3/4] membarrier: introduce qemu/sys_membarrier.h Paolo Bonzini
2018-03-09 13:29 ` [Qemu-devel] [PATCH 4/4] membarrier: add --enable-membarrier Paolo Bonzini
2018-03-22  1:29   ` Emilio G. Cota
2018-03-22  8:57     ` Paolo Bonzini
2018-03-09 13:37 ` [Qemu-devel] [PATCH 0/4] Optionally use membarrier system call for RCU no-reply
2018-03-22  1:03 ` Emilio G. Cota

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180309132922.24211-2-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).