[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070403164455.83ae7b36.akpm@linux-foundation.org>
Date: Tue, 3 Apr 2007 16:44:55 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jakub Jelinek <jakub@...hat.com>,
Ulrich Drepper <drepper@...hat.com>,
Andi Kleen <andi@...stfloor.org>,
Rik van Riel <riel@...hat.com>,
Linux Kernel <linux-kernel@...r.kernel.org>,
linux-mm@...ck.org, Hugh Dickins <hugh@...itas.com>
Subject: Re: missing madvise functionality
On Tue, 3 Apr 2007 14:49:48 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:
> > int
> > main (void)
> > {
> > pthread_t th[32];
> > int i;
> > for (i = 0; i < 32; i++)
> > if (pthread_create (&th[i], NULL, tf, NULL))
> > exit (4);
> > for (i = 0; i < 32; i++)
> > pthread_join (th[i], NULL);
> > return 0;
> > }
> >
>
> whee. 135,000 context switches/sec on a slow 2-way. mmap_sem, most
> likely. That is ungood.
>
> Did anyone monitor the context switch rate with the mysql test?
>
> Interestingly, your test app (with s/100000/1000) runs to completion in 13
> seocnd on the slow 2-way. On a fast 8-way, it took 52 seconds and
> sustained 40,000 context switches/sec. That's a bit unexpected.
>
> Both machines show ~8% idle time, too :(
Rohit solved this puzzle.
The 2-way is a single package, hyperthreaded.
The 8-way is two-package, four cores in each.
So on the 8-way, that lock is getting transferred between the two packages
like crazy. Running the benchmark on just cpus 0 and 1 (taskset -c 0,1)
took the runtime down to eight seconds (from 52!) and the context switch
rate went up to 200,000/sec (from 45,000).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists