Whamcloud - gitweb
LU-13680 osd-ldiskfs: handle large allocations 78/49478/2
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 15 Jun 2020 19:46:07 +0000 (13:46 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Feb 2024 05:43:42 +0000 (05:43 +0000)
Use OBD_ALLOC_PAGE_ARRAY_LARGE() for oti_dio_pages, as this allocation
can be as large as 512KB due to large PTLRPC_MAX_BRW_PAGES.

Lustre-change: https://review.whamcloud.com/38943
Lustre-commit: bbb14d40a4be6a9172b80ed3208f81be2f1d1b66

Test-Parameters: trivial
Fixes: 72372486a5e9 ("LU-11347 osd: do not use pagecache for I/O")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0a0557e42bb5db5612c78e6d9b87f366a23ebbe5
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49478
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_io.c

index f8d9bea..8202f0b 100644 (file)
@@ -7502,8 +7502,8 @@ static void osd_key_fini(const struct lu_context *ctx,
                        if (info->oti_dio_pages[i])
                                __free_page(info->oti_dio_pages[i]);
                }
-               OBD_FREE(info->oti_dio_pages,
-                        sizeof(struct page *) * PTLRPC_MAX_BRW_PAGES);
+               OBD_FREE_LARGE(info->oti_dio_pages,
+                              sizeof(struct page *) * PTLRPC_MAX_BRW_PAGES);
        }
 
        if (info->oti_inode != NULL)
index 1bdc6e9..2d7fb17 100644 (file)
@@ -850,8 +850,9 @@ static int osd_bufs_get(const struct lu_env *env, struct dt_object *dt,
 
        if (!osd_use_page_cache(osd_obj2dev(obj))) {
                if (unlikely(!oti->oti_dio_pages)) {
-                       OBD_ALLOC(oti->oti_dio_pages,
-                                 sizeof(struct page *) * PTLRPC_MAX_BRW_PAGES);
+                       OBD_ALLOC_LARGE(oti->oti_dio_pages,
+                                       sizeof(struct page *) *
+                                       PTLRPC_MAX_BRW_PAGES);
                        if (!oti->oti_dio_pages)
                                return -ENOMEM;
                }