Spotlight processes high CPU usage on scanning zfs dataset

All your general support questions for OpenZFS on OS X.

Spotlight processes high CPU usage on scanning zfs dataset

Postby sir_brickalot » Mon Mar 27, 2023 12:58 am

Hi there,
I have been using openzfs on osx for years but never managed to fix one annoying problem:
When I let Spotlight scan my zfs datasets, my system gets unresposive and the mds and mds_stores processes skyrocket. Even after a few days the problem persists like the datasets never get properly indexed. Btw. all datasets are encrypted.

Since it's clearly stated everywhere that Spotlight is supposed to be working it must be my setup so could you help me debug this problem?

Here is what I'f got:

Hackintosh System:
Code: Select all
user@host ~ % sw_vers
ProductName:   Mac OS X
ProductVersion:   10.15.7
BuildVersion:   19H15


ZFS Version:
Code: Select all
user@host ~ % zfs --version
zfs-macOS-2.1.6-1
zfs-kmod-2.1.6-1


Pool creation line:
Code: Select all
zpool create -f -o ashift=12 -O casesensitivity=insensitive -O atime=off -O normalization=formD -O compression=lz4 -O utf8only=on tank -O  mirror 'diskX' 'diskY'
zpool set feature@encryption=enabled tank
zfs create -o encryption=on -o keylocation=prompt -o keyformat=passphrase tank/datasetset


zpool status:
Code: Select all
user@host ~ % sudo zpool status -v tank
Password:
  pool: tank
 state: ONLINE
  scan: resilvered 178M in 00:01:16 with 0 errors on Tue Mar 14 02:57:36 2023
remove: Removal of vdev 1 copied 360M in 0h0m, completed on Mon Feb 15 21:34:17 2021
   52.6K memory used for removed device mappings
config:

   NAME                                            STATE     READ WRITE CKSUM
   tank                                            ONLINE       0     0     0
     mirror-0                                      ONLINE       0     0     0
       media-8C49AF1C-D1ED-DE47-A338-624B21E841CX  ONLINE       0     0     0
       media-B4C01C46-8D99-844A-876A-1DF20CD4639X  ONLINE       0     0     0

errors: No known data errors


Pool features:
Code: Select all
user@host ~ % zpool get all tank
NAME  PROPERTY                       VALUE                          SOURCE
tank  size                           3.62T                          -
tank  capacity                       91%                            -
tank  altroot                        -                              default
tank  health                         ONLINE                         -
tank  guid                           15725515092470506706           -
tank  version                        -                              default
tank  bootfs                         -                              default
tank  delegation                     on                             default
tank  autoreplace                    off                            default
tank  cachefile                      -                              default
tank  failmode                       wait                           default
tank  listsnapshots                  off                            default
tank  autoexpand                     off                            default
tank  dedupratio                     1.00x                          -
tank  free                           318G                           -
tank  allocated                      3.31T                          -
tank  readonly                       off                            -
tank  ashift                         12                             local
tank  comment                        -                              default
tank  expandsize                     -                              -
tank  freeing                        0                              -
tank  fragmentation                  17%                            -
tank  leaked                         0                              -
tank  multihost                      off                            default
tank  checkpoint                     -                              -
tank  load_guid                      7012514564047341978            -
tank  autotrim                       off                            default
tank  compatibility                  off                            default
tank  feature@async_destroy          enabled                        local
tank  feature@empty_bpobj            active                         local
tank  feature@lz4_compress           active                         local
tank  feature@multi_vdev_crash_dump  enabled                        local
tank  feature@spacemap_histogram     active                         local
tank  feature@enabled_txg            active                         local
tank  feature@hole_birth             active                         local
tank  feature@extensible_dataset     active                         local
tank  feature@embedded_data          active                         local
tank  feature@bookmarks              enabled                        local
tank  feature@filesystem_limits      enabled                        local
tank  feature@large_blocks           enabled                        local
tank  feature@large_dnode            enabled                        local
tank  feature@sha512                 enabled                        local
tank  feature@skein                  enabled                        local
tank  feature@edonr                  enabled                        local
tank  feature@userobj_accounting     active                         local
tank  feature@encryption             active                         local
tank  feature@project_quota          active                         local
tank  feature@device_removal         active                         local
tank  feature@obsolete_counts        active                         local
tank  feature@zpool_checkpoint       enabled                        local
tank  feature@spacemap_v2            active                         local
tank  feature@allocation_classes     enabled                        local
tank  feature@resilver_defer         enabled                        local
tank  feature@bookmark_v2            enabled                        local
tank  feature@redaction_bookmarks    enabled                        local
tank  feature@redacted_datasets      enabled                        local
tank  feature@bookmark_written       enabled                        local
tank  feature@log_spacemap           active                         local
tank  feature@livelist               enabled                        local
tank  feature@device_rebuild         enabled                        local
tank  feature@zstd_compress          enabled                        local
tank  feature@draid                  enabled                        local
tank  feature@zilsaxattr             active                         local
tank  feature@head_errlog            active                         local
tank  feature@blake3                 enabled                        local


Code: Select all
user@host ~ % zfs get encryption tank/dataset
NAME       PROPERTY    VALUE        SOURCE
tank/dataset  encryption  aes-256-ccm  -


Spotlight indexing status after several days:
Code: Select all
user@host ~ % mdutil -s /Volumes/tank/
/System/Volumes/Data/Volumes/tank:
   Indexing enabled.

user@host ~ % mdutil -s /Volumes/tank/dataset
/System/Volumes/Data/Volumes/tank/dataset:
   Error: unknown indexing state.


MacOS Log entries about mds:
Code: Select all
Mar 27 10:36:19 host com.apple.xpc.launchd[1] (com.apple.mdworker.shared.08000000-0000-0000-0000-000000000000[43768]): Service exited due to SIGKILL | sent by mds[43343]
Mar 27 10:30:29 host mdsync[43345]: objc[43345]: Class _MDSPathFilter is implemented in both /System/Library/PrivateFrameworks/SpotlightIndex.framework/Versions/A/SpotlightIndex and /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mdsync. One of the two will be used. Which one is undefined.


mds_stores and mdworker keep crashing. Crash info is attached.

Thank you for your help.
Attachments
mds_crash_info.txt.zip
(35.76 KiB) Downloaded 241 times
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby FadingIntoBlue » Mon Mar 27, 2023 10:53 am

I suspect spotlight isn't recognising the filesystem structure unless the following property is set

sudo zfs set com.apple.mimic=hfs <poolname>

Replace hfs with apfs if you prefer, have reasons to.
FadingIntoBlue
 
Posts: 106
Joined: Tue May 27, 2014 12:25 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby lundman » Mon Mar 27, 2023 2:42 pm

If you do see it taking a lot of CPU, run spindump. that was we can see what it is doing while it is busy. If it actually crashes though, that is different
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby sir_brickalot » Mon Mar 27, 2023 10:57 pm

FadingIntoBlue wrote:I suspect spotlight isn't recognising the filesystem structure unless the following property is set
sudo zfs set com.apple.mimic=hfs <poolname>

I would have sworn I did that, when setting it up. Can I check if it was set or not? I guess its not in the zpool feature set?
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby sir_brickalot » Tue Mar 28, 2023 12:39 am

lundman wrote:If you do see it taking a lot of CPU, run spindump. that was we can see what it is doing while it is busy. If it actually crashes though, that is different

That is a good idea. I'll test the mimic=hfs part first and then I'll test spindump.

One weird aspect I see already:

I enabled hfs on my dataset but when I check the indexing with mdutils it lists the pool as "Indexing enabled." but the dataset as "Error: unknown indexing state.".

I'll let it scan for now... see how it goes.

/edit:

I observed the scanning and it actually went almost through within say 5 hours. After that i could search for items in the dataset. Spotlight would find folders, but not files!
And now mds started eating up all my CPU power. spindump next I guess.
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby sir_brickalot » Mon Apr 03, 2023 2:10 am

lundman wrote:If you do see it taking a lot of CPU, run spindump. that was we can see what it is doing while it is busy. If it actually crashes though, that is different

Hi lundman thanks again for helping out. I created a spindump file for mds_stores, that keeps crashing no matter how I enable indexing.

Can you guide me on how to analyze it or tell me what part would be needed to find the problem? There seems to be a lot of personal data in there. :-D
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby lundman » Mon Apr 03, 2023 4:13 pm

You generally only care about stacks with "zfs" in them, and in this case, mds - which hopefully ends up in zfs.

The number before each function is how many times it saw that function, but sometimes that is perfectly normal, like
Code: Select all
Steps:            1000 (10ms sampling interval)


* 1000 large stack
   *1000 carries on
      *1000  machine_switch_context

that is a good thing, it means it was just sleeping the whole time, not on the CPU.

and loooong stacks with "* 1" or some other low number is also not interesting. Just means they went
deep that one time.

Trick is to find high numbers, than don't end in a sleep, ie, they were constantly on the CPU.

Bad news is, its got a fair bit of guess work in it.
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby sir_brickalot » Wed Apr 05, 2023 12:53 am

lundman wrote:You generally only care about stacks with "zfs" in them, and in this case, mds - which hopefully ends up in zfs.

The number before each function is how many times it saw that function, but sometimes that is perfectly normal, like
Code: Select all
Steps:            1000 (10ms sampling interval)


* 1000 large stack
   *1000 carries on
      *1000  machine_switch_context

that is a good thing, it means it was just sleeping the whole time, not on the CPU.

and loooong stacks with "* 1" or some other low number is also not interesting. Just means they went
deep that one time.

Trick is to find high numbers, than don't end in a sleep, ie, they were constantly on the CPU.

Bad news is, its got a fair bit of guess work in it.

Thank you for your insights and I hoped I could filter out some info from the spindump but I'm not a dev, just a (maybe power-) user, so I'm not able to figure out what all those stacks tell me.
Here is a stack that has mds an zfs in them, but if there is a problem or not, I don't know:
Code: Select all
                  14    ??? (mds + 568045) [0x1015bdaed]
                    14    _CFBundleCopyArchitecturesForExecutable + 66 (CoreFoundation + 978066) [0x7fff2ebe2c92]
                      14    read + 10 (libsystem_kernel.dylib + 6174) [0x7fff68d2981e]
                       *14    hndl_unix_scall64 + 22 (kernel + 782854) [0xffffff80002bf206]
                         *14    unix_syscall64 + 647 (kernel + 7873591) [0xffffff8000982437]
                           *14    read_nocancel + 138 (kernel + 6939242) [0xffffff800089e26a]
                             *14    ??? (kernel + 6939954) [0xffffff800089e532]
                               *14    ??? (kernel + 3784675) [0xffffff800059bfe3]
                                 *14    zfs_vnop_read + 172 (zfs + 1377980) [0xffffff7f84dc16bc]
                                   *14    zfs_read + 687 (zfs + 1136783) [0xffffff7f84d8688f]
                                     *14    dmu_read_uio_dbuf + 59 (zfs + 265259) [0xffffff7f84cb1c2b]
                                       *14    dmu_read_uio_dnode + 85 (zfs + 264917) [0xffffff7f84cb1ad5]
                                         *11    dmu_buf_hold_array_by_dnode + 575 (zfs + 260223) [0xffffff7f84cb087f]
                                           *11    zio_wait + 760 (zfs + 1172760) [0xffffff7f84d8f518]
                                             *11    spl_cv_timedwait + 213 (zfs + 2997) [0xffffff7f84c71bb5]
                                               *11    ??? (kernel + 6834573) [0xffffff800088498d]
                                                 *11    lck_mtx_sleep_deadline + 115 (kernel + 1219427) [0xffffff8000329b63]
                                                   *11    thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                     *11    ??? (kernel + 1287441) [0xffffff800033a511]
                                                       *11    machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8]
                                         *2     dmu_buf_hold_array_by_dnode + 453 (zfs + 260101) [0xffffff7f84cb0805]
                                           *2     dbuf_hold + 34 (zfs + 232194) [0xffffff7f84ca9b02]
                                             *2     dbuf_hold_impl + 1080 (zfs + 229688) [0xffffff7f84ca9138]
                                               *2     dbuf_read + 2069 (zfs + 215941) [0xffffff7f84ca5b85]
                                                 *2     zio_wait + 760 (zfs + 1172760) [0xffffff7f84d8f518]
                                                   *2     spl_cv_timedwait + 213 (zfs + 2997) [0xffffff7f84c71bb5]
                                                     *2     ??? (kernel + 6834573) [0xffffff800088498d]
                                                       *2     lck_mtx_sleep_deadline + 115 (kernel + 1219427) [0xffffff8000329b63]
                                                         *2     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                           *2     ??? (kernel + 1287441) [0xffffff800033a511]
                                                             *2     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8]
                                         *1     dmu_buf_hold_array_by_dnode + 486 (zfs + 260134) [0xffffff7f84cb0826]
                                           *1     dbuf_read + 2313 (zfs + 216185) [0xffffff7f84ca5c79]
                                             *1     arc_read + 3479 (zfs + 131399) [0xffffff7f84c91147]
                                               *1     zio_nowait + 338 (zfs + 1168418) [0xffffff7f84d8e422]
                                                 *1     zio_vdev_io_start + 539 (zfs + 1190539) [0xffffff7f84d93a8b]
                                                   *1     vdev_mirror_io_start + 256 (zfs + 899440) [0xffffff7f84d4c970]
                                                     *1     zio_nowait + 338 (zfs + 1168418) [0xffffff7f84d8e422]
                                                       *1     zio_vdev_io_start + 539 (zfs + 1190539) [0xffffff7f84d93a8b]
                                                         *1     vdev_mirror_io_start + 256 (zfs + 899440) [0xffffff7f84d4c970]
                                                           *1     zio_nowait + 338 (zfs + 1168418) [0xffffff7f84d8e422]
                                                             *1     zio_vdev_io_start + 539 (zfs + 1190539) [0xffffff7f84d93a8b]
                                                               *1     vdev_disk_io_strategy + 246 (zfs + 1268518) [0xffffff7f84da6b26]
                                                                 *1     buf_strategy_iokit + 48 (zfs + 1249088) [0xffffff7f84da1f40]
                                                                   *1     IOMemoryDescriptor::withAddress(void*, unsigned long long, unsigned int) + 167 (kernel + 8648023) [0xffffff8000a3f557]
                                                                     *1     IOGeneralMemoryDescriptor::initWithOptions(void*, unsigned int, unsigned int, task*, unsigned int, IOMapper*) + 2302 (kernel + 8625646) [0xffffff8000a39dee]
                                                                       *1     IOGeneralMemoryDescriptor::prepare(unsigned int) + 105 (kernel + 8630553) [0xffffff8000a3b119]
                                                                         *1     IOGeneralMemoryDescriptor::wireVirtual(unsigned int) + 1357 (kernel + 8639421) [0xffffff8000a3d3bd]
                                                                           *1     vm_map_create_upl + 79 (kernel + 1936399) [0xffffff80003d8c0f]
                                                                             *1     IORWLockRead + 736 (kernel + 2336624) [0xffffff800043a770]
                                                                               *1     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                 *1     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                   *1     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8]
                  11    ??? (mds + 569155) [0x1015bdf43]
                    11    CFURLCopyResourcePropertyForKey + 119 (CoreFoundation + 357628) [0x7fff2eb4b4fc]
                      11    _FSURLCopyResourcePropertyForKeyInternal(__CFURL const*, __CFString const*, void*, void*, __CFError**, unsigned char) + 221 (CoreServicesInternal + 2974) [0x7fff47f1bb9e]
                        11    prepareValuesForBitmap(__CFURL const*, __FileCache*, _FilePropertyBitmap*, __CFError**) + 363 (CoreServicesInternal + 17604) [0x7fff47f1f4c4]
                          11    LaunchServices::URLPropertyProvider::prepareValues(__CFURL const*, __FileCache*, __CFString const* const*, void const**, long, void const*, __CFError**) + 573 (LaunchServices + 72649) [0x7fff302adbc9]
                            11    LaunchServices::URLPropertyProvider::prepareLocalizedTypeDescriptionDictionaryValue(LaunchServices::Database::Context&, FSNode*, __FileCache*, __CFString const*, NSError* __autoreleasing*) + 40 (LaunchServices + 1421513) [0x7fff303f70c9]
                              11    LaunchServices::URLPropertyProvider::getAttributeValueForKey(LaunchServices::Database::Context&, FSNode*, __FileCache*, __CFString const*, objc_object* __strong*, NSError* __autoreleasing*) + 147 (LaunchServices + 1428983) [0x7fff303f8df7]
                                11    _LSFindBundleAndCopyNodeAttributes + 193 (LaunchServices + 428057) [0x7fff30304819]
                                  11    _LSCopyNodeAttributes + 171 (LaunchServices + 428281) [0x7fff303048f9]
                                    11    _LSCopyNodeAttributeWithState(LSNodeAttributeStateCache*, __CFString const*) + 72 (LaunchServices + 192374) [0x7fff302caf76]
                                      11    _LSCopyNodeAttribute_DisplayKindLocalizationDictionary(LSNodeAttributeStateCache*) + 213 (LaunchServices + 439345) [0x7fff30307431]
                                        11    LSNodeAttributeStateCache::hasBinding() + 136 (LaunchServices + 439764) [0x7fff303075d4]
                                          10    LaunchServices::BindingEvaluator::getBestBinding(LSContext*, NSError* __autoreleasing*) const + 105 (LaunchServices + 105619) [0x7fff302b5c93]
                                            7     LaunchServices::BindingEvaluation::runEvaluator(LaunchServices::BindingEvaluation::State&, NSError* __autoreleasing*) + 771 (LaunchServices + 108747) [0x7fff302b68cb]
                                              6     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) + 191 (LaunchServices + 110096) [0x7fff302b6e10]
                                                4     LaunchServices::BindingEvaluation::addParentUTIClaims(LaunchServices::BindingEvaluation::State&) + 956 (LaunchServices + 146607) [0x7fff302bfcaf]
                                                  4     LaunchServices::BindingEvaluation::addParentUTIClaims(LaunchServices::BindingEvaluation::State&) (.cold.3) + 70 (LaunchServices + 1783287) [0x7fff3044f5f7]
                                                    4     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                      4     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                        4     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                          4     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                            4     _os_activity_stream_reflect + 530 (libsystem_trace.dylib + 58583) [0x7fff68e0f4d7]
                                                              4     dispatch_block_perform + 124 (libdispatch.dylib + 19577) [0x7fff68b90c79]
                                                                4     _dispatch_block_invoke_direct + 245 (libdispatch.dylib + 19833) [0x7fff68b90d79]
                                                                  4     _dispatch_client_callout + 8 (libdispatch.dylib + 9816) [0x7fff68b8e658]
                                                                    4     ___os_activity_stream_reflect_block_invoke + 29 (libsystem_trace.dylib + 59947) [0x7fff68e0fa2b]
                                                                      4     xpc_pipe_simpleroutine + 42 (libxpc.dylib + 81770) [0x7fff68e32f6a]
                                                                        3     _xpc_pipe_simpleroutine + 79 (libxpc.dylib + 102168) [0x7fff68e37f18]
                                                                          3     _xpc_send_serializer + 96 (libxpc.dylib + 81890) [0x7fff68e32fe2]
                                                                            3     mach_msg_trap + 10 (libsystem_kernel.dylib + 3578) [0x7fff68d28dfa]
                                                                             *3     hndl_mach_scall64 + 22 (kernel + 782886) [0xffffff80002bf226]
                                                                               *3     mach_call_munger64 + 517 (kernel + 2269349) [0xffffff800042a0a5]
                                                                                 *3     mach_msg_overwrite_trap + 722 (kernel + 1096530) [0xffffff800030bb52]
                                                                                   *3     ipc_kmsg_send + 640 (kernel + 1003136) [0xffffff80002f4e80]
                                                                                     *3     ipc_mqueue_send + 431 (kernel + 1022479) [0xffffff80002f9a0f]
                                                                                       *3     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                         *3     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                           *3     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8] (blocked by turnstile waiting for diagnosticd [5299] thread 0x485d5d after 2 hops)
                                                                        1     _xpc_pipe_simpleroutine + 90 (libxpc.dylib + 102179) [0x7fff68e37f23]
                                                                          1     -[OS_xpc_object dealloc] + 47 (libxpc.dylib + 21074) [0x7fff68e24252]
                                                                            1     free_tiny + 159 (libsystem_malloc.dylib + 23647) [0x7fff68da2c5f]
                                                                              1     __ulock_wait + 10 (libsystem_kernel.dylib + 9566) [0x7fff68d2a55e]
                                                                               *1     ??? (kernel + 6980240) [0xffffff80008a8290] (runnable)
                                                2     LaunchServices::BindingEvaluation::addParentUTIClaims(LaunchServices::BindingEvaluation::State&) + 636 (LaunchServices + 146287) [0x7fff302bfb6f]
                                                  2     LaunchServices::BindingEvaluation::addClaimsForParentUTI(LaunchServices::BindingEvaluation::State&, UTTypeData const*) + 289 (LaunchServices + 500657) [0x7fff303163b1]
                                                    2     LaunchServices::BindingEvaluation::addClaimsForParentUTI(LaunchServices::BindingEvaluation::State&, UTTypeData const*) (.cold.1) + 61 (LaunchServices + 1783809) [0x7fff3044f801]
                                                      2     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                        2     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                          2     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                            2     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                              1     _os_activity_stream_reflect + 530 (libsystem_trace.dylib + 58583) [0x7fff68e0f4d7]
                                                                1     dispatch_block_perform + 124 (libdispatch.dylib + 19577) [0x7fff68b90c79]
                                                                  1     _dispatch_block_invoke_direct + 245 (libdispatch.dylib + 19833) [0x7fff68b90d79]
                                                                    1     _dispatch_client_callout + 8 (libdispatch.dylib + 9816) [0x7fff68b8e658]
                                                                      1     ___os_activity_stream_reflect_block_invoke + 29 (libsystem_trace.dylib + 59947) [0x7fff68e0fa2b]
                                                                        1     xpc_pipe_simpleroutine + 42 (libxpc.dylib + 81770) [0x7fff68e32f6a]
                                                                          1     _xpc_pipe_simpleroutine + 79 (libxpc.dylib + 102168) [0x7fff68e37f18]
                                                                            1     _xpc_send_serializer + 96 (libxpc.dylib + 81890) [0x7fff68e32fe2]
                                                                              1     mach_msg_trap + 10 (libsystem_kernel.dylib + 3578) [0x7fff68d28dfa]
                                                                               *1     hndl_mach_scall64 + 22 (kernel + 782886) [0xffffff80002bf226]
                                                                                 *1     mach_call_munger64 + 517 (kernel + 2269349) [0xffffff800042a0a5]
                                                                                   *1     mach_msg_overwrite_trap + 722 (kernel + 1096530) [0xffffff800030bb52]
                                                                                     *1     ipc_kmsg_send + 640 (kernel + 1003136) [0xffffff80002f4e80]
                                                                                       *1     ipc_mqueue_send + 431 (kernel + 1022479) [0xffffff80002f9a0f]
                                                                                         *1     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                           *1     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                             *1     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8] (blocked by turnstile waiting for diagnosticd [5299] thread 0x485d5d after 2 hops)
                                                              1     _os_activity_stream_reflect + 330 (libsystem_trace.dylib + 58383) [0x7fff68e0f40f]
                                                                1     xpc_dictionary_get_int64 + 120 (libxpc.dylib + 34092) [0x7fff68e2752c]
                                                                  1     _xpc_dictionary_look_up_fast + 68 (libxpc.dylib + 26148) [0x7fff68e25624]
                                                                    1     _xpc_dictionary_look_up + 29 (libxpc.dylib + 21626) [0x7fff68e2447a]
                                                                      1     _xpc_dictionary_look_up_table + 41 (libxpc.dylib + 21951) [0x7fff68e245bf] (running)
                                              1     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) + 1421 (LaunchServices + 111326) [0x7fff302b72de]
                                                1     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) (.cold.6) + 45 (LaunchServices + 1782036) [0x7fff3044f114]
                                                  1     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                    1     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                      1     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                        1     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                          1     _os_activity_stream_reflect + 530 (libsystem_trace.dylib + 58583) [0x7fff68e0f4d7]
                                                            1     dispatch_block_perform + 124 (libdispatch.dylib + 19577) [0x7fff68b90c79]
                                                              1     _dispatch_block_invoke_direct + 245 (libdispatch.dylib + 19833) [0x7fff68b90d79]
                                                                1     _dispatch_client_callout + 8 (libdispatch.dylib + 9816) [0x7fff68b8e658]
                                                                  1     ___os_activity_stream_reflect_block_invoke + 29 (libsystem_trace.dylib + 59947) [0x7fff68e0fa2b]
                                                                    1     xpc_pipe_simpleroutine + 42 (libxpc.dylib + 81770) [0x7fff68e32f6a]
                                                                      1     _xpc_pipe_simpleroutine + 79 (libxpc.dylib + 102168) [0x7fff68e37f18]
                                                                        1     _xpc_send_serializer + 96 (libxpc.dylib + 81890) [0x7fff68e32fe2]
                                                                          1     mach_msg_trap + 10 (libsystem_kernel.dylib + 3578) [0x7fff68d28dfa]
                                                                           *1     hndl_mach_scall64 + 22 (kernel + 782886) [0xffffff80002bf226]
                                                                             *1     mach_call_munger64 + 517 (kernel + 2269349) [0xffffff800042a0a5]
                                                                               *1     mach_msg_overwrite_trap + 722 (kernel + 1096530) [0xffffff800030bb52]
                                                                                 *1     ipc_kmsg_send + 640 (kernel + 1003136) [0xffffff80002f4e80]
                                                                                   *1     ipc_mqueue_send + 431 (kernel + 1022479) [0xffffff80002f9a0f]
                                                                                     *1     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                       *1     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                         *1     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8] (blocked by turnstile waiting for diagnosticd [5299] thread 0x485d5d after 2 hops)
                                            2     LaunchServices::BindingEvaluation::runEvaluator(LaunchServices::BindingEvaluation::State&, NSError* __autoreleasing*) + 591 (LaunchServices + 108567) [0x7fff302b6817]
                                              2     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) + 1421 (LaunchServices + 111326) [0x7fff302b72de]
                                                2     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) (.cold.6) + 45 (LaunchServices + 1782036) [0x7fff3044f114]
                                                  2     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                    2     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                      2     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                        2     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                          2     _os_activity_stream_reflect + 530 (libsystem_trace.dylib + 58583) [0x7fff68e0f4d7]
                                                            2     dispatch_block_perform + 124 (libdispatch.dylib + 19577) [0x7fff68b90c79]
                                                              2     _dispatch_block_invoke_direct + 245 (libdispatch.dylib + 19833) [0x7fff68b90d79]
                                                                2     _dispatch_client_callout + 8 (libdispatch.dylib + 9816) [0x7fff68b8e658]
                                                                  2     ___os_activity_stream_reflect_block_invoke + 29 (libsystem_trace.dylib + 59947) [0x7fff68e0fa2b]
                                                                    2     xpc_pipe_simpleroutine + 42 (libxpc.dylib + 81770) [0x7fff68e32f6a]
                                                                      2     _xpc_pipe_simpleroutine + 79 (libxpc.dylib + 102168) [0x7fff68e37f18]
                                                                        2     _xpc_send_serializer + 96 (libxpc.dylib + 81890) [0x7fff68e32fe2]
                                                                          2     mach_msg_trap + 10 (libsystem_kernel.dylib + 3578) [0x7fff68d28dfa]
                                                                           *2     hndl_mach_scall64 + 22 (kernel + 782886) [0xffffff80002bf226]
                                                                             *2     mach_call_munger64 + 517 (kernel + 2269349) [0xffffff800042a0a5]
                                                                               *2     mach_msg_overwrite_trap + 722 (kernel + 1096530) [0xffffff800030bb52]
                                                                                 *2     ipc_kmsg_send + 640 (kernel + 1003136) [0xffffff80002f4e80]
                                                                                   *2     ipc_mqueue_send + 431 (kernel + 1022479) [0xffffff80002f9a0f]
                                                                                     *2     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                       *2     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                         *2     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8] (blocked by turnstile waiting for diagnosticd [5299] thread 0x485d5d after 2 hops)
                                            1     LaunchServices::BindingEvaluation::runEvaluator(LaunchServices::BindingEvaluation::State&, NSError* __autoreleasing*) + 681 (LaunchServices + 108657) [0x7fff302b6871]
                                              1     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) + 2627 (LaunchServices + 112532) [0x7fff302b7794]
                                                1     LaunchServices::BindingEvaluation::addAndEvaluate(LaunchServices::BindingEvaluation::State&, void (*)(LaunchServices::BindingEvaluation::State&), std::__1::vector<LaunchServices::BindingEvaluation::ExtendedBinding, std::__1::allocator<LaunchServices::BindingEvaluation::ExtendedBinding> >&) (.cold.1) + 51 (LaunchServices + 1781610) [0x7fff3044ef6a]
                                                  1     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                    1     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                      1     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                        1     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                          1     _os_activity_stream_reflect + 530 (libsystem_trace.dylib + 58583) [0x7fff68e0f4d7]
                                                            1     dispatch_block_perform + 124 (libdispatch.dylib + 19577) [0x7fff68b90c79]
                                                              1     _dispatch_block_invoke_direct + 245 (libdispatch.dylib + 19833) [0x7fff68b90d79]
                                                                1     _dispatch_client_callout + 8 (libdispatch.dylib + 9816) [0x7fff68b8e658]
                                                                  1     ___os_activity_stream_reflect_block_invoke + 29 (libsystem_trace.dylib + 59947) [0x7fff68e0fa2b]
                                                                    1     xpc_pipe_simpleroutine + 42 (libxpc.dylib + 81770) [0x7fff68e32f6a]
                                                                      1     _xpc_pipe_simpleroutine + 79 (libxpc.dylib + 102168) [0x7fff68e37f18]
                                                                        1     _xpc_send_serializer + 96 (libxpc.dylib + 81890) [0x7fff68e32fe2]
                                                                          1     mach_msg_trap + 10 (libsystem_kernel.dylib + 3578) [0x7fff68d28dfa]
                                                                           *1     hndl_mach_scall64 + 22 (kernel + 782886) [0xffffff80002bf226]
                                                                             *1     mach_call_munger64 + 517 (kernel + 2269349) [0xffffff800042a0a5]
                                                                               *1     mach_msg_overwrite_trap + 722 (kernel + 1096530) [0xffffff800030bb52]
                                                                                 *1     ipc_kmsg_send + 640 (kernel + 1003136) [0xffffff80002f4e80]
                                                                                   *1     ipc_mqueue_send + 431 (kernel + 1022479) [0xffffff80002f9a0f]
                                                                                     *1     thread_block_reason + 175 (kernel + 1281359) [0xffffff8000338d4f]
                                                                                       *1     ??? (kernel + 1287441) [0xffffff800033a511]
                                                                                         *1     machine_switch_context + 200 (kernel + 2357416) [0xffffff800043f8a8] (blocked by turnstile waiting for diagnosticd [5299] thread 0x485d5d after 2 hops)
                                          1     LaunchServices::BindingEvaluator::getBestBinding(LSContext*, NSError* __autoreleasing*) const + 182 (LaunchServices + 105696) [0x7fff302b5ce0]
                                            1     LaunchServices::BindingEvaluator::~BindingEvaluator() + 216 (LaunchServices + 126824) [0x7fff302baf68]
                                              1     LaunchServices::BindingEvaluator::~BindingEvaluator() (.cold.1) + 63 (LaunchServices + 1780286) [0x7fff3044ea3e]
                                                1     _os_log_debug_impl + 9 (libsystem_trace.dylib + 29314) [0x7fff68e08282]
                                                  1     _os_log + 162 (libsystem_trace.dylib + 18182) [0x7fff68e05706]
                                                    1     _os_log_impl_flatten_and_send + 8502 (libsystem_trace.dylib + 26699) [0x7fff68e0784b]
                                                      1     _os_log_impl_stream + 535 (libsystem_trace.dylib + 73806) [0x7fff68e1304e]
                                                        1     _os_activity_stream_reflect + 292 (libsystem_trace.dylib + 58345) [0x7fff68e0f3e9]
                                                          1     _os_activity_stream_entry_encode + 999 (libsystem_trace.dylib + 59643) [0x7fff68e0f8fb]
                                                            1     xpc_dictionary_set_data + 27 (libxpc.dylib + 39277) [0x7fff68e2896d]
                                                              1     xpc_data_create + 45 (libxpc.dylib + 13148) [0x7fff68e2235c]
                                                                1     _dispatch_object_alloc + 0 (libdispatch.dylib + 6963) [0x7fff68b8db33]
                                                                 *1     ??? (kernel + 1114688) [0xffffff8000310240] (runnable)


I attached the whole thing. PW is 'spindump_{myusername}'

Maybe some wise and nice person is able to help. :)
Attachments
spindump_mds_stores.zip
(2.14 MiB) Downloaded 245 times
spindump_mds.zip
(3.23 MiB) Downloaded 239 times
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby lundman » Wed Apr 05, 2023 2:11 am

You can just run "sudo spindump" - don't have to aim it a process (unless you want to).

Code: Select all
                                     *338  zfs_vfs_vget + 1585 (zfs + 1343921) [0xffffff7f84db91b1]
                                       *327  zap_value_search + 143 (zfs + 988255) [0xffffff7f84d6245f]
                                         *228  zap_cursor_retrieve + 395 (zfs + 1014683) [0xffffff7f84d68b9b]


This is heavy - but not dead/crashed. It is stat()ing IDs and asking for filenames. This is quite slow, we should consider improving this.

I did not see any other issues.
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Spotlight processes high CPU usage on scanning zfs datas

Postby sir_brickalot » Wed Apr 05, 2023 2:29 am

Okay so spindump doesn't see any problem. Still I can't use Spotlight on hfs enabled zfs containers. CPU process goes crazy and mds_worker crashes.

One more thing i could think of:
Permission is set to {user}:admin (actually I don't remember why. could that be a problem?
Code: Select all
sudo chown -R $(whoami):admin /Volumes/tank/


Any other idea why I can't use spotlight indexing but others can, or how I could futher debug this?
sir_brickalot
 
Posts: 23
Joined: Tue Apr 11, 2017 11:13 am

Next

Return to General Help

Who is online

Users browsing this forum: No registered users and 17 guests