All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] core-image-sato-sdk: test image with 512M memory
@ 2019-07-26  9:23 kai.kang
  2019-07-26 10:11 ` Alexander Kanavin
  2019-07-26 21:40 ` richard.purdie
  0 siblings, 2 replies; 10+ messages in thread
From: kai.kang @ 2019-07-26  9:23 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

When run do_testimage for core-image-sato-sdk, it fails to pass test
case:

| RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (0.43s)

It is OOM issue and daemon rpc.statd is killed:

|  [  531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or sacrifice child

Increase the memory of qemu to 512M to avoid such OOM issue.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb b/meta/recipes-sato/images/core-image-sato-sdk.bb
index d7cc52b52b..f7963d018e 100644
--- a/meta/recipes-sato/images/core-image-sato-sdk.bb
+++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
@@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
 
 IMAGE_INSTALL += "kernel-devsrc"
 
+TEST_QEMUPARAMS = "-m 512"
-- 
2.20.0



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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-26  9:23 [PATCH] core-image-sato-sdk: test image with 512M memory kai.kang
@ 2019-07-26 10:11 ` Alexander Kanavin
  2019-07-27  1:35   ` Kang Kai
  2019-07-26 21:40 ` richard.purdie
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Kanavin @ 2019-07-26 10:11 UTC (permalink / raw)
  To: Kai Kang; +Cc: OE-core

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

I think you need to use QB_MEM here.

Also, maybe we should just bump the 256M default?

Alex

On Fri, 26 Jul 2019 at 12:24, <kai.kang@windriver.com> wrote:

> From: Kai Kang <kai.kang@windriver.com>
>
> When run do_testimage for core-image-sato-sdk, it fails to pass test
> case:
>
> | RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (0.43s)
>
> It is OOM issue and daemon rpc.statd is killed:
>
> |  [  531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or
> sacrifice child
>
> Increase the memory of qemu to 512M to avoid such OOM issue.
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
> b/meta/recipes-sato/images/core-image-sato-sdk.bb
> index d7cc52b52b..f7963d018e 100644
> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>
>  IMAGE_INSTALL += "kernel-devsrc"
>
> +TEST_QEMUPARAMS = "-m 512"
> --
> 2.20.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

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

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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-26  9:23 [PATCH] core-image-sato-sdk: test image with 512M memory kai.kang
  2019-07-26 10:11 ` Alexander Kanavin
@ 2019-07-26 21:40 ` richard.purdie
  2019-07-27  8:42   ` Kang Kai
  1 sibling, 1 reply; 10+ messages in thread
From: richard.purdie @ 2019-07-26 21:40 UTC (permalink / raw)
  To: kai.kang; +Cc: openembedded-core

On Fri, 2019-07-26 at 05:23 -0400, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
> 
> When run do_testimage for core-image-sato-sdk, it fails to pass test
> case:
> 
> > RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
> > (0.43s)
> 
> It is OOM issue and daemon rpc.statd is killed:
> 
> >  [  531.306146] Out of memory: Kill process 193 (rpc.statd) score
> > 200 or sacrifice child
> 
> Increase the memory of qemu to 512M to avoid such OOM issue.
> 
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
> b/meta/recipes-sato/images/core-image-sato-sdk.bb
> index d7cc52b52b..f7963d018e 100644
> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>  
>  IMAGE_INSTALL += "kernel-devsrc"
>  
> +TEST_QEMUPARAMS = "-m 512"

Any idea what is using so much memory in the image when this happens?

Its rather sad that we can't have NFS+systemd with 256MB memory...

Cheers,

Richard



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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-26 10:11 ` Alexander Kanavin
@ 2019-07-27  1:35   ` Kang Kai
  2019-07-27  8:35     ` Alexander Kanavin
  0 siblings, 1 reply; 10+ messages in thread
From: Kang Kai @ 2019-07-27  1:35 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

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

On 2019/7/26 下午6:11, Alexander Kanavin wrote:
> I think you need to use QB_MEM here.

Used TEST_QEMUPARAMS because I found the following line in 
testimage.bbclass:

# TEST_QEMUPARAMS can be used to pass extra parameters to qemu, e.g. "-m 
1024" for setting the amount o f ram to 1 GB.


And it seems QB_MEM is not used when boot the qemu during testimage.


>
> Also, maybe we should just bump the 256M default?

I hope so.


Regards,
Kai


>
> Alex
>
> On Fri, 26 Jul 2019 at 12:24, <kai.kang@windriver.com 
> <mailto:kai.kang@windriver.com>> wrote:
>
>     From: Kai Kang <kai.kang@windriver.com
>     <mailto:kai.kang@windriver.com>>
>
>     When run do_testimage for core-image-sato-sdk, it fails to pass test
>     case:
>
>     | RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
>     (0.43s)
>
>     It is OOM issue and daemon rpc.statd is killed:
>
>     |  [  531.306146] Out of memory: Kill process 193 (rpc.statd)
>     score 200 or sacrifice child
>
>     Increase the memory of qemu to 512M to avoid such OOM issue.
>
>     Signed-off-by: Kai Kang <kai.kang@windriver.com
>     <mailto:kai.kang@windriver.com>>
>     ---
>      meta/recipes-sato/images/core-image-sato-sdk.bb
>     <http://core-image-sato-sdk.bb> | 1 +
>      1 file changed, 1 insertion(+)
>
>     diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>     <http://core-image-sato-sdk.bb>
>     b/meta/recipes-sato/images/core-image-sato-sdk.bb
>     <http://core-image-sato-sdk.bb>
>     index d7cc52b52b..f7963d018e 100644
>     --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>     <http://core-image-sato-sdk.bb>
>     +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>     <http://core-image-sato-sdk.bb>
>     @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>
>      IMAGE_INSTALL += "kernel-devsrc"
>
>     +TEST_QEMUPARAMS = "-m 512"
>     -- 
>     2.20.0
>
>     -- 
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

-- 
Kai Kang


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

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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-27  1:35   ` Kang Kai
@ 2019-07-27  8:35     ` Alexander Kanavin
  2019-07-29  2:11       ` Kang Kai
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Kanavin @ 2019-07-27  8:35 UTC (permalink / raw)
  To: Kang Kai; +Cc: OE-core

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

I think you need to re-generate the image first (it goes to qemuboot config file). It is already used in ptest images, so it’s good to be consistent.

Alex

> On 27 Jul 2019, at 4.35, Kang Kai <Kai.Kang@windriver.com> wrote:
> 
>> On 2019/7/26 下午6:11, Alexander Kanavin wrote:
>> I think you need to use QB_MEM here.
> Used TEST_QEMUPARAMS because I found the following line in testimage.bbclass:
> 
> # TEST_QEMUPARAMS can be used to pass extra parameters to qemu, e.g. "-m 1024" for setting the amount o f ram to 1 GB.
> 
> 
> 
> And it seems QB_MEM is not used when boot the qemu during testimage.
> 
> 
> 
>> 
>> Also, maybe we should just bump the 256M default?
> I hope so. 
> 
> 
> 
> Regards,
> Kai
> 
> 
> 
>> 
>> Alex
>> 
>>> On Fri, 26 Jul 2019 at 12:24, <kai.kang@windriver.com> wrote:
>>> From: Kai Kang <kai.kang@windriver.com>
>>> 
>>> When run do_testimage for core-image-sato-sdk, it fails to pass test
>>> case:
>>> 
>>> | RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED (0.43s)
>>> 
>>> It is OOM issue and daemon rpc.statd is killed:
>>> 
>>> |  [  531.306146] Out of memory: Kill process 193 (rpc.statd) score 200 or sacrifice child
>>> 
>>> Increase the memory of qemu to 512M to avoid such OOM issue.
>>> 
>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> ---
>>>  meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>>>  1 file changed, 1 insertion(+)
>>> 
>>> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> index d7cc52b52b..f7963d018e 100644
>>> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>> 
>>>  IMAGE_INSTALL += "kernel-devsrc"
>>> 
>>> +TEST_QEMUPARAMS = "-m 512"
>>> -- 
>>> 2.20.0
>>> 
>>> -- 
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> Kai Kang

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

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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-26 21:40 ` richard.purdie
@ 2019-07-27  8:42   ` Kang Kai
  2019-08-12  8:57     ` Kang Kai
  0 siblings, 1 reply; 10+ messages in thread
From: Kang Kai @ 2019-07-27  8:42 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

On 2019/7/27 上午5:40, richard.purdie@linuxfoundation.org wrote:
> On Fri, 2019-07-26 at 05:23 -0400, kai.kang@windriver.com wrote:
>> From: Kai Kang <kai.kang@windriver.com>
>>
>> When run do_testimage for core-image-sato-sdk, it fails to pass test
>> case:
>>
>>> RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
>>> (0.43s)
>> It is OOM issue and daemon rpc.statd is killed:
>>
>>>   [  531.306146] Out of memory: Kill process 193 (rpc.statd) score
>>> 200 or sacrifice child
>> Increase the memory of qemu to 512M to avoid such OOM issue.
>>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>   meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>> b/meta/recipes-sato/images/core-image-sato-sdk.bb
>> index d7cc52b52b..f7963d018e 100644
>> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>   
>>   IMAGE_INSTALL += "kernel-devsrc"
>>   
>> +TEST_QEMUPARAMS = "-m 512"
> Any idea what is using so much memory in the image when this happens?
>
> Its rather sad that we can't have NFS+systemd with 256MB memory...

It caused by stap test case. I minimized the test cases to

TEST_SUITES = "ping date ssh systemd stap kernelmodule gcc "

which could reproduce the error.

And it PASSes testimage that remove stap test from default TEST_SUITES:

TEST_SUITES_remove = 'stap'

But I can't reproduce the OOM failure to run stap tests manually.


Regards,
Kai

>
> Cheers,
>
> Richard
>
>

-- 
Kai Kang



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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-27  8:35     ` Alexander Kanavin
@ 2019-07-29  2:11       ` Kang Kai
  0 siblings, 0 replies; 10+ messages in thread
From: Kang Kai @ 2019-07-29  2:11 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

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

On 2019/7/27 下午4:35, Alexander Kanavin wrote:
> I think you need to re-generate the image first (it goes to qemuboot 
> config file). It is already used in ptest images, so it’s good to be 
> consistent.

Thank. It works for testimage with setting QB_MEM. For the other 2 
images which has been set QB_MEM are ptest images just as you said
(core-image-sato-ptest-fast and core-image-sato-sdk-ptest). But for 
core-image-sato-sdk, it affects runqemu beyond testiamge. I just wonder
is that acceptable?

Regards,
Kai

>
> Alex
>
> On 27 Jul 2019, at 4.35, Kang Kai <Kai.Kang@windriver.com 
> <mailto:Kai.Kang@windriver.com>> wrote:
>
>> On 2019/7/26 下午6:11, Alexander Kanavin wrote:
>>> I think you need to use QB_MEM here.
>>
>> Used TEST_QEMUPARAMS because I found the following line in 
>> testimage.bbclass:
>>
>> # TEST_QEMUPARAMS can be used to pass extra parameters to qemu, e.g. 
>> "-m 1024" for setting the amount o f ram to 1 GB.
>>
>>
>> And it seems QB_MEM is not used when boot the qemu during testimage.
>>
>>
>>>
>>> Also, maybe we should just bump the 256M default?
>>
>> I hope so.
>>
>>
>> Regards,
>> Kai
>>
>>
>>>
>>> Alex
>>>
>>> On Fri, 26 Jul 2019 at 12:24, <kai.kang@windriver.com 
>>> <mailto:kai.kang@windriver.com>> wrote:
>>>
>>>     From: Kai Kang <kai.kang@windriver.com
>>>     <mailto:kai.kang@windriver.com>>
>>>
>>>     When run do_testimage for core-image-sato-sdk, it fails to pass test
>>>     case:
>>>
>>>     | RESULTS - systemd.SystemdBasicTests.test_systemd_failed:
>>>     FAILED (0.43s)
>>>
>>>     It is OOM issue and daemon rpc.statd is killed:
>>>
>>>     |  [  531.306146] Out of memory: Kill process 193 (rpc.statd)
>>>     score 200 or sacrifice child
>>>
>>>     Increase the memory of qemu to 512M to avoid such OOM issue.
>>>
>>>     Signed-off-by: Kai Kang <kai.kang@windriver.com
>>>     <mailto:kai.kang@windriver.com>>
>>>     ---
>>>      meta/recipes-sato/images/core-image-sato-sdk.bb
>>>     <http://core-image-sato-sdk.bb> | 1 +
>>>      1 file changed, 1 insertion(+)
>>>
>>>     diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>     <http://core-image-sato-sdk.bb>
>>>     b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>     <http://core-image-sato-sdk.bb>
>>>     index d7cc52b52b..f7963d018e 100644
>>>     --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>     <http://core-image-sato-sdk.bb>
>>>     +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>     <http://core-image-sato-sdk.bb>
>>>     @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>>
>>>      IMAGE_INSTALL += "kernel-devsrc"
>>>
>>>     +TEST_QEMUPARAMS = "-m 512"
>>>     -- 
>>>     2.20.0
>>>
>>>     -- 
>>>     _______________________________________________
>>>     Openembedded-core mailing list
>>>     Openembedded-core@lists.openembedded.org
>>>     <mailto:Openembedded-core@lists.openembedded.org>
>>>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>>
>>
>> -- 
>> Kai Kang


-- 
Kai Kang


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

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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-07-27  8:42   ` Kang Kai
@ 2019-08-12  8:57     ` Kang Kai
  2019-08-16  6:53       ` Kang Kai
  0 siblings, 1 reply; 10+ messages in thread
From: Kang Kai @ 2019-08-12  8:57 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

On 2019/7/27 下午4:42, Kang Kai wrote:
> On 2019/7/27 上午5:40, richard.purdie@linuxfoundation.org wrote:
>> On Fri, 2019-07-26 at 05:23 -0400, kai.kang@windriver.com wrote:
>>> From: Kai Kang <kai.kang@windriver.com>
>>>
>>> When run do_testimage for core-image-sato-sdk, it fails to pass test
>>> case:
>>>
>>>> RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
>>>> (0.43s)
>>> It is OOM issue and daemon rpc.statd is killed:
>>>
>>>>   [  531.306146] Out of memory: Kill process 193 (rpc.statd) score
>>>> 200 or sacrifice child
>>> Increase the memory of qemu to 512M to avoid such OOM issue.
>>>
>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> ---
>>>   meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> index d7cc52b52b..f7963d018e 100644
>>> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>>     IMAGE_INSTALL += "kernel-devsrc"
>>>   +TEST_QEMUPARAMS = "-m 512"
>> Any idea what is using so much memory in the image when this happens?
>>
>> Its rather sad that we can't have NFS+systemd with 256MB memory...
>
> It caused by stap test case. I minimized the test cases to
>
> TEST_SUITES = "ping date ssh systemd stap kernelmodule gcc "
>
> which could reproduce the error.
>
> And it PASSes testimage that remove stap test from default TEST_SUITES:
>
> TEST_SUITES_remove = 'stap'
>
> But I can't reproduce the OOM failure to run stap tests manually.

Hi Richard,

The root cause of test case stap fails is available memory is too low. 
Compare systemd with sysvinit, memory status are listed:

systemd:
root@qemux86:~# free -h
               total        used        free      shared buff/cache   
available
Mem:          239Mi       120Mi        23Mi       8.0Mi 94Mi       100Mi
Swap:            0B          0B          0B

sysvinit:
root@qemux86:~# free -h
               total        used        free      shared buff/cache   
available
Mem:          239Mi        45Mi       111Mi       0.0Ki 82Mi       184Mi
Swap:            0B          0B          0B


With systemd, processes of rpc.statd and rpc.mountd take about less than 
80M memories.
And I compared with Debian 10, they take similar size of memories.

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
464 rpcuser   20   0   56316  51336   2192 S   0.0  20.9   0:00.09 rpc.statd
   186 root      20   0   30136  27024   2280 S   0.0  11.0 0:00.02 
rpc.mountd


Compare to sysvinit, they take only about 2M and 448K:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
   567 rpcuser   20   0    3444   2372   1792 S   0.0   1.0 0:00.00 
rpc.statd
   677 root      20   0    3700    448      0 S   0.0   0.2 0:00.00 
rpc.mountd


I didn't figure out the differences between these 2 ways to start the 
commands:

ExecStart=/usr/sbin/rpc.statd -F $STATD_OPTS

Vs.

test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"


Regards,
Kai




>
>
> Regards,
> Kai
>
>>
>> Cheers,
>>
>> Richard
>>
>>
>

-- 
Kai Kang



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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-08-12  8:57     ` Kang Kai
@ 2019-08-16  6:53       ` Kang Kai
  2019-08-19  9:14         ` ChenQi
  0 siblings, 1 reply; 10+ messages in thread
From: Kang Kai @ 2019-08-16  6:53 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

On 2019/8/12 下午4:57, Kang Kai wrote:
> On 2019/7/27 下午4:42, Kang Kai wrote:
>> On 2019/7/27 上午5:40, richard.purdie@linuxfoundation.org wrote:
>>> On Fri, 2019-07-26 at 05:23 -0400, kai.kang@windriver.com wrote:
>>>> From: Kai Kang <kai.kang@windriver.com>
>>>>
>>>> When run do_testimage for core-image-sato-sdk, it fails to pass test
>>>> case:
>>>>
>>>>> RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
>>>>> (0.43s)
>>>> It is OOM issue and daemon rpc.statd is killed:
>>>>
>>>>>   [  531.306146] Out of memory: Kill process 193 (rpc.statd) score
>>>>> 200 or sacrifice child
>>>> Increase the memory of qemu to 512M to avoid such OOM issue.
>>>>
>>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>>> ---
>>>>   meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>> b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>> index d7cc52b52b..f7963d018e 100644
>>>> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>>>     IMAGE_INSTALL += "kernel-devsrc"
>>>>   +TEST_QEMUPARAMS = "-m 512"
>>> Any idea what is using so much memory in the image when this happens?
>>>
>>> Its rather sad that we can't have NFS+systemd with 256MB memory...
>>
>> It caused by stap test case. I minimized the test cases to
>>
>> TEST_SUITES = "ping date ssh systemd stap kernelmodule gcc "
>>
>> which could reproduce the error.
>>
>> And it PASSes testimage that remove stap test from default TEST_SUITES:
>>
>> TEST_SUITES_remove = 'stap'
>>
>> But I can't reproduce the OOM failure to run stap tests manually.
>
> Hi Richard,
>
> The root cause of test case stap fails is available memory is too low. 
> Compare systemd with sysvinit, memory status are listed:
>
> systemd:
> root@qemux86:~# free -h
>               total        used        free      shared buff/cache   
> available
> Mem:          239Mi       120Mi        23Mi       8.0Mi 94Mi 100Mi
> Swap:            0B          0B          0B
>
> sysvinit:
> root@qemux86:~# free -h
>               total        used        free      shared buff/cache   
> available
> Mem:          239Mi        45Mi       111Mi       0.0Ki 82Mi 184Mi
> Swap:            0B          0B          0B
>
>
> With systemd, processes of rpc.statd and rpc.mountd take about less 
> than 80M memories.
> And I compared with Debian 10, they take similar size of memories.
>
> PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
> 464 rpcuser   20   0   56316  51336   2192 S   0.0  20.9   0:00.09 
> rpc.statd
>   186 root      20   0   30136  27024   2280 S   0.0  11.0 0:00.02 
> rpc.mountd
>
>
> Compare to sysvinit, they take only about 2M and 448K:
>
>  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
>   567 rpcuser   20   0    3444   2372   1792 S   0.0   1.0 0:00.00 
> rpc.statd
>   677 root      20   0    3700    448      0 S   0.0   0.2 0:00.00 
> rpc.mountd
>
>
> I didn't figure out the differences between these 2 ways to start the 
> commands:
>
> ExecStart=/usr/sbin/rpc.statd -F $STATD_OPTS
>
> Vs.
>
> test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
> start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"

Hi Richard,

Any more comment here please?

Regards,
Kai



>
>
> Regards,
> Kai
>
>
>
>
>>
>>
>> Regards,
>> Kai
>>
>>>
>>> Cheers,
>>>
>>> Richard
>>>
>>>
>>
>

-- 
Kai Kang



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

* Re: [PATCH] core-image-sato-sdk: test image with 512M memory
  2019-08-16  6:53       ` Kang Kai
@ 2019-08-19  9:14         ` ChenQi
  0 siblings, 0 replies; 10+ messages in thread
From: ChenQi @ 2019-08-19  9:14 UTC (permalink / raw)
  To: openembedded-core

On 08/16/2019 02:53 PM, Kang Kai wrote:
> On 2019/8/12 下午4:57, Kang Kai wrote:
>> On 2019/7/27 下午4:42, Kang Kai wrote:
>>> On 2019/7/27 上午5:40, richard.purdie@linuxfoundation.org wrote:
>>>> On Fri, 2019-07-26 at 05:23 -0400, kai.kang@windriver.com wrote:
>>>>> From: Kai Kang <kai.kang@windriver.com>
>>>>>
>>>>> When run do_testimage for core-image-sato-sdk, it fails to pass test
>>>>> case:
>>>>>
>>>>>> RESULTS - systemd.SystemdBasicTests.test_systemd_failed: FAILED
>>>>>> (0.43s)
>>>>> It is OOM issue and daemon rpc.statd is killed:
>>>>>
>>>>>>   [  531.306146] Out of memory: Kill process 193 (rpc.statd) score
>>>>>> 200 or sacrifice child
>>>>> Increase the memory of qemu to 512M to avoid such OOM issue.
>>>>>
>>>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>>>> ---
>>>>>   meta/recipes-sato/images/core-image-sato-sdk.bb | 1 +
>>>>>   1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>>> b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>>> index d7cc52b52b..f7963d018e 100644
>>>>> --- a/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>>> +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
>>>>> @@ -9,3 +9,4 @@ IMAGE_FEATURES += "dev-pkgs tools-sdk \
>>>>>     IMAGE_INSTALL += "kernel-devsrc"
>>>>>   +TEST_QEMUPARAMS = "-m 512"
>>>> Any idea what is using so much memory in the image when this happens?
>>>>
>>>> Its rather sad that we can't have NFS+systemd with 256MB memory...
>>>
>>> It caused by stap test case. I minimized the test cases to
>>>
>>> TEST_SUITES = "ping date ssh systemd stap kernelmodule gcc "
>>>
>>> which could reproduce the error.
>>>
>>> And it PASSes testimage that remove stap test from default TEST_SUITES:
>>>
>>> TEST_SUITES_remove = 'stap'
>>>
>>> But I can't reproduce the OOM failure to run stap tests manually.
>>
>> Hi Richard,
>>
>> The root cause of test case stap fails is available memory is too 
>> low. Compare systemd with sysvinit, memory status are listed:
>>
>> systemd:
>> root@qemux86:~# free -h
>>               total        used        free      shared buff/cache   
>> available
>> Mem:          239Mi       120Mi        23Mi       8.0Mi 94Mi 100Mi
>> Swap:            0B          0B          0B
>>
>> sysvinit:
>> root@qemux86:~# free -h
>>               total        used        free      shared buff/cache   
>> available
>> Mem:          239Mi        45Mi       111Mi       0.0Ki 82Mi 184Mi
>> Swap:            0B          0B          0B
>>
>>
>> With systemd, processes of rpc.statd and rpc.mountd take about less 
>> than 80M memories.
>> And I compared with Debian 10, they take similar size of memories.
>>
>> PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
>> 464 rpcuser   20   0   56316  51336   2192 S   0.0  20.9 0:00.09 
>> rpc.statd
>>   186 root      20   0   30136  27024   2280 S   0.0  11.0 0:00.02 
>> rpc.mountd
>>
>>
>> Compare to sysvinit, they take only about 2M and 448K:
>>
>>  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM TIME+ COMMAND
>>   567 rpcuser   20   0    3444   2372   1792 S   0.0   1.0 0:00.00 
>> rpc.statd
>>   677 root      20   0    3700    448      0 S   0.0   0.2 0:00.00 
>> rpc.mountd
>>
>>
>> I didn't figure out the differences between these 2 ways to start the 
>> commands:
>>
>> ExecStart=/usr/sbin/rpc.statd -F $STATD_OPTS
>>
>> Vs.
>>
>> test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
>> start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
>
> Hi Richard,
>
> Any more comment here please?
>
> Regards,
> Kai
>
>

Hi Richard,

Do you think it's acceptable to use swap as part of this test case? For 
example, enable 100M swap before running `stap' and disable it 
afterwards? This ensure no oom caused by other software using too much 
memory.

Best Regards,
Chen Qi

>
>>
>>
>> Regards,
>> Kai
>>
>>
>>
>>
>>>
>>>
>>> Regards,
>>> Kai
>>>
>>>>
>>>> Cheers,
>>>>
>>>> Richard
>>>>
>>>>
>>>
>>
>



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

end of thread, other threads:[~2019-08-19  9:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26  9:23 [PATCH] core-image-sato-sdk: test image with 512M memory kai.kang
2019-07-26 10:11 ` Alexander Kanavin
2019-07-27  1:35   ` Kang Kai
2019-07-27  8:35     ` Alexander Kanavin
2019-07-29  2:11       ` Kang Kai
2019-07-26 21:40 ` richard.purdie
2019-07-27  8:42   ` Kang Kai
2019-08-12  8:57     ` Kang Kai
2019-08-16  6:53       ` Kang Kai
2019-08-19  9:14         ` 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.