Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Phil Blundell
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.

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Khem Raj
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.
> 
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Phil Blundell
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.

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Khem Raj
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"  wrote:


On 4 November 2016 at 18:22, Khem Raj  wrote:

> it would be good to keep this for older < armv5 arches
>

Doesn't the C library support its own atomics for those?

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Burton, Ross
On 4 November 2016 at 18:22, Khem Raj  wrote:

> it would be good to keep this for older < armv5 arches
>

Doesn't the C library support its own atomics for those?

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Khem Raj


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 
> ---
>  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
> 



signature.asc
Description: OpenPGP digital signature
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Mark Hatle
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 
>> ---
>>   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
> 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Leonardo Sandoval
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 
---
  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


--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] db: disable the ARM assembler mutex code

2016-11-04 Thread Zhou, Li

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 
---
  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

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core