* [PATCH] db: disable the ARM assembler mutex code
@ 2016-11-04 9:07 Li Zhou
2016-11-04 9:43 ` Zhou, Li
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Li Zhou @ 2016-11-04 9:07 UTC (permalink / raw)
To: openembedded-core
The swpb in macro MUTEX_SET will cause "undefined instruction" error
on the new arm arches which don't support this assembly instruction
any more. If use ldrex/strex to replace swpb, the old arm arches don't
support them. So to avoid this issue, just disable the ARM assembler
mutex code, and use the default pthreads mutex.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
meta/recipes-support/db/db_6.0.30.bb | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
index 50a469b..2d08b5e 100644
--- a/meta/recipes-support/db/db_6.0.30.bb
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
-# Override the MUTEX setting here, the POSIX library is
-# the default - "POSIX/pthreads/library".
-# Don't ignore the nice SWP instruction on the ARM:
-# These enable the ARM assembler mutex code
-ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
-MUTEX = ""
-MUTEX_arm = "${ARM_MUTEX}"
-MUTEX_armeb = "${ARM_MUTEX}"
-EXTRA_OECONF += "${MUTEX}"
EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
# Cancel the site stuff - it's set for db3 and destroys the
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] db: disable the ARM assembler mutex code
@ 2016-11-04 9:12 Li Zhou
0 siblings, 0 replies; 11+ messages in thread
From: Li Zhou @ 2016-11-04 9:12 UTC (permalink / raw)
To: openembedded-core
The swpb in macro MUTEX_SET will cause "undefined instruction" error
on the new arm arches which don't support this assembly instruction
any more. If use ldrex/strex to replace swpb, the old arm arches don't
support them. So to avoid this issue, just disable the ARM assembler
mutex code, and use the default pthreads mutex.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
meta/recipes-support/db/db_6.0.30.bb | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
index 50a469b..2d08b5e 100644
--- a/meta/recipes-support/db/db_6.0.30.bb
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
-# Override the MUTEX setting here, the POSIX library is
-# the default - "POSIX/pthreads/library".
-# Don't ignore the nice SWP instruction on the ARM:
-# These enable the ARM assembler mutex code
-ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
-MUTEX = ""
-MUTEX_arm = "${ARM_MUTEX}"
-MUTEX_armeb = "${ARM_MUTEX}"
-EXTRA_OECONF += "${MUTEX}"
EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
# Cancel the site stuff - it's set for db3 and destroys the
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 9:07 [PATCH] db: disable the ARM assembler mutex code Li Zhou
@ 2016-11-04 9:43 ` Zhou, Li
2016-11-04 16:12 ` Leonardo Sandoval
2016-11-04 18:22 ` Khem Raj
2 siblings, 0 replies; 11+ messages in thread
From: Zhou, Li @ 2016-11-04 9:43 UTC (permalink / raw)
To: openembedded-core
Some more explanations:
Berkeley DB's assembly mutex code for arm is related with arm arch version.
The old version DB code uses old arm instruction (such as swpb), which
isn't supported by new arm arch (such as armv7).
The new version DB (maybe from 6.1.29 or 6.1.26) uses new arm
instruction (such as ldrex/strex), which isn't supported by old arm arch
(such as armv5).
To support all the arm arches, and consider that the Berkeley DB code
will upgrade in the future, I suggest disable the ARM assembler mutex
code, and use the default pthreads mutex.
Thanks.
Zhou Li
On 11/04/2016 05:07 PM, Li Zhou wrote:
> The swpb in macro MUTEX_SET will cause "undefined instruction" error
> on the new arm arches which don't support this assembly instruction
> any more. If use ldrex/strex to replace swpb, the old arm arches don't
> support them. So to avoid this issue, just disable the ARM assembler
> mutex code, and use the default pthreads mutex.
>
> Signed-off-by: Li Zhou <li.zhou@windriver.com>
> ---
> meta/recipes-support/db/db_6.0.30.bb | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
> index 50a469b..2d08b5e 100644
> --- a/meta/recipes-support/db/db_6.0.30.bb
> +++ b/meta/recipes-support/db/db_6.0.30.bb
> @@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
>
> EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
>
> -# Override the MUTEX setting here, the POSIX library is
> -# the default - "POSIX/pthreads/library".
> -# Don't ignore the nice SWP instruction on the ARM:
> -# These enable the ARM assembler mutex code
> -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
> -MUTEX = ""
> -MUTEX_arm = "${ARM_MUTEX}"
> -MUTEX_armeb = "${ARM_MUTEX}"
> -EXTRA_OECONF += "${MUTEX}"
> EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
>
> # Cancel the site stuff - it's set for db3 and destroys the
--
Best Regards!
Zhou Li
Phone number: 86-10-84778511
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 9:07 [PATCH] db: disable the ARM assembler mutex code Li Zhou
2016-11-04 9:43 ` Zhou, Li
@ 2016-11-04 16:12 ` Leonardo Sandoval
2016-11-04 18:18 ` Mark Hatle
2016-11-04 18:22 ` Khem Raj
2 siblings, 1 reply; 11+ messages in thread
From: Leonardo Sandoval @ 2016-11-04 16:12 UTC (permalink / raw)
To: Li Zhou, openembedded-core
This patch cannot be applied because the modified file is not track by
oe-core.
On 11/04/2016 03:07 AM, Li Zhou wrote:
> The swpb in macro MUTEX_SET will cause "undefined instruction" error
> on the new arm arches which don't support this assembly instruction
> any more. If use ldrex/strex to replace swpb, the old arm arches don't
> support them. So to avoid this issue, just disable the ARM assembler
> mutex code, and use the default pthreads mutex.
>
> Signed-off-by: Li Zhou <li.zhou@windriver.com>
> ---
> meta/recipes-support/db/db_6.0.30.bb | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
> index 50a469b..2d08b5e 100644
> --- a/meta/recipes-support/db/db_6.0.30.bb
> +++ b/meta/recipes-support/db/db_6.0.30.bb
> @@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
>
> EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
>
> -# Override the MUTEX setting here, the POSIX library is
> -# the default - "POSIX/pthreads/library".
> -# Don't ignore the nice SWP instruction on the ARM:
> -# These enable the ARM assembler mutex code
> -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
> -MUTEX = ""
> -MUTEX_arm = "${ARM_MUTEX}"
> -MUTEX_armeb = "${ARM_MUTEX}"
> -EXTRA_OECONF += "${MUTEX}"
> EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
>
> # Cancel the site stuff - it's set for db3 and destroys the
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 16:12 ` Leonardo Sandoval
@ 2016-11-04 18:18 ` Mark Hatle
0 siblings, 0 replies; 11+ messages in thread
From: Mark Hatle @ 2016-11-04 18:18 UTC (permalink / raw)
To: Leonardo Sandoval, Li Zhou, openembedded-core
On 11/4/16 11:12 AM, Leonardo Sandoval wrote:
> This patch cannot be applied because the modified file is not track by
> oe-core.
>
The original submitted should have mentioned this patch is against Jethro.
However the patch is directly applicable to master, morty and korgoth as well.
Li, please rebase this against master and then ask for it to be backported to
the others.
--Mark
> On 11/04/2016 03:07 AM, Li Zhou wrote:
>> The swpb in macro MUTEX_SET will cause "undefined instruction" error
>> on the new arm arches which don't support this assembly instruction
>> any more. If use ldrex/strex to replace swpb, the old arm arches don't
>> support them. So to avoid this issue, just disable the ARM assembler
>> mutex code, and use the default pthreads mutex.
>>
>> Signed-off-by: Li Zhou <li.zhou@windriver.com>
>> ---
>> meta/recipes-support/db/db_6.0.30.bb | 9 ---------
>> 1 file changed, 9 deletions(-)
>>
>> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
>> index 50a469b..2d08b5e 100644
>> --- a/meta/recipes-support/db/db_6.0.30.bb
>> +++ b/meta/recipes-support/db/db_6.0.30.bb
>> @@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
>>
>> EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
>>
>> -# Override the MUTEX setting here, the POSIX library is
>> -# the default - "POSIX/pthreads/library".
>> -# Don't ignore the nice SWP instruction on the ARM:
>> -# These enable the ARM assembler mutex code
>> -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
>> -MUTEX = ""
>> -MUTEX_arm = "${ARM_MUTEX}"
>> -MUTEX_armeb = "${ARM_MUTEX}"
>> -EXTRA_OECONF += "${MUTEX}"
>> EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
>>
>> # Cancel the site stuff - it's set for db3 and destroys the
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 9:07 [PATCH] db: disable the ARM assembler mutex code Li Zhou
2016-11-04 9:43 ` Zhou, Li
2016-11-04 16:12 ` Leonardo Sandoval
@ 2016-11-04 18:22 ` Khem Raj
2016-11-04 20:29 ` Burton, Ross
2016-11-04 23:14 ` Phil Blundell
2 siblings, 2 replies; 11+ messages in thread
From: Khem Raj @ 2016-11-04 18:22 UTC (permalink / raw)
To: Li Zhou, openembedded-core
[-- Attachment #1.1: Type: text/plain, Size: 1533 bytes --]
On 11/4/16 2:07 AM, Li Zhou wrote:
> The swpb in macro MUTEX_SET will cause "undefined instruction" error
> on the new arm arches which don't support this assembly instruction
> any more. If use ldrex/strex to replace swpb, the old arm arches don't
> support them. So to avoid this issue, just disable the ARM assembler
> mutex code, and use the default pthreads mutex.
>
> Signed-off-by: Li Zhou <li.zhou@windriver.com>
> ---
> meta/recipes-support/db/db_6.0.30.bb | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
> index 50a469b..2d08b5e 100644
> --- a/meta/recipes-support/db/db_6.0.30.bb
> +++ b/meta/recipes-support/db/db_6.0.30.bb
> @@ -74,15 +74,6 @@ DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disabl
>
> EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
>
> -# Override the MUTEX setting here, the POSIX library is
> -# the default - "POSIX/pthreads/library".
> -# Don't ignore the nice SWP instruction on the ARM:
> -# These enable the ARM assembler mutex code
> -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
> -MUTEX = ""
> -MUTEX_arm = "${ARM_MUTEX}"
> -MUTEX_armeb = "${ARM_MUTEX}"
> -EXTRA_OECONF += "${MUTEX}"
it would be good to keep this for older < armv5 arches
> EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
>
> # Cancel the site stuff - it's set for db3 and destroys the
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 18:22 ` Khem Raj
@ 2016-11-04 20:29 ` Burton, Ross
[not found] ` <CAMKF1sp=ZHOP4aY7r11kvURBymq4+uknmeiSGQyP9BUpW_WXBQ@mail.gmail.com>
2016-11-04 23:14 ` Phil Blundell
1 sibling, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2016-11-04 20:29 UTC (permalink / raw)
To: Khem Raj; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 198 bytes --]
On 4 November 2016 at 18:22, Khem Raj <raj.khem@gmail.com> wrote:
> it would be good to keep this for older < armv5 arches
>
Doesn't the C library support its own atomics for those?
Ross
[-- Attachment #2: Type: text/html, Size: 638 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
[not found] ` <CAMKF1sp=ZHOP4aY7r11kvURBymq4+uknmeiSGQyP9BUpW_WXBQ@mail.gmail.com>
@ 2016-11-04 21:47 ` Khem Raj
0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2016-11-04 21:47 UTC (permalink / raw)
To: Ross Burton; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
Not sure the atomics in newer compiler and libc has ever been tested in
this version of db
On Nov 4, 2016 1:29 PM, "Burton, Ross" <ross.burton@intel.com> wrote:
On 4 November 2016 at 18:22, Khem Raj <raj.khem@gmail.com> wrote:
> it would be good to keep this for older < armv5 arches
>
Doesn't the C library support its own atomics for those?
Ross
[-- Attachment #2: Type: text/html, Size: 1246 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 18:22 ` Khem Raj
2016-11-04 20:29 ` Burton, Ross
@ 2016-11-04 23:14 ` Phil Blundell
2016-11-04 23:55 ` Khem Raj
1 sibling, 1 reply; 11+ messages in thread
From: Phil Blundell @ 2016-11-04 23:14 UTC (permalink / raw)
To: Khem Raj, Li Zhou, openembedded-core
On Fri, 2016-11-04 at 11:22 -0700, Khem Raj wrote:
>
>
> On 11/4/16 2:07 AM, Li Zhou wrote:
> >
> > The swpb in macro MUTEX_SET will cause "undefined instruction"
> > error
> > on the new arm arches which don't support this assembly instruction
> > any more. If use ldrex/strex to replace swpb, the old arm arches
> > don't
> > support them. So to avoid this issue, just disable the ARM
> > assembler
> > mutex code, and use the default pthreads mutex.
> >
> it would be good to keep this for older < armv5 arches
I guess you meant "<= ARMv5". STREX etc were introduced in ARMv6, so
ARMv5 (and ARMv5TE) don't have it. But in any case, won't the default
libpthread mutex work just fine on those older architectures? There is
no SMP on anything before ARMv6 anyway so lock contention will be
relatively low, and it seems fairly unlikely that anybody has a real-
world application which uses db so heavily that the mutex
implementation will have any noticeable performance impact.
And, given that it's now something like 15 years since support for
STREX was introduced in ARMv6, and more than 10 years since support for
SWP was deleted in ARMv7, it doesn't seem entirely unreasonable for oe-
core to pick the newer paradigm as the case to optimise for. Distros
that want to target ARMv5 or older are obviously free to do so and they
can carry the SWP patch locally if they want to. But as far as oe-core
itself is concerned, at this point it seems like it's just scar tissue.
p.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 23:14 ` Phil Blundell
@ 2016-11-04 23:55 ` Khem Raj
2016-11-05 0:01 ` Phil Blundell
0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2016-11-04 23:55 UTC (permalink / raw)
To: Phil Blundell, Li Zhou, openembedded-core
Phil
On 11/4/16 4:14 PM, Phil Blundell wrote:
> On Fri, 2016-11-04 at 11:22 -0700, Khem Raj wrote:
>>
>>
>> On 11/4/16 2:07 AM, Li Zhou wrote:
>>>
>>> The swpb in macro MUTEX_SET will cause "undefined instruction"
>>> error
>>> on the new arm arches which don't support this assembly instruction
>>> any more. If use ldrex/strex to replace swpb, the old arm arches
>>> don't
>>> support them. So to avoid this issue, just disable the ARM
>>> assembler
>>> mutex code, and use the default pthreads mutex.
>>>
>
>> it would be good to keep this for older < armv5 arches
>
> I guess you meant "<= ARMv5". STREX etc were introduced in ARMv6, so
> ARMv5 (and ARMv5TE) don't have it. But in any case, won't the default
> libpthread mutex work just fine on those older architectures? There is
> no SMP on anything before ARMv6 anyway so lock contention will be
> relatively low, and it seems fairly unlikely that anybody has a real-
> world application which uses db so heavily that the mutex
> implementation will have any noticeable performance impact.
yes I meant <= v5, it should work usually, I am just thinking its a untested
option, it may not be as bad as I think but some testing might be useful
>
> And, given that it's now something like 15 years since support for
> STREX was introduced in ARMv6, and more than 10 years since support for
> SWP was deleted in ARMv7, it doesn't seem entirely unreasonable for oe-
> core to pick the newer paradigm as the case to optimise for. Distros
> that want to target ARMv5 or older are obviously free to do so and they
> can carry the SWP patch locally if they want to. But as far as oe-core
> itself is concerned, at this point it seems like it's just scar tissue.
yeah agree here.
>
> p.
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] db: disable the ARM assembler mutex code
2016-11-04 23:55 ` Khem Raj
@ 2016-11-05 0:01 ` Phil Blundell
0 siblings, 0 replies; 11+ messages in thread
From: Phil Blundell @ 2016-11-05 0:01 UTC (permalink / raw)
To: Khem Raj, Li Zhou, openembedded-core
On Fri, 2016-11-04 at 16:55 -0700, Khem Raj wrote:
>
> yes I meant <= v5, it should work usually, I am just thinking its a
> untested
> option, it may not be as bad as I think but some testing might be
> useful
Well, I admit I haven't looked at the actual code, but from the
comments in the patch I get the impression that it just causes db to
use the same code (i.e. pthread_mutex_xx) on ARM as it already was
doing on every other architecture. I think it's safe to say that
pthread_mutex_lock() on ARM probably does work, otherwise any number of
programs would be broken, and db probably does work with
pthread_mutex_lock generically otherwise it would be broken on x86 and
so on.
You're right of course that this specific combination could do with
some testing but all in all it seems like a fairly low-risk change.
p.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-11-05 0:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 9:07 [PATCH] db: disable the ARM assembler mutex code Li Zhou
2016-11-04 9:43 ` Zhou, Li
2016-11-04 16:12 ` Leonardo Sandoval
2016-11-04 18:18 ` Mark Hatle
2016-11-04 18:22 ` Khem Raj
2016-11-04 20:29 ` Burton, Ross
[not found] ` <CAMKF1sp=ZHOP4aY7r11kvURBymq4+uknmeiSGQyP9BUpW_WXBQ@mail.gmail.com>
2016-11-04 21:47 ` Khem Raj
2016-11-04 23:14 ` Phil Blundell
2016-11-04 23:55 ` Khem Raj
2016-11-05 0:01 ` Phil Blundell
-- strict thread matches above, loose matches on Subject: below --
2016-11-04 9:12 Li Zhou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox