From: Mel Gorman <mgorman@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alex Shi <alex.shi@linaro.org>, Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Fengguang Wu <fengguang.wu@intel.com>,
H Peter Anvin <hpa@zytor.com>, Linux-X86 <x86@kernel.org>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/4] Fix ebizzy performance regression due to X86 TLB range flush v2
Date: Mon, 16 Dec 2013 11:16:37 +0000 [thread overview]
Message-ID: <20131216111637.GR11295@suse.de> (raw)
In-Reply-To: <CA+55aFz5ZTEiEELhPaQd97TorAKjqrKCmJc9O0NE1Nyri65Pzw@mail.gmail.com>
On Sun, Dec 15, 2013 at 10:34:25AM -0800, Linus Torvalds wrote:
> On Sun, Dec 15, 2013 at 7:55 AM, Mel Gorman <mgorman@suse.de> wrote:
> >
> > Short answer -- There appears to be a second bug where 3.13-rc3 is less
> > fair to threads getting time on the CPU.
>
> Hmm. Can you point me at the (fixed) microbenchmark you mention?
>
ebizzy is what I was using to see the per-thread performance. It's at
http://sourceforge.net/projects/ebizzy/. It's patched with the patch below
to give per-thread stats.
You probably want to run it manually but FWIW, the results I posted were
using mmtests (https://github.com/gormanm/mmtests) to build, patch,
run ebizzy and generate the report. The configuration file I used was
configs/config-global-dhp__tlbflush-performance. I have not tried a manual
performance analysis yet as an automated bisection is in progress to see
can the thread spread problem be found the easy way.
diff --git a/ebizzy.c b/ebizzy.c
index 76c7492..3e7644f 100644
--- a/ebizzy.c
+++ b/ebizzy.c
@@ -83,7 +83,7 @@ static char **hole_mem;
static unsigned int page_size;
static time_t start_time;
static volatile int threads_go;
-static unsigned int records_read;
+static unsigned int *thread_records_read;
static void
usage(void)
@@ -436,6 +436,7 @@ search_mem(void)
static void *
thread_run(void *arg)
{
+ unsigned int *records = (unsigned int *)arg;
if (verbose > 1)
printf("Thread started\n");
@@ -444,7 +445,7 @@ thread_run(void *arg)
while (threads_go == 0);
- records_read += search_mem();
+ *records = search_mem();
if (verbose > 1)
printf("Thread finished, %f seconds\n",
@@ -471,12 +472,19 @@ start_threads(void)
struct rusage start_ru, end_ru;
struct timeval usr_time, sys_time;
int err;
+ unsigned int total_records = 0;
if (verbose)
printf("Threads starting\n");
+ thread_records_read = calloc(threads, sizeof(unsigned int));
+ if (!thread_records_read) {
+ fprintf(stderr, "Error allocating thread_records_read\n");
+ exit(1);
+ }
+
for (i = 0; i < threads; i++) {
- err = pthread_create(&thread_array[i], NULL, thread_run, NULL);
+ err = pthread_create(&thread_array[i], NULL, thread_run, &thread_records_read[i]);
if (err) {
fprintf(stderr, "Error creating thread %d\n", i);
exit(1);
@@ -505,13 +513,21 @@ start_threads(void)
fprintf(stderr, "Error joining thread %d\n", i);
exit(1);
}
+ total_records += thread_records_read[i];
}
if (verbose)
printf("Threads finished\n");
- printf("%u records/s\n",
- (unsigned int) (((double) records_read)/elapsed));
+ printf("%u records/s",
+ (unsigned int) (((double) total_records)/elapsed));
+
+ for (i = 0; i < threads; i++) {
+ printf(" %u", (unsigned int) (((double) thread_records_read[i])/elapsed));
+ }
+ printf("\n");
+
+ free(thread_records_read);
usr_time = difftimeval(&end_ru.ru_utime, &start_ru.ru_utime);
sys_time = difftimeval(&end_ru.ru_stime, &start_ru.ru_stime);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-12-16 11:16 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 20:01 Mel Gorman
2013-12-13 20:01 ` [PATCH 1/4] x86: mm: Clean up inconsistencies when flushing TLB ranges Mel Gorman
2013-12-13 20:01 ` [PATCH 2/4] x86: mm: Account for TLB flushes only when debugging Mel Gorman
2013-12-13 20:01 ` [PATCH 3/4] x86: mm: Change tlb_flushall_shift for IvyBridge Mel Gorman
2013-12-13 20:01 ` [PATCH 4/4] x86: mm: Eliminate redundant page table walk during TLB range flushing Mel Gorman
2013-12-13 21:16 ` [PATCH 0/4] Fix ebizzy performance regression due to X86 TLB range flush v2 Linus Torvalds
2013-12-13 22:38 ` H. Peter Anvin
2013-12-16 10:39 ` Mel Gorman
2013-12-16 17:17 ` Linus Torvalds
2013-12-17 9:55 ` Mel Gorman
2013-12-15 15:55 ` Mel Gorman
2013-12-15 16:17 ` Mel Gorman
2013-12-15 18:34 ` Linus Torvalds
2013-12-16 11:16 ` Mel Gorman [this message]
2013-12-16 10:24 ` Ingo Molnar
2013-12-16 12:59 ` Mel Gorman
2013-12-16 13:44 ` Ingo Molnar
2013-12-17 9:21 ` Mel Gorman
2013-12-17 9:26 ` Peter Zijlstra
2013-12-17 11:00 ` Ingo Molnar
2013-12-17 14:32 ` Mel Gorman
2013-12-17 14:42 ` Ingo Molnar
2013-12-17 17:54 ` Mel Gorman
2013-12-18 10:24 ` Ingo Molnar
2013-12-19 14:24 ` Mel Gorman
2013-12-19 16:49 ` Ingo Molnar
2013-12-20 11:13 ` Mel Gorman
2013-12-20 11:18 ` Ingo Molnar
2013-12-20 12:00 ` Mel Gorman
2013-12-20 12:20 ` Ingo Molnar
2013-12-20 13:55 ` Mel Gorman
2013-12-18 7:28 ` Fengguang Wu
2013-12-19 14:34 ` Mel Gorman
2013-12-20 15:51 ` Fengguang Wu
2013-12-20 16:44 ` Mel Gorman
2013-12-21 15:49 ` Fengguang Wu
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=20131216111637.GR11295@suse.de \
--to=mgorman@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@linaro.org \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox