Linux

“頁面分配失敗”核心消息的解釋

  • June 26, 2018

我的 RHEL7 系統出現“頁面分配失敗”錯誤。這裡是:

核心:[85531.010995] sh:頁面分配失敗:順序:4,模式:0x2040d0
核心:[85531.011000] CPU:1 PID:20846 通訊:sh 未污染 3.10.0-693.el7.AV1.x86_64 #1
核心:[85531.011002] 硬體名稱:VMware, Inc. VMware Virtual Platform/440BX 桌面參考平台,BIOS 6.00 09/21/2015
核心:[85531.011003] 00000000002040d0 00000000d00413f4 ffff8800070ffa18 ffffffff816a3e1d
核心:[85531.011006] ffff8800070ffaa8 ffffffff81188d00 0000000000000000 ffff88023ffd8000
核心:[85531.011008] 0000000000000004 00000000002040d0 ffff8800070ffaa8 00000000d00413f4
核心:[85531.011010] 呼叫跟踪:
核心:[85531.011018] [] dump_stack+0x19/0x1b
核心:[85531.011023] [] warn_alloc_failed+0x110/0x180
核心:[85531.011026] [] __alloc_pages_slowpath+0x6b6/0x724
核心:[85531.011028] [] __alloc_pages_nodemask+0x405/0x420
核心:[85531.011031] [] alloc_pages_current+0x98/0x110
核心:[85531.011035] [] new_slab+0x2fc/0x310
核心:[85531.011037] [] ___slab_alloc+0x3ac/0x4f0
核心:[85531.011042] []?複製程序+0x18e/0x19a0
核心:[85531.011044] []?複製程序+0x18e/0x19a0
核心:[85531.011046] [] __slab_alloc+0x40/0x5c
核心:[85531.011049] [] kmem_cache_alloc_node+0x8b/0x200
核心:[85531.011051] [] copy_process+0x18e/0x19a0
核心:[85531.011053] [] do_fork+0x91/0x320
核心:[85531.011056] [] SyS_clone+0x16/0x20
核心:[85531.011059] [] stub_clone+0x69/0x90
核心:[85531.011061] []?system_call_fastpath+0x16/0x1b
核心:[85531.011062] 記憶體資訊:
核心:[85531.011066] active_anon:1145227 inactive_anon:278512 isolated_anon:0
核心:[85531.011066] active_file:181319 inactive_file:185784 isolated_file:0
核心:[85531.011066] unevictable:2695 臟:4333 寫回:0 不穩定:0
核心:[85531.011066]slab_reclaimable:45889slab_unreclaimable:54798
核心:[85531.011066] 映射:79471 shmem:52418 頁表:11994 反彈:0
核心:[85531.011066] free:33850 free_pcp:0 free_cma:0
核心:[85531.011069] Node 0 DMA free:15868kB min:132kB low:164kB high:196kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB託管:15908kB mlocked:0kB 臟:0kB 回寫:0kB 映射:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:8kB kernel_stack:0kB 頁表:0kB 不穩定:0kB 反彈:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned: 0 all_unreclaimable?是的
核心:[85531.011073] lowmem_reserve[]:0 2809 7800 7800
kernel: [85531.011076] Node 0 DMA32 free:53892kB min:24292kB low:30364kB high:36436kB active_anon:1622080kB inactive_anon:516652kB active_file:203244kB inactive_file:212104kB unevictable:2312kB isolated(anon):0kB isolated(file):0kB present:3129280kB managed:2878656kB mlocked:2312kB dirty:6236kB writeback:0kB mapped:115972kB shmem:79808kB slab_reclaimable:77740kB slab_unreclaimable:90500kB kernel_stack:13680kB pagetables:17624kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned: 0 all_unreclaimable?不
核心:[85531.011080] lowmem_reserve[]:0 0 4990 4990
核心:[85531.011082] Node 0 Normal free:65640kB min:43152kB low:53940kB high:64728kB active_anon:2958828kB inactive_anon:597396kB active_file:522032kB inactive_file:531032kB unevictable:8468kB 已隔離(kB 已隔離:531032kB managed:5110372kB mlocked:8464kB dirty:11096kB writeback:0kB mapped:201912kB shmem:129864kB slab_reclaimable:105816kB slab_unreclaimable:128684kB kernel_stack:19936kB pagetables:30352kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned: 0 all_unreclaimable?不
核心:[85531.011085] lowmem_reserve[]:0 0 0 0
核心:[85531.011087] 節點 0 DMA:1*4kB (U) 1*8kB (U) 1*16kB (U) 1*32kB (U) 1*64kB (U) 1*128kB (U) 1*256kB (U ) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15868kB
核心:[85531.011095] 節點 0 DMA32:2946*4kB (UEM) 1995*8kB (UEM) 1241*16kB (UEM) 186*32kB (UEM) 9*64kB (U) 0*128kB 0*256kB 0*512kB 0* 1024kB 0*2048kB 0*4096kB = 54128kB
核心:[85531.011102] 節點 0 正常:16005*4kB (UEM) 248*8kB (UEM) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 66004k
核心:[85531.011108] 節點 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
核心:[85531.011109] 428930 總頁面記憶體頁面
核心:[85531.011110] 交換記憶體中有 8261 個頁面
核心:[85531.011111]交換記憶體統計:添加51264,刪除43003,查找2892763/2894481
核心:[85531.011112] 自由交換 = 5078128kB
核心:[85531.011113] 總交換 = 5242876kB
核心:[85531.011114] 2097038 頁 RAM
核心:[85531.011114] 0 頁 HighMem/MovableOnly
核心:[85531.011115] 95804 頁保留
核心:[85531.011116] SLUB:無法在節點 -1 上分配記憶體(gfp=0xd0)
核心:[85531.011118] 記憶體:task_struct,對像大小:45024,緩衝區大小:45024,預設順序:4,最小順序:4
核心:[85531.011119] 節點 0:slabs:2114,objs:2114,免費:0

問題是關於其消息的最新部分:

核心:[85531.011116] SLUB:無法在節點 -1 上分配記憶體(gfp=0xd0)
核心:[85531.011118] 記憶體:task_struct,對像大小:45024,緩衝區大小:45024,預設順序:4,最小順序:4
核心:[85531.011119] 節點 0:slabs:2114,objs:2114,免費:0

-1當 Zone from 分配失敗時,為什麼節點索引有Node 0?這有點混亂。。

核心:[85531.011087] 節點 0 DMA:1*4kB (U) 1*8kB (U) 1*16kB (U) 1*32kB (U) 1*64kB (U) 1*128kB (U) 1*256kB (U ) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15868kB
核心:[85531.011095] 節點 0 DMA32:2946*4kB (UEM) 1995*8kB (UEM) 1241*16kB (UEM) 186*32kB (UEM) 9*64kB (U) 0*128kB 0*256kB 0*512kB 0* 1024kB 0*2048kB 0*4096kB = 54128kB
核心:[85531.011102] 節點 0 正常:16005*4kB (UEM) 248*8kB (UEM) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 66004k

節點 -1 表示“任何節點”。您可能只有一個節點。Red Hat 的核心經過配置,可以通過模擬只有一個節點的 NUMA 機器在單節點機器上執行。檢查您的引導日誌 (/var/log/dmesg)。我有:

[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000023bffffff]

引用自:https://unix.stackexchange.com/questions/446022