Hello,
I would like to report a serious issue involving the native ZimaOS Photos AI worker.
SYSTEM INFORMATION
- ZimaOS version: 1.8.0
- Kernel: 6.18.9
- CPU: AMD Ryzen 5 2600
- RAM: 32 GiB
- Motherboard: ASRock B450M-HDV R4.0
- BIOS: P10.60
- Affected service: zimaos-photos-ai-worker.service
- Affected executable: /usr/bin/zimaos-photos --ai-worker
- Kernel preemption model: PREEMPT(voluntary)
SUMMARY
On October 31, 2026 at 21:58:33 local time, a thread belonging to the ZimaOS Photos AI worker triggered the following kernel warning:
Voluntary context switch within RCU read-side critical section!
The affected task was:
- Process name: zimaos-photos
- Thread PID: 1924
- Main process/TGID: 1759
- Service: zimaos-photos-ai-worker.service
The kernel stack included:
- rcu_note_context_switch
- __schedule
- schedule
- futex_do_wait
- __futex_wait
- futex_wait
- do_futex
- __x64_sys_futex
After the initial warning, the same thread was continuously reported in RCU stalls for more than eight hours.
At approximately 06:15 on November 1, 2026, the system reached a global out-of-memory condition. The Linux OOM killer terminated the ZimaOS Photos AI worker.
IMPACT
During the incident:
- The server had 32 GiB of RAM, but almost all RAM became unavailable.
- The 8 GiB swap was almost completely used.
- PageTables grew to approximately 6 GiB.
- Kernel slab and maple_node allocations became abnormally large.
- Systemd timers scheduled between 03:00 and 05:00 were delayed.
- The delayed timers were all started at approximately 06:15.
- Docker could no longer start some container healthchecks normally.
- Some otherwise healthy containers temporarily became unhealthy.
- PostgreSQL reported delayed autovacuum worker startup warnings.
- The ZimaOS Photos AI worker reached approximately 1.2 GiB RAM and 1.1 GiB swap.
- Other services recovered after the Photos AI worker was terminated and restarted.
INITIAL KERNEL WARNING
The relevant kernel message was:
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 8 PID: 1924 at kernel/rcu/tree_plugin.h:332 rcu_note_context_switch
CPU: 8 UID: 0 PID: 1924 Comm: zimaos-photos
Kernel: 6.18.9 #1 PREEMPT(voluntary)
The call trace included:
rcu_note_context_switch
__schedule
schedule
futex_do_wait
__futex_wait
futex_wait
do_futex
__x64_sys_futex
do_syscall_64
entry_SYSCALL_64_after_hwframe
-–[ end trace ]—
RCU STALL
After the first warning, the kernel repeatedly reported:
rcu_preempt detected stalls on CPUs/tasks
Tasks blocked on level-0 rcu_node: P1924
task:zimaos-photos state:S pid:1924 tgid:1759 ppid:1
The process was usually waiting in futex_wait or nanosleep while still being reported as blocking RCU progress.
OOM EVENT
The relevant OOM messages were:
zimaos-photos invoked oom-killer
oom-kill:
constraint=CONSTRAINT_NONE
global_oom
task_memcg=/zimaos.slice/zimaos-photos.slice/zimaos-photos-ai.slice/zimaos-photos-ai-worker.service
task=zimaos-photos
pid=1759
Out of memory: Killed process 1759 (zimaos-photos)
oom_score_adj=1000
Tasks in zimaos-photos-ai-worker.service are going to be killed due to memory.oom.group set
SYSTEMD RESTART
Systemd restarted the service automatically after the OOM event.
The service reported:
zimaos-photos-ai-worker.service: Scheduled restart job, restart counter is at 1.
zimaos-photos-ai-worker.service: Found left-over process 1759 (zimaos-photos) in control group while starting unit. Ignoring.
zimaos-photos-ai-worker.service: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
After the restart, the worker received a new PID and returned to normal operation.
RECOVERY
After the ZimaOS Photos AI worker was terminated and restarted:
- Approximately 24 GiB of RAM became available again.
- PageTables dropped from approximately 6 GiB to approximately 90 MiB.
- Kernel slab usage returned to approximately 1 GiB.
- The new Photos AI worker used approximately 35 MiB of RAM.
- The worker had no swap usage.
- Docker healthchecks recovered.
- PostgreSQL returned to healthy status.
- No additional RCU warning was found after the worker restart.
EVENTS BEFORE THE INITIAL WARNING
Before the first RCU warning, the Manticore component used by ZimaOS Photos was repeatedly stopped and started.
The approximate sequence was:
21:34 - Manticore clean shutdown
21:41 - Manticore started again
21:44 - Manticore clean shutdown
21:48 - Manticore started again
21:54 - Manticore clean shutdown
21:57 - Broken pipe while ZimaOS Photos attempted to write to 127.0.0.1:9316
21:58:33 - Voluntary context switch within RCU read-side critical section
21:58:59 - Manticore started again
The shutdown messages included:
[manticore] shutdown flush tables
[manticore] metadata checkpoint
searchd: caught SIGTERM, shutting down
shutdown complete
After startup, the Photos planner also reported:
missing_english_vlm_rows:2701
The server was responsive immediately before the first RCU warning.
CURRENT TEMPORARY MITIGATION
The original service already contained:
Restart=on-failure
RestartSec=3
OOMPolicy=kill
OOMScoreAdjust=1000
TasksMax=128
GOMAXPROCS=1
ZIMAOS_NCNN_MAX_CONCURRENT_INFERENCES=1
Nice=15
However, there were no memory or swap limits:
MemoryHigh=infinity
MemoryMax=infinity
MemorySwapMax=infinity
As a temporary protection, I applied the following persistent systemd limits only to the Photos AI worker:
MemoryHigh=1536M
MemoryMax=2G
MemorySwapMax=512M
The effective limits are now:
MemoryHigh=1610612736
MemoryMax=2147483648
MemorySwapMax=536870912
The service is currently running normally and no new RCU warning has appeared.
QUESTIONS
1. Is this a known issue in ZimaOS 1.8.0 Photos or the Photos AI worker?
2. Is there an updated zimaos-photos binary or a ZimaOS update that fixes this issue?
3. Could this be caused by the Photos AI worker, one of its native AI libraries, or an incompatibility with kernel 6.18.9?
4. Are the temporary MemoryHigh, MemoryMax and MemorySwapMax limits considered safe for this service?
5. Should the Manticore shutdown and restart cycle happen this frequently?
6. Is there any additional diagnostic information that I should collect if the RCU warning happens again?
I can provide additional sanitized kernel logs, the complete OOM report and the systemd unit configuration if required.
Thank you.