ZimaOS 1.8 Photos AI worker causes prolonged RCU stall, memory exhaustion and global OOM

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.

Thank you for providing such a detailed timeline and logs. We’re sorry this incident affected other services on your server.

We’re working on improvements to Photos’ memory usage and processing efficiency. However, the persistent RCU stalls and unusually high page-table and kernel-memory usage in your report differ from the symptoms of the previously reported /tmp preview-cache issue. We can’t yet confirm that they share the same cause, and we’ll investigate further using the information you’ve provided.

We’d like to share a few improvements in the new version:

  • OCR memory usage is expected to decrease by approximately 50%.
  • Index creation time is expected to decrease by approximately one-third.
  • We’ve fixed an issue that could cause photo processing to wait for up to six hours between batches, resulting in long pauses.

The actual improvements will vary with hardware, photo content, and storage performance. These changes should reduce resource pressure and improve processing efficiency, but we can’t yet confirm that they resolve the RCU stalls and global OOM you experienced.

Regarding Manticore, stopping automatically when idle and starting again when needed is expected behavior in Photos, intended to reduce idle resource usage. Start/stop entries alone therefore don’t indicate a fault. We still need to examine the surrounding logs to determine whether that activity was related to this incident.

It’s helpful to know that the service has been running normally since you applied the memory and swap limits. They can serve as a temporary precaution, but we haven’t validated those values across all processing workloads. Limits that are too restrictive may slow processing or cause worker restarts, and they cannot guarantee protection against the system-level memory issue described here.

Could you share the sanitized logs and configuration you offered to help us investigate?

  1. The complete first RCU warning and call trace, along with representative subsequent stall reports.
  2. The complete OOM report, including memory statistics and the process list.
  3. Logs from the Photos main service and AI worker around the incident, together with the relevant systemd configuration and any custom overrides.

We expect to release ZimaOS 1.8.1-alpha1 soon. If you’re available, would you be willing to help us test it and check whether the issues above still occur? Once the build is ready, we’ll post the download details and changes here.

Thank you again for your careful documentation and help. If the issue affects server stability again, we recommend temporarily stopping Photos to keep your other services available.

please give option to disable zimaphoto

Thanks for the suggestion. For now, you can stop Photos and its AI background service, and disable their automatic startup, by running this command in the terminal:

sudo systemctl disable --now zimaos-photos.service zimaos-photos-ai-worker.service

In the upcoming version, Photos is expected to use very few system resources when no photo sources have been added. We’ll also consider adding a Photos toggle in Settings so you can enable or disable it directly.

thanks you

Hello,

I prepared the complete sanitized diagnostic report requested, but the forum currently prevents my new account from uploading attachments.

The report includes:

- the first complete RCU warning and call trace;

- representative subsequent RCU stall reports;

- the complete OOM report with memory statistics and process list;

- Photos main service and AI worker logs around the incident;

- the relevant systemd unit and slice configuration;

- the effective custom memory and swap limits.

Private network information, serial numbers and credentials were removed.

Could a moderator please enable attachment uploads for my account, or provide a secure alternative method for sending the 18 KB text report?

Thank you.

I have adjusted your posting permissions; please try again. If it still doesn’t work, please send it to this email address: rally@icewhale.org

Hello,

As requested in the IceWhale Community Forum, I am sending the sanitized diagnostic report regarding the ZimaOS Photos AI worker RCU stalls and global OOM incident.

The report includes the RCU warning and call trace, representative stalls, the complete OOM report, Photos service logs, systemd configuration and the temporary memory limits.

Private network information, serial numbers and credentials were removed.

Forum topic:

ZimaOS 1.8 Photos AI worker causes prolonged RCU stall, memory exhaustion and global OOM

Thank you.

icewhale-photos-rcu-relatorio-SANITIZADO.txt (17,1,KB)

Thank you for sharing the logs. We’ve prepared a new 1.8.1-alpha1 test build with improvements to Photos memory and CPU usage, along with the Photos toggles you requested.

Could you please help us with these two checks?

1. Check whether the Photos extension file is present

Please run the following command and share the output with us. We’d like to confirm whether icewhale_photos.raw exists in /var/lib/extensions/:

ls -lh /var/lib/extensions/

2. Try the 1.8.1-alpha1 test build

If you’re able to test this build, please run the following command as root. Your device will reboot automatically once the installation succeeds:

rauc install https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/extenal-package/zimaos-x86_64-1.8.1-alpha1.raucb && reboot

After updating, please try Photos again under similar usage conditions and let us know:

  • Whether CPU and memory usage have improved.
  • Whether the Photos AI worker still encounters OOM (out-of-memory) errors, or whether you still experience system stalls.
  • Which previously reported issues remain, and whether you notice any new issues.

If any problems persist, please share updated logs and the approximate time each problem occurred so we can investigate further.

Thanks again for your patience and help!

Hello,

I completed the requested check.

The file icewhale_photos.raw is not present in /var/lib/extensions/.

The directory contains only:

doconverter.raw

icewhale_files.raw

icewhale_peerdrop.raw

zimaos_zvm.raw

Thank you very much for preparing the ZimaOS 1.8.1-alpha1 test build and for investigating the Photos issue.

However, this is my primary home server. It runs RAID storage, DNS and other important services, so I only install stable ZimaOS releases on this system. I will not install the alpha test build.

There is no problem waiting. I can continue using the current stable version with the temporary Photos AI worker memory limits while monitoring the system.

When the fixes are included in an official stable release, I will update normally, reproduce similar Photos usage conditions and report whether CPU usage, memory usage, RCU stalls or OOM events occur again.

Thank you for your support and for including the requested Photos improvements.

Since you don’t want an alpha on the primary server, one option is to test 1.8.1-alpha1 inside a ZVM VM—your extensions list shows zimaos_zvm.raw is present. That would let you reproduce Photos usage without risking RAID/DNS services. Also worth flagging to the devs that icewhale_photos.raw is absent: if Photos is expected to be an extension, they may want to know how yours is installed before relying on that check. Otherwise waiting for stable and monitoring with the temporary limits seems reasonable.