aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-11 16:59:05 -0500
committerIngo Molnar <mingo@kernel.org>2013-12-16 05:36:09 -0500
commitfb2b581968db140586e8d7db38ff278f60872313 (patch)
tree8e47fda0c89ce87c77e8f45c33f114f81a463f10
parent2ecf810121c7eae34473b8fa108112036bc61127 (diff)
Documentation/memory-barriers.txt: Add long atomic examples to memory-barriers.txt
Although the atomic_long_t functions are quite useful, they are a bit obscure. This commit therefore adds the common ones alongside their atomic_t counterparts in Documentation/memory-barriers.txt. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: <linux-arch@vger.kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/r/1386799151-2219-2-git-send-email-paulmck@linux.vnet.ibm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--Documentation/memory-barriers.txt24
1 files changed, 13 insertions, 11 deletions
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 1d067235b0bc..2d22da095a60 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1728,21 +1728,23 @@ explicit lock operations, described later). These include:
1728 1728
1729 xchg(); 1729 xchg();
1730 cmpxchg(); 1730 cmpxchg();
1731 atomic_xchg(); 1731 atomic_xchg(); atomic_long_xchg();
1732 atomic_cmpxchg(); 1732 atomic_cmpxchg(); atomic_long_cmpxchg();
1733 atomic_inc_return(); 1733 atomic_inc_return(); atomic_long_inc_return();
1734 atomic_dec_return(); 1734 atomic_dec_return(); atomic_long_dec_return();
1735 atomic_add_return(); 1735 atomic_add_return(); atomic_long_add_return();
1736 atomic_sub_return(); 1736 atomic_sub_return(); atomic_long_sub_return();
1737 atomic_inc_and_test(); 1737 atomic_inc_and_test(); atomic_long_inc_and_test();
1738 atomic_dec_and_test(); 1738 atomic_dec_and_test(); atomic_long_dec_and_test();
1739 atomic_sub_and_test(); 1739 atomic_sub_and_test(); atomic_long_sub_and_test();
1740 atomic_add_negative(); 1740 atomic_add_negative(); atomic_long_add_negative();
1741 atomic_add_unless(); /* when succeeds (returns 1) */
1742 test_and_set_bit(); 1741 test_and_set_bit();
1743 test_and_clear_bit(); 1742 test_and_clear_bit();
1744 test_and_change_bit(); 1743 test_and_change_bit();
1745 1744
1745 /* when succeeds (returns 1) */
1746 atomic_add_unless(); atomic_long_add_unless();
1747
1746These are used for such things as implementing LOCK-class and UNLOCK-class 1748These are used for such things as implementing LOCK-class and UNLOCK-class
1747operations and adjusting reference counters towards object destruction, and as 1749operations and adjusting reference counters towards object destruction, and as
1748such the implicit memory barrier effects are necessary. 1750such the implicit memory barrier effects are necessary.