summaryrefslogtreecommitdiffstats
path: root/module/spl
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-03-17 12:16:31 -0700
committerBrian Behlendorf <[email protected]>2009-03-17 12:16:31 -0700
commite11d6c5f50ff1cb9a75f5c6a6895846f73564422 (patch)
treeddcef034ef231cbc219ce17db7a68be8100607a1 /module/spl
parent7257ec41856cf54d47a85f786f06e5a3c330acfc (diff)
FC10/i686 Compatibility Update (2.6.27.19-170.2.35.fc10.i686)
In the interests of portability I have added a FC10/i686 box to my list of development platforms. The hope is this will allow me to keep current with upstream kernel API changes, and at the same time ensure I don't accidentally break x86 support. This patch resolves all remaining issues observed under that environment. 1) SPL_AC_ZONE_STAT_ITEM_FIA autoconf check added. As of 2.6.21 the kernel added a clean API for modules to get the global count for free, inactive, and active pages. The SPL attempts to detect if this API is available and directly map spl_global_page_state() to global_page_state(). If the full API is not available then spl_global_page_state() is implemented as a thin layer to get these values via get_zone_counts() if that symbol is available. 2) New kmem:vmem_size regression test added to validate correct vmem_size() functionality. The test case acquires the current global vmem state, allocates from the vmem region, then verifies the allocation is correctly reflected in the vmem_size() stats. 3) Change splat_kmem_cache_thread_test() to always use KMC_KMEM based memory. On x86 systems with limited virtual address space failures resulted due to exhaustig the address space. The tests really need to problem exhausting all memory on the system thus we need to use the physical address space. 4) Change kmem:slab_lock to cap it's memory usage at availrmem instead of using the native linux nr_free_pages(). This provides additional test coverage of the SPL Linux VM integration. 5) Change kmem:slab_overcommit to perform allocation of 256K instead of 1M. On x86 based systems it is not possible to create a kmem backed slab with entires of that size. To compensate for this the number of allocations performed in increased by 4x. 6) Additional autoconf documentation for proposed upstream API changes to make additional symbols available to modules. 7) Console error messages added when spl_kallsyms_lookup_name() fails to locate an expected symbol. This causes the module to fail to load and we need to know exactly which symbol was not available.
Diffstat (limited to 'module/spl')
-rw-r--r--module/spl/spl-kmem.c65
1 files changed, 52 insertions, 13 deletions
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index 944300bb4..6723dcd08 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -99,22 +99,47 @@ next_zone_t next_zone_fn = NULL;
EXPORT_SYMBOL(next_zone_fn);
#endif /* HAVE_NEXT_ZONE */
-#ifndef HAVE_GET_ZONE_COUNTS
+#ifndef HAVE_ZONE_STAT_ITEM_FIA
+# ifndef HAVE_GET_ZONE_COUNTS
get_zone_counts_t get_zone_counts_fn = NULL;
EXPORT_SYMBOL(get_zone_counts_fn);
-#endif /* HAVE_GET_ZONE_COUNTS */
-pgcnt_t
-spl_kmem_availrmem(void)
+unsigned long
+spl_global_page_state(int item)
{
unsigned long active;
unsigned long inactive;
unsigned long free;
- get_zone_counts(&active, &inactive, &free);
+ if (item == NR_FREE_PAGES) {
+ get_zone_counts(&active, &inactive, &free);
+ return free;
+ }
+
+ if (item == NR_INACTIVE) {
+ get_zone_counts(&active, &inactive, &free);
+ return inactive;
+ }
+
+ if (item == NR_ACTIVE) {
+ get_zone_counts(&active, &inactive, &free);
+ return active;
+ }
+
+ return global_page_state((enum zone_stat_item)item);
+}
+EXPORT_SYMBOL(spl_global_page_state);
+# else
+# error "HAVE_ZONE_STAT_ITEM_FIA and HAVE_GET_ZONE_COUNTS unavailable"
+# endif /* HAVE_GET_ZONE_COUNTS */
+#endif /* HAVE_ZONE_STAT_ITEM_FIA */
+pgcnt_t
+spl_kmem_availrmem(void)
+{
/* The amount of easily available memory */
- return free + inactive;
+ return (spl_global_page_state(NR_FREE_PAGES) +
+ spl_global_page_state(NR_INACTIVE));
}
EXPORT_SYMBOL(spl_kmem_availrmem);
@@ -1773,37 +1798,51 @@ spl_kmem_init_kallsyms_lookup(void)
#ifndef HAVE_GET_VMALLOC_INFO
get_vmalloc_info_fn = (get_vmalloc_info_t)
spl_kallsyms_lookup_name("get_vmalloc_info");
- if (!get_vmalloc_info_fn)
+ if (!get_vmalloc_info_fn) {
+ printk(KERN_ERR "Error: Unknown symbol get_vmalloc_info\n");
return -EFAULT;
+ }
#endif /* HAVE_GET_VMALLOC_INFO */
#ifndef HAVE_FIRST_ONLINE_PGDAT
first_online_pgdat_fn = (first_online_pgdat_t)
spl_kallsyms_lookup_name("first_online_pgdat");
- if (!first_online_pgdat_fn)
+ if (!first_online_pgdat_fn) {
+ printk(KERN_ERR "Error: Unknown symbol first_online_pgdat\n");
return -EFAULT;
+ }
#endif /* HAVE_FIRST_ONLINE_PGDAT */
#ifndef HAVE_NEXT_ONLINE_PGDAT
next_online_pgdat_fn = (next_online_pgdat_t)
spl_kallsyms_lookup_name("next_online_pgdat");
- if (!next_online_pgdat_fn)
+ if (!next_online_pgdat_fn) {
+ printk(KERN_ERR "Error: Unknown symbol next_online_pgdat\n");
return -EFAULT;
+ }
#endif /* HAVE_NEXT_ONLINE_PGDAT */
#ifndef HAVE_NEXT_ZONE
next_zone_fn = (next_zone_t)
spl_kallsyms_lookup_name("next_zone");
- if (!next_zone_fn)
+ if (!next_zone_fn) {
+ printk(KERN_ERR "Error: Unknown symbol next_zone\n");
return -EFAULT;
+ }
#endif /* HAVE_NEXT_ZONE */
-#ifndef HAVE_GET_ZONE_COUNTS
+#ifndef HAVE_ZONE_STAT_ITEM_FIA
+# ifndef HAVE_GET_ZONE_COUNTS
get_zone_counts_fn = (get_zone_counts_t)
spl_kallsyms_lookup_name("get_zone_counts");
- if (!get_zone_counts_fn)
+ if (!get_zone_counts_fn) {
+ printk(KERN_ERR "Error: Unknown symbol get_zone_counts\n");
return -EFAULT;
-#endif /* HAVE_GET_ZONE_COUNTS */
+ }
+# else
+# error "HAVE_ZONE_STAT_ITEM_FIA and HAVE_GET_ZONE_COUNTS unavailable"
+# endif /* HAVE_GET_ZONE_COUNTS */
+#endif /* HAVE_ZONE_STAT_ITEM_FIA */
/*
* It is now safe to initialize the global tunings which rely on