cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
771 Views
Registered: ‎11-28-2018

Reboot of Xen Dom0 causing OOM (Petalinux 2018.3)

Jump to solution

I have created a very simple Dom0 following the instructions here: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/76677121/Building+Xen+Hypervisor+with+Petalinux+2018.3. The ZCU102 boots Xen and the Dom0 as expected. However when I try to reboot i.e. type reboot at the console I always seem to get a OOM killer error, an example of which is shown below. Before rebooting I do not create a DomU.

 

Sending all processes the TERM signal...
[ 163.570761] killall5 invoked oom-killer: gfp_mask=0x16080c0(GFP_KERNEL|__GFP_ZERO|__GFP_NOTRACK), nodemask=(null), order=0, oom_score_adj=0
[ 163.577807] CPU: 0 PID: 2607 Comm: killall5 Not tainted 4.14.0-xilinx-v2018.3 #1
[ 163.585233] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[ 163.590251] Call trace:
[ 163.592768] [<ffffff8008088c58>] dump_backtrace+0x0/0x368
[ 163.598212] [<ffffff8008088fd4>] show_stack+0x14/0x20
[ 163.603318] [<ffffff8008a3f7f8>] dump_stack+0x9c/0xbc
[ 163.608421] [<ffffff800813c468>] dump_header.isra.6+0x7c/0x194
[ 163.614302] [<ffffff800813bad8>] oom_kill_process+0x280/0x500
[ 163.620098] [<ffffff800813c088>] out_of_memory+0xe0/0x3e8
[ 163.625549] [<ffffff80081410f8>] __alloc_pages_nodemask+0xa20/0xad8
[ 163.631865] [<ffffff8008163d2c>] __pte_alloc+0x2c/0x130
[ 163.637141] [<ffffff8008167b48>] __handle_mm_fault+0x678/0xb90
[ 163.643023] [<ffffff80081680b8>] handle_mm_fault+0x58/0xa0
[ 163.648560] [<ffffff80081614d0>] __get_user_pages+0x190/0x310
[ 163.654356] [<ffffff8008161c70>] populate_vma_page_range+0x60/0x68
[ 163.660584] [<ffffff8008161d28>] __mm_populate+0xb0/0x178
[ 163.666034] [<ffffff800816ddb4>] SyS_brk+0x114/0x190
[ 163.671051] Exception stack(0xffffff800ca5bec0 to 0xffffff800ca5c000)
[ 163.677540] bec0: 000000000b6fa000 0000007fa2d60cd0 000000000b6fa000 0000000000000004
[ 163.685412] bee0: 0000000000000003 0000000000000002 fffffffffffff000 fffffffffffff000
[ 163.693284] bf00: 00000000000000d6 0000007fa2d5e000 0000007fa2d5eab0 0000000000000000
[ 163.701157] bf20: 0000000000000001 000000000000270f 0000000000000001 0000000000000000
[ 163.709029] bf40: 0000000000000007 0000000000000118 0000000000000002 000000000b6d9000
[ 163.716901] bf60: 0000007fa2d60cd0 0000000000021000 0000000000000250 0000000000000000
[ 163.724774] bf80: 0000007fa2d5eab0 0000007fa2d5e000 0000000000000fff 0000000000000000
[ 163.732646] bfa0: 0000000000000270 0000007fe7232190 0000007fa2cd7e98 0000007fe7232190
[ 163.740518] bfc0: 0000007fa2cd7dc4 0000000020000000 000000000b6fa000 00000000000000d6
[ 163.748390] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 163.756263] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[ 163.761644] Mem-Info:
[ 163.763975] active_anon:8528 inactive_anon:26923 isolated_anon:0
[ 163.763975] active_file:7 inactive_file:0 isolated_file:0
[ 163.763975] unevictable:393 dirty:0 writeback:0 unstable:0
[ 163.763975] slab_reclaimable:1010 slab_unreclaimable:3915
[ 163.763975] mapped:985 shmem:35017 pagetables:59 bounce:0
[ 163.763975] free:70959 free_pcp:205 free_cma:65373
[ 163.797193] Node 0 active_anon:34112kB inactive_anon:107692kB active_file:28kB inactive_file:0kB unevictable:1572kB isolated(anon):0kB isolated(file):0kB mapped:3940kB dirty:0kB writeback:0kB shmem:140068kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 163.824445] DMA free:283836kB min:22528kB low:28160kB high:33792kB active_anon:34112kB inactive_anon:107692kB active_file:28kB inactive_file:0kB unevictable:1572kB writepending:0kB present:786432kB managed:456560kB mlocked:1576kB kernel_stack:960kB pagetables:236kB bounce:0kB free_pcp:820kB local_pcp:820kB free_cma:261492kB
[ 163.853072] lowmem_reserve[]: 0 0 0
[ 163.856617] DMA: 205*4kB (UMEC) 133*8kB (UMEC) 80*16kB (UME) 27*32kB (UMEC) 12*64kB (UME) 6*128kB (ME) 5*256kB (MEC) 3*512kB (ME) 3*1024kB (MEC) 1*2048kB (C) 66*4096kB (MC) = 283836kB
[ 163.872971] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[ 163.881445] 35025 total pagecache pages
[ 163.885338] 0 pages in swap cache
[ 163.888712] Swap cache stats: add 0, delete 0, find 0/0
[ 163.893988] Free swap = 0kB
[ 163.896929] Total swap = 0kB
[ 163.899871] 196608 pages RAM
[ 163.902812] 0 pages HighMem/MovableOnly
[ 163.906706] 82468 pages reserved
[ 163.909986] 65536 pages cma reserved
[ 163.913626] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
[ 163.922196] [ 1903] 0 1903 894 635 6 3 0 -1000 udevd
[ 163.930845] [ 2358] 0 2358 806 388 6 3 0 0 inetd
[ 163.939495] [ 2458] 0 2458 715 330 5 3 0 0 xenstored
[ 163.948492] [ 2504] 0 2504 936 490 6 3 0 0 login
[ 163.957143] [ 2505] 0 2505 773 125 5 3 0 0 getty
[ 163.965794] [ 2507] 0 2507 847 694 5 3 0 0 sh
[ 163.974185] [ 2524] 0 2524 782 559 5 3 0 0 rc
[ 163.982579] [ 2563] 0 2563 840 509 6 3 0 0 udevd
[ 163.991227] [ 2564] 0 2564 894 552 6 3 0 0 udevd
[ 163.999878] [ 2606] 0 2606 753 548 5 3 0 0 S20sendsigs
[ 164.009048] [ 2607] 0 2607 445 93 3 3 0 0 killall5
[ 164.017957] Out of memory: Kill process 2507 (sh) score 5 or sacrifice child
[ 164.025054] Killed process 2507 (sh) total-vm:3388kB, anon-rss:392kB, file-rss:8kB, shmem-rss:2376kB
Sending all processes the KILL signal...
[ 169.054949] killall5 invoked oom-killer: gfp_mask=0x14000c0(GFP_KERNEL), nodemask=(null), order=0, oom_score_adj=0
[ 169.059847] CPU: 0 PID: 2609 Comm: killall5 Not tainted 4.14.0-xilinx-v2018.3 #1
[ 169.067260] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[ 169.072277] Call trace:
[ 169.074795] [<ffffff8008088c58>] dump_backtrace+0x0/0x368
[ 169.080239] [<ffffff8008088fd4>] show_stack+0x14/0x20
[ 169.085345] [<ffffff8008a3f7f8>] dump_stack+0x9c/0xbc
[ 169.090448] [<ffffff800813c468>] dump_header.isra.6+0x7c/0x194
[ 169.096329] [<ffffff800813bad8>] oom_kill_process+0x280/0x500
[ 169.102125] [<ffffff800813c088>] out_of_memory+0xe0/0x3e8
[ 169.107576] [<ffffff80081410f8>] __alloc_pages_nodemask+0xa20/0xad8
[ 169.113890] [<ffffff80081411c4>] __get_free_pages+0x14/0x58
[ 169.119514] [<ffffff8008203b2c>] proc_pid_cmdline_read+0x8c/0x470
[ 169.125657] [<ffffff800819aa58>] __vfs_read+0x18/0x108
[ 169.130846] [<ffffff800819abd0>] vfs_read+0x88/0x168
[ 169.135864] [<ffffff800819b258>] SyS_read+0x48/0xb0
[ 169.140793] Exception stack(0xffffff800ca23ec0 to 0xffffff800ca24000)
[ 169.147283] 3ec0: 0000000000000004 0000000034490530 0000000000000400 0000007fbbc25000
[ 169.155155] 3ee0: 0000000034490930 0000000000000000 0000000000001108 0000000000000000
[ 169.163027] 3f00: 000000000000003f 0000000000000000 0000007ff1e07fb0 0000000000000020
[ 169.170899] 3f20: 0000000000000000 0000000000000000 0000007ff1e09352 0000007fbbb45a74
[ 169.178772] 3f40: 0000007fbbc20008 0000007fbbb4ac38 0000000000000002 0000000000000004
[ 169.186644] 3f60: 0000000000000888 0000007fbbc1d908 0000007fbbc1d5c0 0000000000000bd0
[ 169.194516] 3f80: 0000007fbbc1c000 0000000034488ddb 0000000034490300 00000000000009dc
[ 169.202389] 3fa0: 0000007ff1e0934e 0000007ff1e08160 0000007fbbb4313c 0000007ff1e08160
[ 169.210261] 3fc0: 0000007fbbb94700 0000000080000000 0000000000000004 000000000000003f
[ 169.218133] 3fe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 169.226006] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[ 169.231374] Mem-Info:
[ 169.233710] active_anon:7943 inactive_anon:26871 isolated_anon:0
[ 169.233710] active_file:0 inactive_file:7 isolated_file:0
[ 169.233710] unevictable:427 dirty:0 writeback:0 unstable:0
[ 169.233710] slab_reclaimable:998 slab_unreclaimable:3857
[ 169.233710] mapped:573 shmem:35015 pagetables:19 bounce:0
[ 169.233710] free:71008 free_pcp:113 free_cma:65380
[ 169.266848] Node 0 active_anon:31772kB inactive_anon:107484kB active_file:0kB inactive_file:28kB unevictable:1708kB isolated(anon):0kB isolated(file):0kB mapped:2292kB dirty:0kB writeback:0kB shmem:140060kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? yes
[ 169.294185] DMA free:284032kB min:22528kB low:28160kB high:33792kB active_anon:31772kB inactive_anon:107484kB active_file:0kB inactive_file:28kB unevictable:1708kB writepending:0kB present:786432kB managed:453332kB mlocked:1708kB kernel_stack:832kB pagetables:76kB bounce:0kB free_pcp:452kB local_pcp:452kB free_cma:261520kB
[ 169.322725] lowmem_reserve[]: 0 0 0
[ 169.326267] DMA: 254*4kB (UMEC) 161*8kB (MEC) 96*16kB (MEC) 52*32kB (MEC) 22*64kB (UME) 7*128kB (UME) 5*256kB (MEC) 5*512kB (UME) 4*1024kB (UMEC) 1*2048kB (C) 65*4096kB (MC) = 284032kB
[ 169.342711] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[ 169.351187] 35022 total pagecache pages
[ 169.355082] 0 pages in swap cache
[ 169.358455] Swap cache stats: add 0, delete 0, find 0/0
[ 169.363730] Free swap = 0kB
[ 169.366671] Total swap = 0kB
[ 169.369608] 196608 pages RAM
[ 169.372554] 0 pages HighMem/MovableOnly
[ 169.376447] 83275 pages reserved
[ 169.379734] 65536 pages cma reserved
[ 169.383367] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
[ 169.391937] [ 2524] 0 2524 782 559 5 3 0 0 rc
[ 169.400327] [ 2606] 0 2606 753 548 5 3 0 0 S20sendsigs
[ 169.409496] [ 2609] 0 2609 445 409 6 3 0 0 killall5
[ 169.418405] Out of memory: Kill process 2524 (rc) score 4 or sacrifice child
[ 169.425505] Killed process 2606 (S20sendsigs) total-vm:3012kB, anon-rss:196kB, file-rss:8kB, shmem-rss:1988kB
/etc/init.d/rc: line 45: 2606 Killed "$@"
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
Rebooting... [ 171.551372] reboot: Restarting system
(XEN) Hardware Dom0 shutdown: rebooting machine

Is this expected???

Thanks in advance.

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
614 Views
Registered: ‎11-28-2018

Worked a treat, thanks very much for that.

View solution in original post

0 Kudos
3 Replies
Highlighted
Visitor
Visitor
665 Views
Registered: ‎05-30-2018

Apply this patch from upstream linux-4.14.y https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=301ae5910648

Use git to generate a patch file from that commit, and make sure it's referenced from linux-xlnx_%.bbappend in the SRC_URI variable.

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
$ cd linux
$ git format-patch a333f3f2a255..301ae5910648

Place the resulting patch file in project-spec/meta-user/recipes-kernel/linux/linux-xlnx/

Edit project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend:

SRC_URI += "file://bsp.cfg \
file://0001-xen-balloon-fix-balloon-initialization-for-PVH-Dom0.patch \
"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

 

Another way to check for this bug is to do “/etc/init.d/xendomains stop; /etc/init.d/xendomains start” a few times and you’ll either run into OOM errors or successfully be able to start & stop the daemon multiple times.

This bug is not present in PetaLinux 2019.1, since 2019.1 uses linux 4.19, which already includes the patch.

0 Kudos
Highlighted
Visitor
Visitor
660 Views
Registered: ‎11-28-2018

Many thanks I will give that a whirl and report back.

0 Kudos
Highlighted
Visitor
Visitor
615 Views
Registered: ‎11-28-2018

Worked a treat, thanks very much for that.

View solution in original post

0 Kudos