Boost C++ Libraries: Ticket #5331: usage of deprecated swp instruction on arm https://svn.boost.org/trac10/ticket/5331 <p> Hi, </p> <p> In smart_ptr/detail/spinlock_gcc_arm.hpp There is use of the deprecated swp instruction (for armv6 and above). This emits warning when compiling and also is supposed to have performance penalty on SMP platforms. </p> <p> Can this be fixed using new instructions (ldrex etc..) ? </p> <p> Thanks. </p> <p> Boaz </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5331 Trac 1.4.3 Peter Dimov Wed, 23 Mar 2011 00:04:08 GMT <link>https://svn.boost.org/trac10/ticket/5331#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5331#comment:1</guid> <description> <p> I'm pretty sure that it can be fixed in principle using ldrex/strex; not only that, but it should be possible to implement sp_counted_base for armv6 using these, without resorting to a spinlock. However, I have neither the necessary experience with ARM assembly nor the resources to test the code. </p> </description> <category>Ticket</category> </item> <item> <author>abel@…</author> <pubDate>Thu, 19 Jan 2012 10:12:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5331#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5331#comment:2</guid> <description> <p> Hi, </p> <p> I'm not sure if this is still on the agenda or not. However, I had to fix this specific problem earlier this year. I followed the outline given at <a href="http://www.boost.org/support/bugs.html">http://www.boost.org/support/bugs.html</a> to produce the attached patch against the latest trunk. </p> <p> The patch should take care of deprecation warnings. </p> <p> The latest trunk introduced a memory barrier after the swp instructiopn. However, I think using a memory barrier is only ever necessary when the lock was actually acquired. Yet, the trunk codebase sets one up on each call of try_lock()... This might have some performance implications. </p> <p> As of right now, try_lock() is called in lock() inside a loop which explicitly yields the thread if try_lock() failed. It might be better to have that loop in try_lock() instead and only do a dmb if the lock was acquired. However, this might change the API in more ways than most people would be comfortable with, I guess... </p> </description> <category>Ticket</category> </item> <item> <author>abel@…</author> <pubDate>Thu, 19 Jan 2012 10:14:05 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5331 https://svn.boost.org/trac10/ticket/5331 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arm_spinlock_fix.patch</span> </li> </ul> <p> Proposed patch for strex and ldrex usage on AMR 6 and ARM7. </p> Ticket abel@… Thu, 19 Jan 2012 10:22:03 GMT attachment set https://svn.boost.org/trac10/ticket/5331 https://svn.boost.org/trac10/ticket/5331 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arm_spinlock_fix.2.patch</span> </li> </ul> <p> [Fixed] Proposed patch for strex and ldrex usage on AMR 6 and ARM7. </p> Ticket abel@… Thu, 19 Jan 2012 10:22:37 GMT <link>https://svn.boost.org/trac10/ticket/5331#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5331#comment:3</guid> <description> <p> Argh, sorry, forgot a semicolon while pasting my fix in there... </p> </description> <category>Ticket</category> </item> <item> <author>abel@…</author> <pubDate>Fri, 09 Mar 2012 14:32:38 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/5331#comment:4 https://svn.boost.org/trac10/ticket/5331#comment:4 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.46.0</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> <p> bump </p> Ticket Peter Dimov Mon, 12 Mar 2012 17:31:24 GMT <link>https://svn.boost.org/trac10/ticket/5331#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5331#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77315" title="Apply patch from #5331. Refs #5331.">[77315]</a>) Apply patch from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5331" title="#5331: Bugs: usage of deprecated swp instruction on arm (closed: fixed)">#5331</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5331" title="#5331: Bugs: usage of deprecated swp instruction on arm (closed: fixed)">#5331</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Mon, 12 Mar 2012 17:37:54 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5331#comment:6 https://svn.boost.org/trac10/ticket/5331#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77317" title="Merge [77315] to release. Closes #5331.">[77317]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/77315" title="Apply patch from #5331. Refs #5331.">[77315]</a> to release. Closes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5331" title="#5331: Bugs: usage of deprecated swp instruction on arm (closed: fixed)">#5331</a>. </p> Ticket