stuck with kernel_task taking all the resources

All your general support questions for OpenZFS on OS X.

stuck with kernel_task taking all the resources

Postby pinver » Tue Feb 18, 2025 3:41 am

Hi all,

To practice with ZFS, yesterday I've installed it on my Mac and created a pool on an external 16TB IronWolf Pro (Factory Recertificated).
I've successfully created a ZVOL, formatted it in APFS and connected with TimeMachine, and that worked wonderfully.
Then I've created a dataset, and started syncing data from a remote machine, all fine! Exported the pool and went to bed satisfied.

This morning, I've imported the pool, and started rsyncing a larger amount of data, some TB, the rsync terminated correctly, but now the Mac is totally nor responsive, to the point the mouse barely moves, and I'm unable to open a terminal or connect to it with SSH via WiFI. I've seen kernel_task eating all the CPU, I'm not able to switch to Memory in activity monitor, so I dunno if it's taking all the memory too.

I hear the disk crunching, so I think disk operations are still ongoing, and I'm reluctant to hard-reboot. Now, It's about two hours that the situation is in that way, and I'm trying to open a terminal to shutdown the machine.

Any advice? My configuration is: M2 Macbook 16MB - MacOS 15.3.1 - ZFS 2.2.3

Thank,
Paolo
pinver
 
Posts: 2
Joined: Tue Feb 18, 2025 3:19 am

Re: stuck with kernel_task taking all the resources

Postby Sharko » Tue Feb 18, 2025 9:52 am

I think that this is probably a transient condition, perhaps caused by a combination of a couple things. The fact that your disk is crunching away suggests that Spotlight is probably indexing the disk, which tends to hog all the I/O. If you have terabytes of data that will take a while.

The fact that the system is very unresponsive also suggests to me that ZFS has grabbed too large a share of the RAM, forcing the MacOS virtual memory system to have to shuffle memory pages between disk and RAM just to get simple tasks done. You might try limiting the amount of RAM that ZFS can access with the instructions on this page of our wiki:

https://openzfsonosx.org/wiki/Memory_utilization
Sharko
 
Posts: 261
Joined: Thu May 12, 2016 12:19 pm

Re: stuck with kernel_task taking all the resources

Postby pinver » Wed Feb 19, 2025 1:17 am

Thank you Sharko,

I was unable to check the amount of wired memory used, at the end the kernel panicked and the system rebooted.

I've set a limit memory limit with `sudo sysctl -w kstat.zfs.darwin.tunable.zfs_arc.max=6000000000`, and excluded the pool for Spotlight (also if mdworkers processes are still crunching the disk) and everything's now running smoothly.

Paolo
pinver
 
Posts: 2
Joined: Tue Feb 18, 2025 3:19 am


Return to General Help

Who is online

Users browsing this forum: No registered users and 23 guests