Whamcloud - gitweb
LU-15168 osd: use large allocation for idc cache 82/45382/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Wed, 27 Oct 2021 05:48:03 +0000 (08:48 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:27:02 +0000 (06:27 +0000)
as in some cases (e.g. ofd precreate) the cache can grow to dozens
of kilobytes (sizeof(struct idc_map_cache)=40 * 1024).

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Id9e0996a7a1d07065f4a50c1d5be5051e756559a
Reviewed-on: https://review.whamcloud.com/45382
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 34f8465..756a0fc 100644 (file)
@@ -212,13 +212,13 @@ osd_idc_add(const struct lu_env *env, struct osd_device *osd,
                i = oti->oti_ins_cache_size * 2;
                if (i == 0)
                        i = OSD_INS_CACHE_SIZE;
                i = oti->oti_ins_cache_size * 2;
                if (i == 0)
                        i = OSD_INS_CACHE_SIZE;
-               OBD_ALLOC_PTR_ARRAY(idc, i);
+               OBD_ALLOC_PTR_ARRAY_LARGE(idc, i);
                if (idc == NULL)
                        return ERR_PTR(-ENOMEM);
                if (oti->oti_ins_cache != NULL) {
                        memcpy(idc, oti->oti_ins_cache,
                               oti->oti_ins_cache_used * sizeof(*idc));
                if (idc == NULL)
                        return ERR_PTR(-ENOMEM);
                if (oti->oti_ins_cache != NULL) {
                        memcpy(idc, oti->oti_ins_cache,
                               oti->oti_ins_cache_used * sizeof(*idc));
-                       OBD_FREE_PTR_ARRAY(oti->oti_ins_cache,
+                       OBD_FREE_PTR_ARRAY_LARGE(oti->oti_ins_cache,
                                           oti->oti_ins_cache_used);
                }
                oti->oti_ins_cache = idc;
                                           oti->oti_ins_cache_used);
                }
                oti->oti_ins_cache = idc;
@@ -7737,7 +7737,7 @@ static void osd_key_fini(const struct lu_context *ctx,
        lu_buf_free(&info->oti_big_buf);
        if (idc != NULL) {
                LASSERT(info->oti_ins_cache_size > 0);
        lu_buf_free(&info->oti_big_buf);
        if (idc != NULL) {
                LASSERT(info->oti_ins_cache_size > 0);
-               OBD_FREE_PTR_ARRAY(idc, info->oti_ins_cache_size);
+               OBD_FREE_PTR_ARRAY_LARGE(idc, info->oti_ins_cache_size);
                info->oti_ins_cache = NULL;
                info->oti_ins_cache_size = 0;
        }
                info->oti_ins_cache = NULL;
                info->oti_ins_cache_size = 0;
        }