All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] systemd: fix strange behaviour on qemumips64
@ 2017-10-23 10:44 Chen Qi
  2017-10-23 10:44 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Qi @ 2017-10-23 10:44 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 65d23bd7986615fdfb0f1717b615534a2a14ab80:

  README.qemu: qemuppc64 is not supported (2017-10-16 23:54:31 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/bug12266
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/bug12266

Chen Qi (1):
  systemd: fix strange behaviour on qemumips64

 meta/recipes-core/systemd/systemd_234.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] systemd: fix strange behaviour on qemumips64
  2017-10-23 10:44 [PATCH 0/1] systemd: fix strange behaviour on qemumips64 Chen Qi
@ 2017-10-23 10:44 ` Chen Qi
  2017-10-23 11:41   ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Qi @ 2017-10-23 10:44 UTC (permalink / raw)
  To: openembedded-core

On qemumips64, `systemctl status <unit>' would have the output of
`systemctl show <unit>'. This is incorrect.

However, it's not the code logic that cause such problem. It's the
compilation flags.

Looking back the history, we had problem with systemd on qemumips64
which is also related to compilation flags. We solved that by using
tweaking FULL_OPTIMIZATION for mips64 to have "-fno-tree-switch-conversion
-fno-tree-tail-merge".

Now systemd has been upgraded to 234, and we don't have the above problem
any more. However, a new problem appears, and that is the output of `systemctl
status <unit>'.

Hence, we set '-O0' flag for mips64 when building systemd to avoid potential
strange problems.

[YOCTO #12266]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/systemd/systemd_234.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_234.bb b/meta/recipes-core/systemd/systemd_234.bb
index 36fd3f8..b294604 100644
--- a/meta/recipes-core/systemd/systemd_234.bb
+++ b/meta/recipes-core/systemd/systemd_234.bb
@@ -158,8 +158,8 @@ CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', ''
 # disable problematic GCC 5.2 optimizations [YOCTO #8291]
 FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
 
-# Avoid login failure on qemumips64 when pam is enabled
-FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion -fno-tree-tail-merge"
+# Disable optimization on qemumips64 to avoid strange behaviour
+FULL_OPTIMIZATION_append_mips64 = " -O0"
 
 COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
 COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] systemd: fix strange behaviour on qemumips64
  2017-10-23 10:44 ` [PATCH 1/1] " Chen Qi
@ 2017-10-23 11:41   ` Burton, Ross
  2017-10-23 17:14     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2017-10-23 11:41 UTC (permalink / raw)
  To: Chen Qi; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

Can we trust the mips64 compiler at all?  Is there a specific optimisation
that systemd is turning on that is causing this breakage?  Have you
reported this to the gcc bugzilla?

Ross

On 23 October 2017 at 11:44, Chen Qi <Qi.Chen@windriver.com> wrote:

> On qemumips64, `systemctl status <unit>' would have the output of
> `systemctl show <unit>'. This is incorrect.
>
> However, it's not the code logic that cause such problem. It's the
> compilation flags.
>
> Looking back the history, we had problem with systemd on qemumips64
> which is also related to compilation flags. We solved that by using
> tweaking FULL_OPTIMIZATION for mips64 to have "-fno-tree-switch-conversion
> -fno-tree-tail-merge".
>
> Now systemd has been upgraded to 234, and we don't have the above problem
> any more. However, a new problem appears, and that is the output of
> `systemctl
> status <unit>'.
>
> Hence, we set '-O0' flag for mips64 when building systemd to avoid
> potential
> strange problems.
>
> [YOCTO #12266]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-core/systemd/systemd_234.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/systemd/systemd_234.bb
> b/meta/recipes-core/systemd/systemd_234.bb
> index 36fd3f8..b294604 100644
> --- a/meta/recipes-core/systemd/systemd_234.bb
> +++ b/meta/recipes-core/systemd/systemd_234.bb
> @@ -158,8 +158,8 @@ CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG',
> 'valgrind', ' -DVALGRIND=1', ''
>  # disable problematic GCC 5.2 optimizations [YOCTO #8291]
>  FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
>
> -# Avoid login failure on qemumips64 when pam is enabled
> -FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion
> -fno-tree-tail-merge"
> +# Disable optimization on qemumips64 to avoid strange behaviour
> +FULL_OPTIMIZATION_append_mips64 = " -O0"
>
>  COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
>  COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 3520 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] systemd: fix strange behaviour on qemumips64
  2017-10-23 11:41   ` Burton, Ross
@ 2017-10-23 17:14     ` Khem Raj
  2017-10-26  6:11       ` ChenQi
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2017-10-23 17:14 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Mon, Oct 23, 2017 at 4:41 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Can we trust the mips64 compiler at all?  Is there a specific optimisation
> that systemd is turning on that is causing this breakage?  Have you reported
> this to the gcc bugzilla?
>
> Ross
>
> On 23 October 2017 at 11:44, Chen Qi <Qi.Chen@windriver.com> wrote:
>>
>> On qemumips64, `systemctl status <unit>' would have the output of
>> `systemctl show <unit>'. This is incorrect.
>>
>> However, it's not the code logic that cause such problem. It's the
>> compilation flags.
>>
>> Looking back the history, we had problem with systemd on qemumips64
>> which is also related to compilation flags. We solved that by using
>> tweaking FULL_OPTIMIZATION for mips64 to have "-fno-tree-switch-conversion
>> -fno-tree-tail-merge".
>>
>> Now systemd has been upgraded to 234, and we don't have the above problem
>> any more. However, a new problem appears, and that is the output of
>> `systemctl
>> status <unit>'.
>>
>> Hence, we set '-O0' flag for mips64 when building systemd to avoid
>> potential
>> strange problems.
>>
>> [YOCTO #12266]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>  meta/recipes-core/systemd/systemd_234.bb | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_234.bb
>> b/meta/recipes-core/systemd/systemd_234.bb
>> index 36fd3f8..b294604 100644
>> --- a/meta/recipes-core/systemd/systemd_234.bb
>> +++ b/meta/recipes-core/systemd/systemd_234.bb
>> @@ -158,8 +158,8 @@ CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG',
>> 'valgrind', ' -DVALGRIND=1', ''
>>  # disable problematic GCC 5.2 optimizations [YOCTO #8291]
>>  FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns
>> -fno-schedule-insns2"
>>
>> -# Avoid login failure on qemumips64 when pam is enabled
>> -FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion
>> -fno-tree-tail-merge"
>> +# Disable optimization on qemumips64 to avoid strange behaviour
>> +FULL_OPTIMIZATION_append_mips64 = " -O0"
>>

I think we need a narrowed-down case may be a opt pass which is causing
the problem. reduce the opt level to -O0 will pessimise the code and impact
the performance.

Firstly, try to use normal -O2 and remove disabling tree-switch-conversion and
tail call disable.

>>  COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
>>  COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
>> --
>> 1.9.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] systemd: fix strange behaviour on qemumips64
  2017-10-23 17:14     ` Khem Raj
@ 2017-10-26  6:11       ` ChenQi
  0 siblings, 0 replies; 5+ messages in thread
From: ChenQi @ 2017-10-26  6:11 UTC (permalink / raw)
  To: Khem Raj, Burton, Ross; +Cc: OE-core

On 10/24/2017 01:14 AM, Khem Raj wrote:
> On Mon, Oct 23, 2017 at 4:41 AM, Burton, Ross <ross.burton@intel.com> wrote:
>> Can we trust the mips64 compiler at all?  Is there a specific optimisation
>> that systemd is turning on that is causing this breakage?  Have you reported
>> this to the gcc bugzilla?
>>
>> Ross
>>
>> On 23 October 2017 at 11:44, Chen Qi <Qi.Chen@windriver.com> wrote:
>>> On qemumips64, `systemctl status <unit>' would have the output of
>>> `systemctl show <unit>'. This is incorrect.
>>>
>>> However, it's not the code logic that cause such problem. It's the
>>> compilation flags.
>>>
>>> Looking back the history, we had problem with systemd on qemumips64
>>> which is also related to compilation flags. We solved that by using
>>> tweaking FULL_OPTIMIZATION for mips64 to have "-fno-tree-switch-conversion
>>> -fno-tree-tail-merge".
>>>
>>> Now systemd has been upgraded to 234, and we don't have the above problem
>>> any more. However, a new problem appears, and that is the output of
>>> `systemctl
>>> status <unit>'.
>>>
>>> Hence, we set '-O0' flag for mips64 when building systemd to avoid
>>> potential
>>> strange problems.
>>>
>>> [YOCTO #12266]
>>>
>>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>>> ---
>>>   meta/recipes-core/systemd/systemd_234.bb | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/recipes-core/systemd/systemd_234.bb
>>> b/meta/recipes-core/systemd/systemd_234.bb
>>> index 36fd3f8..b294604 100644
>>> --- a/meta/recipes-core/systemd/systemd_234.bb
>>> +++ b/meta/recipes-core/systemd/systemd_234.bb
>>> @@ -158,8 +158,8 @@ CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG',
>>> 'valgrind', ' -DVALGRIND=1', ''
>>>   # disable problematic GCC 5.2 optimizations [YOCTO #8291]
>>>   FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns
>>> -fno-schedule-insns2"
>>>
>>> -# Avoid login failure on qemumips64 when pam is enabled
>>> -FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion
>>> -fno-tree-tail-merge"
>>> +# Disable optimization on qemumips64 to avoid strange behaviour
>>> +FULL_OPTIMIZATION_append_mips64 = " -O0"
>>>
> I think we need a narrowed-down case may be a opt pass which is causing
> the problem. reduce the opt level to -O0 will pessimise the code and impact
> the performance.
>
> Firstly, try to use normal -O2 and remove disabling tree-switch-conversion and
> tail call disable.

Hi Ross & Khem,

I did some more tests today. Below is the result.

I wanted to narrow down the option, but things went strange.

With '-O0', we don't have this problem.
With '-O1', the problem could be reproduced.
The strangest thing is that when using '-O0' and other optimizations 
that O1 enables compared to O0, the problem cannot be reproduced.
In theory, as '-O1' = '-O0' + <other optimizations>, the problem should 
be reproduced when using '-O0' + <other optimizations'. But in fact, 
it's not reproduced.
I'm referring to https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html.

Regarding gcc flags turned on by systemd, I can confirm that when using 
'-O1' and '-O0', the options are the same.

Best Regards,
Chen Qi

>>>   COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
>>>   COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
>>> --
>>> 1.9.1
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-26  6:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-23 10:44 [PATCH 0/1] systemd: fix strange behaviour on qemumips64 Chen Qi
2017-10-23 10:44 ` [PATCH 1/1] " Chen Qi
2017-10-23 11:41   ` Burton, Ross
2017-10-23 17:14     ` Khem Raj
2017-10-26  6:11       ` ChenQi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.