]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm, thp: replace smp_mb after atomic_add by smp_mb__after_atomic
authorWaiman Long <Waiman.Long@hp.com>
Thu, 26 Jun 2014 00:42:35 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:35 +0000 (10:42 +1000)
commita2e03c300c9351249cacf2a531dfd03b74a3df6c
treeafba017e3578e96af3929ec235d9b7f6423c5e98
parent192d7878bbc2fa6b227853a996f2c18936209ca9
mm, thp: replace smp_mb after atomic_add by smp_mb__after_atomic

In some architectures like x86, atomic_add() is a full memory barrier.  In
that case, an additional smp_mb() is just a waste of time.  This patch
replaces that smp_mb() by smp_mb__after_atomic() which will avoid the
redundant memory barrier in some architectures.

With a 3.16-rc1 based kernel, this patch reduced the execution time of
breaking 1000 transparent huge pages from 38,245us to 30,964us.  A
reduction of 19% which is quite sizeable.  It also reduces the %cpu time
of the __split_huge_page_refcount function in the perf profile from 2.18%
to 1.15%.

Signed-off-by: Waiman Long <Waiman.Long@hp.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Scott J Norton <scott.norton@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c