> @@ -1508,7 +1509,15 @@ exi_cache_trim(struct exportinfo *exi)
>                * used for NFSAUTH_CACHE_TRIM seconds.
>                */
>               for (c = avl_first(tree); c != NULL; c = AVL_NEXT(tree, c)) {
> -                     rw_enter(&c->authc_lock, RW_WRITER);
> +                     /*
> +                      * We are being called by the kmem subsystem to reclaim
> +                      * memory so don't block if we can't get the lock.
> +                      */
> +                     if (rw_tryenter(&exi->exi_cache_lock, RW_WRITER) == 0) {
> +                             exi_cache_auth_reclaim_failed++;
> +                             return;

We opted to return because the assumption is that we're racing with the 
kmem_reaper and we want to optimize for memory reaping of the ZFS kmem caches 
since they will provide the biggest benefit. Have you seen instances where the 
exi_cache grows extremely large?

---
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/38/files#r45092196
_______________________________________________
developer mailing list
developer@open-zfs.org
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to