Whamcloud - gitweb
LU-17015 obdclass: set cache entry/acquire expiry at init 71/52271/3
authorSebastien Buisson <sbuisson@ddn.com>
Tue, 5 Sep 2023 09:08:16 +0000 (11:08 +0200)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Sep 2023 06:03:07 +0000 (06:03 +0000)
Give the ability to define values for cache entry expire and acquire
expire directly at upcall cache init.

Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iee0dea66943ab6747d85a378861ae98c29faa11a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52271
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/upcall_cache.h
lustre/mdt/mdt_handler.c
lustre/obdclass/upcall_cache.c

index 42e6b7f..6933862 100644 (file)
@@ -145,7 +145,9 @@ static inline void upcall_cache_flush_all(struct upcall_cache *cache)
 
 void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args);
 struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
-                                     int hashsz, struct upcall_cache_ops *ops);
+                                      int hashsz, time64_t entry_expire,
+                                      time64_t acquire_expire,
+                                      struct upcall_cache_ops *ops);
 void upcall_cache_cleanup(struct upcall_cache *cache);
 
 /** @} ucache */
index 2027012..293420f 100644 (file)
@@ -6338,6 +6338,8 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
        m->mdt_identity_cache = upcall_cache_init(mdt_obd_name(m),
                                                identity_upcall,
                                                UC_IDCACHE_HASH_SIZE,
+                                               1200, /* entry expire: 20 mn */
+                                               30, /* acquire expire: 30 s */
                                                &mdt_identity_upcall_cache_ops);
        if (IS_ERR(m->mdt_identity_cache)) {
                rc = PTR_ERR(m->mdt_identity_cache);
index 0a332c8..8c2eec4 100644 (file)
@@ -425,7 +425,9 @@ void upcall_cache_flush_one(struct upcall_cache *cache, __u64 key, void *args)
 EXPORT_SYMBOL(upcall_cache_flush_one);
 
 struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
-                                      int hashsz, struct upcall_cache_ops *ops)
+                                      int hashsz, time64_t entry_expire,
+                                      time64_t acquire_expire,
+                                      struct upcall_cache_ops *ops)
 {
        struct upcall_cache *cache;
        int i;
@@ -447,8 +449,8 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
        strlcpy(cache->uc_name, name, sizeof(cache->uc_name));
        /* upcall pathname proc tunable */
        strlcpy(cache->uc_upcall, upcall, sizeof(cache->uc_upcall));
-       cache->uc_entry_expire = 20 * 60;
-       cache->uc_acquire_expire = 30;
+       cache->uc_entry_expire = entry_expire;
+       cache->uc_acquire_expire = acquire_expire;
        cache->uc_ops = ops;
 
        RETURN(cache);