net-vm and nw-packet-forwarder fixes#1788
Conversation
|
Might also fix https://jira.tii.ae/browse/SSRCSP-8070 Especially on suspend -> resume, it seems like net-vm needs some extra memory to properly restore wi-fi functionality sometimes..? |
Yes, I think it is related. Although #1770 helped address the additional memory requirements, however, we are still seeing memory allocation crashes during the |
9b95a6c to
4f20dc4
Compare
|
jenkins-pre-merge tests found one issue after the latest changes. |
Based on my observation, with mainline the behaviour appears as follows: the [ghaf@ghaf-2014721134:~]$ systemctl status nw-packet-forwarder.service
● nw-packet-forwarder.service - Network packet forwarder daemon
Loaded: loaded (/etc/systemd/system/nw-packet-forwarder.service; enabled; preset: ignored)
Active: activating (auto-restart) (Result: exit-code) since Fri 2026-02-27 12:13:47 UTC; 2s ago
Invocation: d036ea0455d24d699ce744904c0cb2cc
Process: 1912 ExecStart=/nix/store/cn0j80zwcvcbi9y06rrxkdpmvcx1mgxq-nw-pckt-fwd/bin/nw-pckt-fwd (code=exited, status=1/FAILURE)
Main PID: 1912 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
IO: 0B read, 0B written
Mem peak: 14.7M
CPU: 32msLogs @enesoztrk please correct me if am wrong. |
If this is a blocker, we can scrap the idea of checking for the IP via |
I saw the same thing, however it is not keeping
It does not have to be a blocker on our side, but it will need a few new checks and skips. |
@kajusnau we can move logic of |
Yep, but if QA can adjust with a few checks, then I think it makes more sense to keep it in |
…igs" This reverts commit 6a25444. Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
Some WiFi drivers require at least 1GB of memory to function properly. The default is updated to improve compatibility while still allowing overrides via vmConfig. Resolves the kernel crashes outlined below that are related to memory: awk: page allocation failure: order:4, mode:0x40820(GFP_ATOMIC|__GFP_COMP), nodemask=(null),cpuset=msFetchUrl.service,mems_allowed=0 CPU: 1 UID: 994 PID: 918 Comm: awk Not tainted 6.18.8 tiiuae#1-NixOS PREEMPT(voluntary) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x5d/0x80 warn_alloc+0x163/0x190 ? wakeup_kswapd+0xa3/0x1d0 __alloc_frozen_pages_noprof+0xc47/0x10f0 ? get_page_from_freelist+0x1a06/0x1c20 alloc_pages_mpol+0x86/0x170 ? virtio_fs_enqueue_req+0x214/0x600 [virtiofs] ___kmalloc_large_node+0x99/0xb0 __kmalloc_large_node_noprof+0x1d/0xb0 __kmalloc_noprof+0x4dd/0x700 ? __alloc_frozen_pages_noprof+0x478/0x10f0 ? virtio_fs_enqueue_req+0x214/0x600 [virtiofs] virtio_fs_enqueue_req+0x214/0x600 [virtiofs] virtio_fs_send_req+0x51/0x110 [virtiofs] __fuse_simple_request+0x118/0x310 [fuse] fuse_readdir_uncached+0x16f/0x8c0 [fuse] ? virtqueue_add_sgs+0xb5/0xd0 [virtio_ring] ? vp_notify+0x16/0x20 [virtio_pci] ? virtqueue_notify+0x1f/0x40 [virtio_ring] ? virtio_fs_enqueue_req+0x50c/0x600 [virtiofs] iterate_dir+0xaa/0x270 ovl_iterate+0x168/0x3a0 [overlay] ? __pfx_ovl_iterate+0x10/0x10 [overlay] wrap_directory_iterator+0x4b/0x70 iterate_dir+0xaa/0x270 __x64_sys_getdents64+0x7b/0x110 ? __pfx_filldir64+0x10/0x10 do_syscall_64+0xb6/0x7e0 ? exc_page_fault+0x6a/0x150 Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
Add a pre-start check to wait until the external network interface has a global IPv4 address before launching nw-pckt-fwd. This prevents the packet forwarder from starting prematurely when the interface (e.g., Wi-Fi) is not yet connected or configured, improving startup reliability. Fixes: nw-packet-forwarder[4447]: Failed to assign interfaces: No IPv4 address found for interface wlp0s5f0 systemd[1]: nw-packet-forwarder.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: nw-packet-forwarder.service: Failed with result 'exit-code'. Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
enesoztrk
left a comment
There was a problem hiding this comment.
There is a DCO error in the pipeline. It is good to go if you fix it
|
WiFi OOM-related crashes are still getting reported in https://jira.tii.ae/browse/SSRCSP-8070 despite zram being enabled. @brianmcgillion can you please review this PR? |
Description of Changes
net-vm: Increase the default memory allocation from 512MB to 1024MB
Some WiFi drivers require at least 1GB of memory to function properly. The default is updated to improve
compatibility while still allowing overrides via vmConfig.
Resolves the kernel crashes outlined below that are related to memory during
net-vmboot:nw-packet-forwarder: wait for external interface IPv4 before startup
Add a pre-start check to wait until the external network interface has a global IPv4 address before launching
nw-pckt-fwd.
This prevents the packet forwarder from starting prematurely when the interface (e.g., Wi-Fi) is not yet connected or
configured, improving startup reliability.
Fixes the service failure when no WiFi is connected:
Type of Change
Related Issues / Tickets
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify: