From: Ingo Molnar <mingo@kernel.org>
To: "Chen, Dennis (SRDC SW)" <Dennis1.Chen@amd.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>
Subject: Re: semaphore and mutex in current Linux kernel (3.2.2)
Date: Sun, 1 Apr 2012 14:19:43 +0200 [thread overview]
Message-ID: <20120401121943.GA11893@gmail.com> (raw)
In-Reply-To: <491D6B4EAD0A714894D8AD22F4BDE0439F94AB@SCYBEXDAG02.amd.com>
* Chen, Dennis (SRDC SW) <Dennis1.Chen@amd.com> wrote:
> Documentation/mutex-design.txt:
>
> "- 'struct mutex' is smaller on most architectures: E.g. on x86,
> 'struct semaphore' is 20 bytes, 'struct mutex' is 16 bytes.
> A smaller structure size means less RAM footprint, and better
> CPU-cache utilization."
> ================================================================
>
> Now in my x86-64 32-bit Linux environment, 'struct semaphone'
> is 16 bytes, 'struct mutex' is 20 bytes. So seems the RAM
> footprint advantages are not there...
It got larger due to the adaptive spin-mutex performance
optimization.
> For the performance advantages followed, I don't have the
> ./test-mutex and maybe the testing environment, so haven't the
> 1st hand data for this item...
Well, a way to reproduce that would be to find a lock_mutex
intense workload ('perf top -g', etc.), and then changing back
the underlying mutex to a semaphore, and measure the performance
of the two primitives.
Thanks,
Ingo
next prev parent reply other threads:[~2012-04-01 12:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-01 9:56 Chen, Dennis (SRDC SW)
2012-04-01 12:19 ` Ingo Molnar [this message]
2012-04-02 15:28 ` Chen, Dennis (SRDC SW)
2012-04-03 7:52 ` Ingo Molnar
2012-04-05 8:37 ` Chen, Dennis (SRDC SW)
2012-04-05 14:15 ` Clemens Ladisch
2012-04-06 9:45 ` Chen, Dennis (SRDC SW)
2012-04-06 10:10 ` Clemens Ladisch
2012-04-06 17:47 ` Chen, Dennis (SRDC SW)
2012-04-09 18:45 ` Paul E. McKenney
2012-04-11 5:04 ` Chen, Dennis (SRDC SW)
2012-04-11 17:30 ` Paul E. McKenney
2012-04-12 9:42 ` Chen, Dennis (SRDC SW)
2012-04-12 15:18 ` Paul E. McKenney
2012-04-13 14:15 ` Chen, Dennis (SRDC SW)
2012-04-13 18:43 ` Paul E. McKenney
2012-04-16 8:33 ` [PATCH 0/2] tools perf: Add a new benchmark tool for semaphore/mutex Chen, Dennis (SRDC SW)
2012-04-16 9:24 ` Ingo Molnar
2012-04-16 14:10 ` Chen, Dennis (SRDC SW)
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=20120401121943.GA11893@gmail.com \
--to=mingo@kernel.org \
--cc=Dennis1.Chen@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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
Powered by JetHome