aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-10-01 18:34:41 -0400
committerBrian Behlendorf <[email protected]>2014-10-17 15:11:51 -0700
commit8bbbe46f8680389888d6111f8d81429dcc5defac (patch)
tree5c4aaeafb2ef237e884021082fac39bb373f2dcf /config
parente1310afae3bdb17628b40c35561f2daedfaf4062 (diff)
Remove global memory variables
Platforms such as Illumos and FreeBSD have historically provided global variables which summerize the memory state of a system. Linux on the otherhand doesn't expose any of this information to kernel modules and uses entirely different mechanisms for memory management. In order to simplify the original ZFS port to Linux these global variables were emulated by the SPL for the benefit of ZFS. As ZoL has matured over the years it has moved steadily away from these interfaces and now no longer depends on them at all. Therefore, this patch completely removes the global variables availrmem, minfree, desfree, lotsfree, needfree, swapfs_minfree, and swapfs_reserve. This greatly simplifies the memory management code and eliminates a common area of confusion. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'config')
-rw-r--r--config/spl-build.m4321
1 files changed, 0 insertions, 321 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index 4f84c1e1f..8a7486c55 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -29,16 +29,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_MUTEX_OWNER
SPL_AC_MUTEX_OWNER_TASK_STRUCT
SPL_AC_KALLSYMS_LOOKUP_NAME
- SPL_AC_PGDAT_HELPERS
- SPL_AC_FIRST_ONLINE_PGDAT
- SPL_AC_NEXT_ONLINE_PGDAT
- SPL_AC_NEXT_ZONE
- SPL_AC_PGDAT_LIST
- SPL_AC_GLOBAL_PAGE_STATE
- SPL_AC_ZONE_STAT_ITEM_FREE
- SPL_AC_ZONE_STAT_ITEM_INACTIVE
- SPL_AC_ZONE_STAT_ITEM_ACTIVE
- SPL_AC_GET_ZONE_COUNTS
SPL_AC_USER_PATH_DIR
SPL_AC_SET_FS_PWD
SPL_AC_SET_FS_PWD_WITH_CONST
@@ -1007,317 +997,6 @@ AC_DEFUN([SPL_AC_PDE_DATA], [
])
dnl #
-dnl # 2.6.17 API change
-dnl # The helper functions first_online_pgdat(), next_online_pgdat(), and
-dnl # next_zone() are introduced to simplify for_each_zone(). These symbols
-dnl # were exported in 2.6.17 for use by modules which was consistent with
-dnl # the previous implementation of for_each_zone(). From 2.6.18 - 2.6.19
-dnl # the symbols were exported as 'unused', and by 2.6.20 they exports
-dnl # were dropped entirely leaving modules no way to directly iterate over
-dnl # the zone list. Because we need access to the zone helpers we check
-dnl # if the kernel contains the old or new implementation. Then we check
-dnl # to see if the symbols we need for each version are available. If they
-dnl # are not, dynamically aquire the addresses with kallsyms_lookup_name().
-dnl #
-AC_DEFUN([SPL_AC_PGDAT_HELPERS], [
- AC_MSG_CHECKING([whether symbol *_pgdat exist])
- grep -q -E 'first_online_pgdat' $LINUX/include/linux/mmzone.h 2>/dev/null
- rc=$?
- if test $rc -eq 0; then
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_PGDAT_HELPERS, 1, [pgdat helpers are available])
- else
- AC_MSG_RESULT([no])
- fi
-])
-
-dnl #
-dnl # Proposed API change,
-dnl # This symbol is not available in stock kernels. You may build a
-dnl # custom kernel with the *-spl-export-symbols.patch which will export
-dnl # these symbols for use. If your already rolling a custom kernel for
-dnl # your environment this is recommended.
-dnl #
-AC_DEFUN([SPL_AC_FIRST_ONLINE_PGDAT],
- [AC_MSG_CHECKING([whether first_online_pgdat() is available])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/mmzone.h>
- ], [
- first_online_pgdat();
- ], [first_online_pgdat], [], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_FIRST_ONLINE_PGDAT, 1,
- [first_online_pgdat() is available])
- ], [
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # Proposed API change,
-dnl # This symbol is not available in stock kernels. You may build a
-dnl # custom kernel with the *-spl-export-symbols.patch which will export
-dnl # these symbols for use. If your already rolling a custom kernel for
-dnl # your environment this is recommended.
-dnl #
-AC_DEFUN([SPL_AC_NEXT_ONLINE_PGDAT],
- [AC_MSG_CHECKING([whether next_online_pgdat() is available])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/mmzone.h>
- ], [
- next_online_pgdat(NULL);
- ], [next_online_pgdat], [], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_NEXT_ONLINE_PGDAT, 1,
- [next_online_pgdat() is available])
- ], [
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # Proposed API change,
-dnl # This symbol is not available in stock kernels. You may build a
-dnl # custom kernel with the *-spl-export-symbols.patch which will export
-dnl # these symbols for use. If your already rolling a custom kernel for
-dnl # your environment this is recommended.
-dnl #
-AC_DEFUN([SPL_AC_NEXT_ZONE],
- [AC_MSG_CHECKING([whether next_zone() is available])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/mmzone.h>
- ], [
- next_zone(NULL);
- ], [next_zone], [], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_NEXT_ZONE, 1, [next_zone() is available])
- ], [
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # 2.6.17 API change,
-dnl # See SPL_AC_PGDAT_HELPERS for details.
-dnl #
-AC_DEFUN([SPL_AC_PGDAT_LIST],
- [AC_MSG_CHECKING([whether pgdat_list is available])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/topology.h>
- pg_data_t *tmp = pgdat_list;
- ], [], [pgdat_list], [], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PGDAT_LIST, 1, [pgdat_list is available])
- ], [
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # 2.6.18 API change,
-dnl # First introduced global_page_state() support as an inline.
-dnl #
-AC_DEFUN([SPL_AC_GLOBAL_PAGE_STATE], [
- AC_MSG_CHECKING([whether global_page_state() is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- unsigned long state __attribute__ ((unused));
- state = global_page_state(0);
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GLOBAL_PAGE_STATE, 1,
- [global_page_state() is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # 2.6.21 API change (plus subsequent naming convention changes),
-dnl # Public global zone stats now include a free page count. However
-dnl # the enumerated names of the counters have changed since this API
-dnl # was introduced. We need to deduce the corrent name to use. This
-dnl # replaces the priviate get_zone_counts() interface.
-dnl #
-dnl # NR_FREE_PAGES was available from 2.6.21 to current kernels, which
-dnl # is 2.6.30 as of when this was written.
-dnl #
-AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_FREE], [
- AC_MSG_CHECKING([whether page state NR_FREE_PAGES is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_FREE_PAGES;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_FREE_PAGES, 1,
- [Page state NR_FREE_PAGES is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # 2.6.21 API change (plus subsequent naming convention changes),
-dnl # Public global zone stats now include an inactive page count. However
-dnl # the enumerated names of the counters have changed since this API
-dnl # was introduced. We need to deduce the corrent name to use. This
-dnl # replaces the priviate get_zone_counts() interface.
-dnl #
-dnl # NR_INACTIVE was available from 2.6.21 to 2.6.27 and included both
-dnl # anonymous and file inactive pages. As of 2.6.28 it was split in
-dnl # to NR_INACTIVE_ANON and NR_INACTIVE_FILE.
-dnl #
-AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_INACTIVE], [
- AC_MSG_CHECKING([whether page state NR_INACTIVE is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_INACTIVE;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE, 1,
- [Page state NR_INACTIVE is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- AC_MSG_CHECKING([whether page state NR_INACTIVE_ANON is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_INACTIVE_ANON;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_ANON, 1,
- [Page state NR_INACTIVE_ANON is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- AC_MSG_CHECKING([whether page state NR_INACTIVE_FILE is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_INACTIVE_FILE;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_FILE, 1,
- [Page state NR_INACTIVE_FILE is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # 2.6.21 API change (plus subsequent naming convention changes),
-dnl # Public global zone stats now include an active page count. However
-dnl # the enumerated names of the counters have changed since this API
-dnl # was introduced. We need to deduce the corrent name to use. This
-dnl # replaces the priviate get_zone_counts() interface.
-dnl #
-dnl # NR_ACTIVE was available from 2.6.21 to 2.6.27 and included both
-dnl # anonymous and file active pages. As of 2.6.28 it was split in
-dnl # to NR_ACTIVE_ANON and NR_ACTIVE_FILE.
-dnl #
-AC_DEFUN([SPL_AC_ZONE_STAT_ITEM_ACTIVE], [
- AC_MSG_CHECKING([whether page state NR_ACTIVE is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_ACTIVE;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE, 1,
- [Page state NR_ACTIVE is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- AC_MSG_CHECKING([whether page state NR_ACTIVE_ANON is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_ACTIVE_ANON;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_ANON, 1,
- [Page state NR_ACTIVE_ANON is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-
- AC_MSG_CHECKING([whether page state NR_ACTIVE_FILE is available])
- SPL_LINUX_TRY_COMPILE([
- #include <linux/mm.h>
- ],[
- enum zone_stat_item zsi __attribute__ ((unused));
- zsi = NR_ACTIVE_FILE;
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_FILE, 1,
- [Page state NR_ACTIVE_FILE is available])
- ],[
- AC_MSG_RESULT(no)
- ])
-])
-
-dnl #
-dnl # Proposed API change for legacy kernels.
-dnl # This symbol is not available in older kernels. For kernels post
-dnl # 2.6.21 the global_page_state() API is used to get free/inactive/active
-dnl # page state information. This symbol is only used in legacy kernels
-dnl # any only as a last resort.
-dnl
-AC_DEFUN([SPL_AC_GET_ZONE_COUNTS], [
- AC_MSG_CHECKING([whether symbol get_zone_counts is needed])
- SPL_LINUX_TRY_COMPILE([
- ],[
- #if !defined(HAVE_ZONE_STAT_ITEM_NR_FREE_PAGES)
- #error "global_page_state needs NR_FREE_PAGES"
- #endif
-
- #if !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE) && \
- !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_ANON) && \
- !defined(HAVE_ZONE_STAT_ITEM_NR_ACTIVE_FILE)
- #error "global_page_state needs NR_ACTIVE*"
- #endif
-
- #if !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE) && \
- !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_ANON) && \
- !defined(HAVE_ZONE_STAT_ITEM_NR_INACTIVE_FILE)
- #error "global_page_state needs NR_INACTIVE*"
- #endif
- ],[
- AC_MSG_RESULT(no)
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(NEED_GET_ZONE_COUNTS, 1,
- [get_zone_counts() is needed])
-
- AC_MSG_CHECKING([whether get_zone_counts() is available])
- SPL_LINUX_TRY_COMPILE_SYMBOL([
- #include <linux/mmzone.h>
- ], [
- get_zone_counts(NULL, NULL, NULL);
- ], [get_zone_counts], [], [
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GET_ZONE_COUNTS, 1,
- [get_zone_counts() is available])
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
-
-dnl #
dnl # 2.6.27 API change,
dnl # The user_path_dir() replaces __user_walk()
dnl #