mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
Linux 6.4 compat: reclaimed_slab renamed to reclaimed
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Youzhong Yang <yyang@mathworks.com> Closes #14891
This commit is contained in:
parent
ad0a554614
commit
f8447cf22e
26
config/kernel-reclaim_state.m4
Normal file
26
config/kernel-reclaim_state.m4
Normal file
@ -0,0 +1,26 @@
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RECLAIMED], [
|
||||
dnl #
|
||||
dnl # 6.4 API change
|
||||
dnl # The reclaimed_slab of struct reclaim_state
|
||||
dnl # is renamed to reclaimed
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([reclaim_state_reclaimed], [
|
||||
#include <linux/swap.h>
|
||||
static const struct reclaim_state
|
||||
rs __attribute__ ((unused)) = {
|
||||
.reclaimed = 100,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_RECLAIMED], [
|
||||
AC_MSG_CHECKING([whether struct reclaim_state has reclaimed field])
|
||||
ZFS_LINUX_TEST_RESULT([reclaim_state_reclaimed], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RECLAIM_STATE_RECLAIMED, 1,
|
||||
[struct reclaim_state has reclaimed])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
@ -153,6 +153,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_IATTR_VFSID
|
||||
ZFS_AC_KERNEL_SRC_FILEMAP
|
||||
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_SRC_RECLAIMED
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
|
||||
@ -285,6 +286,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_IATTR_VFSID
|
||||
ZFS_AC_KERNEL_FILEMAP
|
||||
ZFS_AC_KERNEL_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_RECLAIMED
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
ZFS_AC_KERNEL_CPU_HAS_FEATURE
|
||||
|
@ -182,8 +182,11 @@ kv_free(spl_kmem_cache_t *skc, void *ptr, int size)
|
||||
* of that infrastructure we are responsible for incrementing it.
|
||||
*/
|
||||
if (current->reclaim_state)
|
||||
#ifdef HAVE_RECLAIM_STATE_RECLAIMED
|
||||
current->reclaim_state->reclaimed += size >> PAGE_SHIFT;
|
||||
#else
|
||||
current->reclaim_state->reclaimed_slab += size >> PAGE_SHIFT;
|
||||
|
||||
#endif
|
||||
vfree(ptr);
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,11 @@ arc_shrinker_scan(struct shrinker *shrink, struct shrink_control *sc)
|
||||
arc_reduce_target_size(ptob(sc->nr_to_scan));
|
||||
arc_wait_for_eviction(ptob(sc->nr_to_scan), B_FALSE);
|
||||
if (current->reclaim_state != NULL)
|
||||
#ifdef HAVE_RECLAIM_STATE_RECLAIMED
|
||||
current->reclaim_state->reclaimed += sc->nr_to_scan;
|
||||
#else
|
||||
current->reclaim_state->reclaimed_slab += sc->nr_to_scan;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are experiencing memory pressure which the arc_evict_zthr was
|
||||
|
Loading…
Reference in New Issue
Block a user