b=18505
i=adilger
i=andrew
Limit number of locks based on low mem on 32-bit systems.
*/
/* XXX Liang: num_physpages... fix me */
#define num_physpages (64 * 1024)
*/
/* XXX Liang: num_physpages... fix me */
#define num_physpages (64 * 1024)
+#define CFS_NUM_CACHEPAGES num_physpages
#define CFS_DECL_MMSPACE
#define CFS_MMSPACE_OPEN do {} while(0)
#define CFS_DECL_MMSPACE
#define CFS_MMSPACE_OPEN do {} while(0)
#define libcfs_memory_pressure_set() do { current->flags |= PF_MEMALLOC; } while(0)
#define libcfs_memory_pressure_clr() do { current->flags &= ~PF_MEMALLOC; } while (0)
#define libcfs_memory_pressure_set() do { current->flags |= PF_MEMALLOC; } while(0)
#define libcfs_memory_pressure_clr() do { current->flags &= ~PF_MEMALLOC; } while (0)
+#if BITS_PER_LONG == 32
+/* limit to lowmem on 32-bit systems */
+#define CFS_NUM_CACHEPAGES min(num_physpages, 1UL << (30-CFS_PAGE_SHIFT) *3/4)
+#else
+#define CFS_NUM_CACHEPAGES num_physpages
+#endif
+
/*
* In Linux there is no way to determine whether current execution context is
* blockable.
/*
* In Linux there is no way to determine whether current execution context is
* blockable.
)
#define num_physpages (64 * 1024)
)
#define num_physpages (64 * 1024)
+#define CFS_NUM_CACHEPAGES num_physpages
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define vsnprintf _vsnprintf