<div><br></div><div><br><div class="gmail_quote"><div dir="auto">On Thu, Jun 14, 2018 at 1:01 PM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com">armccurdy@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Jun 14, 2018 at 12:24 PM, Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt; On Thu, Jun 14, 2018 at 12:12 PM Andre McCurdy &lt;<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Jun 14, 2018 at 9:40 AM, Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; On 6/14/18 5:10 AM, Herve Jourdain wrote:<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I believe I solved that same problem by just adding, in the case of armv8<br>
&gt;&gt; &gt;&gt; (which I believe may be the new architecture you&#39;re referring to):<br>
&gt;&gt; &gt;&gt; MUTEX_armv8 = &quot;&quot;<br>
&gt;&gt; &gt;&gt; This way, it allows previous versions to work just like they did before,<br>
&gt;&gt; &gt;&gt; without having to disable ARM assembler mutex code for architectures that<br>
&gt;&gt; &gt;&gt; support it correctly - up to armv7ve I believe.<br>
&gt;&gt; &gt;&gt; Of course, we might need to also have a good definition for armv8, which is<br>
&gt;&gt; &gt;&gt; the object of another thread.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; right thats a better approach.<br>
&gt;&gt;<br>
&gt;&gt; SWP is not guaranteed to work on SMP systems... and even if it does,<br>
&gt;&gt; performance is likely to be worse than the pthreads version (which can<br>
&gt;&gt; take advantage of the newer instructions).<br>
&gt;&gt;<br>
&gt;&gt;   <a href="https://community.arm.com/processors/b/blog/posts/locks-swps-and-two-smoking-barriers" rel="noreferrer" target="_blank">https://community.arm.com/processors/b/blog/posts/locks-swps-and-two-smoking-barriers</a><br>
&gt;&gt;<br>
&gt;&gt; In general, use of hand optimised assembler mutex implementations in<br>
&gt;&gt; user space isn&#39;t something to be encouraged - use pthreads (or maybe a<br>
&gt;&gt; gcc intrinsic) instead.<br>
&gt;&gt;<br>
&gt;<br>
&gt; question is about disabling it on old arm machines, do we have data where<br>
&gt; we know that other sync methods without swp works better on armv5 and lower ?<br>
<br>
On armv5 and below a hand optimised implementation using SWP is likely<br>
to be faster than pthreads. No one is suggesting otherwise.<br>
<br>
On SMP (highly likely nowadays for armv7 and above), SWP simply might<br>
not work (aside from the fact that if it does work, it&#39;s likely to be<br>
slower than pthreads). It&#39;s not really a question of performance<br>
there, so the proposal to only disable SWP for armv8 doesn&#39;t seem like<br>
a safe solution.<br>
</blockquote><div dir="auto"><br></div><div dir="auto">Suggestion is not to just do it for armv8 but</div><div dir="auto">To keep it there where its beneficial </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Using pthreads unconditionally is safe and easy. Unless you can prove<br>
that hand optimised SWP is really a big win for armv5 (is anyone<br>
really running a performance critical database on an armv5 system?)<br>
why not keep the recipe simple and use pthreads everywhere?<br>
<br>
&gt;&gt; I think the original patch is good.<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt; Cheers,<br>
&gt;&gt; &gt;&gt; Herve<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; -----Original Message-----<br>
&gt;&gt; &gt;&gt; From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org" target="_blank">openembedded-core-bounces@lists.openembedded.org</a><br>
&gt;&gt; &gt;&gt; [mailto:<a href="mailto:openembedded-core-bounces@lists.openembedded.org" target="_blank">openembedded-core-bounces@lists.openembedded.org</a>] On Behalf Of<br>
&gt;&gt; &gt;&gt; Ovidiu Panait<br>
&gt;&gt; &gt;&gt; Sent: jeudi 14 juin 2018 13:55<br>
&gt;&gt; &gt;&gt; To: <a href="mailto:openembedded-core@lists.openembedded.org" target="_blank">openembedded-core@lists.openembedded.org</a><br>
&gt;&gt; &gt;&gt; Subject: [OE-core] [PATCH 1/1] db: disable the ARM assembler mutex code<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The swpb in macro MUTEX_SET will cause &quot;undefined instruction&quot; error on the<br>
&gt;&gt; &gt;&gt; new arm arches which don&#39;t support this assembly instruction any more. If<br>
&gt;&gt; &gt;&gt; use ldrex/strex to replace swpb, the old arm arches don&#39;t support them. So<br>
&gt;&gt; &gt;&gt; to avoid this issue, just disable the ARM assembler mutex code, and use the<br>
&gt;&gt; &gt;&gt; default pthreads mutex.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Li Zhou &lt;<a href="mailto:li.zhou@windriver.com" target="_blank">li.zhou@windriver.com</a>&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Catalin Enache &lt;<a href="mailto:catalin.enache@windriver.com" target="_blank">catalin.enache@windriver.com</a>&gt;<br>
&gt;&gt; &gt;&gt; Signed-off-by: Ovidiu Panait &lt;<a href="mailto:ovidiu.panait@windriver.com" target="_blank">ovidiu.panait@windriver.com</a>&gt;<br>
&gt;&gt; &gt;&gt; ---<br>
&gt;&gt; &gt;&gt;  meta/recipes-support/db/<a href="http://db_5.3.28.bb" rel="noreferrer" target="_blank">db_5.3.28.bb</a> | 13 +------------<br>
&gt;&gt; &gt;&gt;  1 file changed, 1 insertion(+), 12 deletions(-)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; diff --git a/meta/recipes-support/db/<a href="http://db_5.3.28.bb" rel="noreferrer" target="_blank">db_5.3.28.bb</a><br>
&gt;&gt; &gt;&gt; b/meta/recipes-support/db/<a href="http://db_5.3.28.bb" rel="noreferrer" target="_blank">db_5.3.28.bb</a><br>
&gt;&gt; &gt;&gt; index 093ee44909..15b4155a29 100644<br>
&gt;&gt; &gt;&gt; --- a/meta/recipes-support/db/<a href="http://db_5.3.28.bb" rel="noreferrer" target="_blank">db_5.3.28.bb</a><br>
&gt;&gt; &gt;&gt; +++ b/meta/recipes-support/db/<a href="http://db_5.3.28.bb" rel="noreferrer" target="_blank">db_5.3.28.bb</a><br>
&gt;&gt; &gt;&gt; @@ -59,18 +59,7 @@ FILES_SOLIBSDEV = &quot;${libdir}/libdb.so<br>
&gt;&gt; &gt;&gt; ${libdir}/libdb_cxx.so&quot;<br>
&gt;&gt; &gt;&gt;  # All the --disable-* options replace --enable-smallbuild, which breaks a<br>
&gt;&gt; &gt;&gt; bunch of stuff (eg. postfix)  DB5_CONFIG ?= &quot;--enable-o_direct<br>
&gt;&gt; &gt;&gt; --disable-cryptography --disable-queue --disable-replication<br>
&gt;&gt; &gt;&gt; --disable-verify --disable-compat185 --disable-sql&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; -EXTRA_OECONF = &quot;${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot&quot;<br>
&gt;&gt; &gt;&gt; -<br>
&gt;&gt; &gt;&gt; -# Override the MUTEX setting here, the POSIX library is -# the default -<br>
&gt;&gt; &gt;&gt; &quot;POSIX/pthreads/library&quot;.<br>
&gt;&gt; &gt;&gt; -# Don&#39;t ignore the nice SWP instruction on the ARM:<br>
&gt;&gt; &gt;&gt; -# These enable the ARM assembler mutex code, this won&#39;t -# work with thumb<br>
&gt;&gt; &gt;&gt; compilation...<br>
&gt;&gt; &gt;&gt; -ARM_MUTEX = &quot;--with-mutex=ARM/gcc-assembly&quot;<br>
&gt;&gt; &gt;&gt; -MUTEX = &quot;&quot;<br>
&gt;&gt; &gt;&gt; -MUTEX_arm = &quot;${ARM_MUTEX}&quot;<br>
&gt;&gt; &gt;&gt; -MUTEX_armeb = &quot;${ARM_MUTEX}&quot;<br>
&gt;&gt; &gt;&gt; -EXTRA_OECONF += &quot;${MUTEX} STRIP=true&quot;<br>
&gt;&gt; &gt;&gt; +EXTRA_OECONF = &quot;${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot<br>
&gt;&gt; &gt;&gt; STRIP=true&quot;<br>
&gt;&gt; &gt;&gt;  EXTRA_OEMAKE += &quot;LIBTOOL=&#39;./${HOST_SYS}-libtool&#39;&quot;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  EXTRA_AUTORECONF += &quot;--exclude=autoheader  -I ${S}/dist/aclocal<br>
&gt;&gt; &gt;&gt; -I${S}/dist/aclocal_java&quot;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; 2.17.1<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; Openembedded-core mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
&gt;&gt; &gt;&gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Openembedded-core mailing list<br>
&gt;&gt; &gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
&gt;&gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
&gt;&gt; &gt;<br>
</blockquote></div></div>