From: Imre Palik <imrep.amz@gmail.com>
To: paulmck@linux.vnet.ibm.com
Cc: perfbook@vger.kernel.org, "Palik, Imre" <imrep.amz@gmail.com>
Subject: [PATCH 1/4] Changing counttorture defaults.
Date: Mon, 23 Jul 2018 22:07:25 +0200 [thread overview]
Message-ID: <1532376448-15103-2-git-send-email-imrep.amz@gmail.com> (raw)
In-Reply-To: <1532376448-15103-1-git-send-email-imrep.amz@gmail.com>
From: "Palik, Imre" <imrep.amz@gmail.com>
As the counter implementations are supposed to implement write-mostly
parallelism, this patch changes the default behaviour of counttorture to reflect
it.
Signed-off-by: Imre Palik <imrep.amz@gmail.com>
---
CodeSamples/count/counttorture.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/CodeSamples/count/counttorture.h b/CodeSamples/count/counttorture.h
index 3276d68..ff0dd72 100644
--- a/CodeSamples/count/counttorture.h
+++ b/CodeSamples/count/counttorture.h
@@ -164,19 +164,19 @@ void perftestrun(int nthreads, int nreaders, int nupdaters)
exit(EXIT_SUCCESS);
}
-void perftest(int nreaders, int cpustride)
+void perftest(int nwriters, int cpustride)
{
int i;
long arg;
- perftestinit(nreaders + 1);
- for (i = 0; i < nreaders; i++) {
+ perftestinit(nwriters + 1);
+ for (i = 0; i < nwriters; i++) {
arg = (long)(i * cpustride);
- create_thread(count_read_perf_test, (void *)arg);
+ create_thread(count_update_perf_test, (void *)arg);
}
arg = (long)(i * cpustride);
- create_thread(count_update_perf_test, (void *)arg);
- perftestrun(i + 1, nreaders, 1);
+ create_thread(count_read_perf_test, (void *)arg);
+ perftestrun(i + 1, 1, nwriters);
}
void rperftest(int nreaders, int cpustride)
--
2.7.4
next prev parent reply other threads:[~2018-07-23 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-23 20:07 Changing non-volatile access to volatile in counter examples Imre Palik
2018-07-23 20:07 ` Imre Palik [this message]
2018-07-23 20:07 ` [PATCH 2/4] Making the counter implementations safer Imre Palik
2018-07-23 20:07 ` [PATCH 3/4] Updating count.tex with new counter code Imre Palik
2018-07-23 20:07 ` [PATCH 4/4] Regenerating the atomic counter graph on a more modern CPU Imre Palik
2018-07-23 20:55 ` Changing non-volatile access to volatile in counter examples Paul E. McKenney
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=1532376448-15103-2-git-send-email-imrep.amz@gmail.com \
--to=imrep.amz@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=perfbook@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.