linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: kernel test robot <xiaolong.ye@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	lkp@01.org
Subject: Re: [lkp] [ipc/sem.c] 99ac0dfffc: aim9.shared_memory.ops_per_sec -8.9% regression
Date: Tue, 6 Sep 2016 14:03:57 +0200	[thread overview]
Message-ID: <7d29a454-9acf-f711-039f-c193032275be@colorfullife.com> (raw)
In-Reply-To: <20160906064215.GI1687@yexl-desktop>

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

Hi,

On 09/06/2016 08:42 AM, kernel test robot wrote:
> FYI, we noticed a -8.9% regression of aim9.shared_memory.ops_per_sec due to commit:
>
> commit 99ac0dfffcfb34326a880e90e06c30a2a882c692 ("ipc/sem.c: fix complex_count vs. simple op race")
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>
> in testcase: aim9
> on test machine: 4 threads Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz with 4G memory
> with following parameters:
>
>
> commit:
>    5ae37d6d64 ("config/android: Remove CONFIG_IPV6_PRIVACY")
>    99ac0dfffc ("ipc/sem.c: fix complex_count vs. simple op race")
>
> 5ae37d6d64c605ee 99ac0dfffcfb34326a880e90e0
> ---------------- --------------------------
>         fail:runs  %reproduction    fail:runs
>             |             |             |
>           %stddev     %change         %stddev
>               \          |                \
>     1398301 ±  1%      -8.9%    1274143 ±  0%  aim9.shared_memory.ops_per_sec
The shared memory test uses sem_op for token passing.

I think the root cause is the additional smp_mb() after spin_lock(), at 
least I got +8.9% when I removed the barrier.

#./sem_scalebench -t 30 -c 1 -p 1 -i 1 -h 4 -m 0 -d 1 -o 1 -f

(Note: Just removing the barrier is not an option)

--
     Manfred

[-- Attachment #2: patch-ipc-no-smp_mb --]
[-- Type: text/plain, Size: 546 bytes --]

diff --git a/ipc/sem.c b/ipc/sem.c
index 5e318c5..85cc5bf 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -363,14 +363,6 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
 		 */
 		spin_lock(&sem->lock);
 
-		/*
-		 * See 51d7d5205d33
-		 * ("powerpc: Add smp_mb() to arch_spin_is_locked()"):
-		 * A full barrier is required: the write of sem->lock
-		 * must be visible before the read is executed
-		 */
-		smp_mb();
-
 		if (!smp_load_acquire(&sma->complex_mode)) {
 			/* fast path successful! */
 			return sops->sem_num;

      reply	other threads:[~2016-09-06 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06  6:42 [lkp] [ipc/sem.c] 99ac0dfffc: aim9.shared_memory.ops_per_sec -8.9% regression kernel test robot
2016-09-06 12:03 ` Manfred Spraul [this message]

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=7d29a454-9acf-f711-039f-c193032275be@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=xiaolong.ye@intel.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;
as well as URLs for NNTP newsgroup(s).