Whamcloud - gitweb
LU-5349 include: use __vmalloc() to avoid __GFP_FS default
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-mem.c
index 8cdf07d..0887a31 100644 (file)
@@ -53,6 +53,14 @@ EXPORT_SYMBOL(cfs_cpt_malloc);
 void *
 cfs_cpt_vzalloc(struct cfs_cpt_table *cptab, int cpt, size_t nr_bytes)
 {
+       /* vzalloc_node() sets __GFP_FS by default but no current Kernel
+        * exported entry-point allows for both a NUMA node specification
+        * and a custom allocation flags mask. This may be an issue since
+        * __GFP_FS usage can cause some deadlock situations in our code,
+        * like when memory reclaim started, within the same context of a
+        * thread doing FS operations, that can also attempt conflicting FS
+        * operations, ...
+        */
        return vzalloc_node(nr_bytes, cfs_cpt_spread_node(cptab, cpt));
 }
 EXPORT_SYMBOL(cfs_cpt_vzalloc);