Whamcloud - gitweb
LU-371 call OBD_ALLOC_LARGE to allocate epp_pools
authorLiang Zhen <liang@whamcloud.com>
Sun, 29 May 2011 04:04:22 +0000 (12:04 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 27 Jun 2011 17:18:58 +0000 (10:18 -0700)
enc_pools_alloc is using OBD_ALLOC to allocate memory, which can fail on
some systems and return ENOMEM, so we should replace it with
OBD_ALLOC_LARGE.

Change-Id: I90cfe8c03e6db013818553f34463ecd0edf566ab
Signed-off-by: Liang Zhen <liang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/869
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/sec_bulk.c

index 6fea63f..1fc74d0 100644 (file)
@@ -691,13 +691,9 @@ EXPORT_SYMBOL(sptlrpc_enc_pool_del_user);
 static inline void enc_pools_alloc(void)
 {
         LASSERT(page_pools.epp_max_pools);
 static inline void enc_pools_alloc(void)
 {
         LASSERT(page_pools.epp_max_pools);
-        /*
-         * on system with huge memory but small page size, this might lead to
-         * high-order allocation. but it's not common, and we suppose memory
-         * be not too much fragmented at module loading time.
-         */
-        OBD_ALLOC(page_pools.epp_pools,
-                  page_pools.epp_max_pools * sizeof(*page_pools.epp_pools));
+        OBD_ALLOC_LARGE(page_pools.epp_pools,
+                        page_pools.epp_max_pools *
+                        sizeof(*page_pools.epp_pools));
 }
 
 static inline void enc_pools_free(void)
 }
 
 static inline void enc_pools_free(void)
@@ -705,8 +701,9 @@ static inline void enc_pools_free(void)
         LASSERT(page_pools.epp_max_pools);
         LASSERT(page_pools.epp_pools);
 
         LASSERT(page_pools.epp_max_pools);
         LASSERT(page_pools.epp_pools);
 
-        OBD_FREE(page_pools.epp_pools,
-                 page_pools.epp_max_pools * sizeof(*page_pools.epp_pools));
+        OBD_FREE_LARGE(page_pools.epp_pools,
+                       page_pools.epp_max_pools *
+                       sizeof(*page_pools.epp_pools));
 }
 
 int sptlrpc_enc_pool_init(void)
 }
 
 int sptlrpc_enc_pool_init(void)