mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Linux: Report reclaimable memory to kernel as such (#16385)
Linux provides SLAB_RECLAIM_ACCOUNT and __GFP_RECLAIMABLE flags to mark memory allocations that can be freed via shinker calls. It should allow kernel to tune and group such allocations for lower memory fragmentation and better reclamation under pressure. This patch marks as reclaimable most of ARC memory, directly evictable via ZFS shrinker, plus also dnode/znode/sa memory, indirectly evictable via kernel's superblock shrinker. Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Allan Jude <allan@klarasystems.com>
This commit is contained in:
committed by
Tony Hutter
parent
05d6f621a9
commit
ca95fa3531
@@ -49,6 +49,7 @@ MALLOC_DECLARE(M_SOLARIS);
|
||||
#define KM_NOSLEEP M_NOWAIT
|
||||
#define KM_NORMALPRI 0
|
||||
#define KMC_NODEBUG UMA_ZONE_NODUMP
|
||||
#define KMC_RECLAIMABLE 0x0
|
||||
|
||||
typedef struct vmem vmem_t;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef enum kmc_bit {
|
||||
KMC_BIT_TOTAL = 18, /* Proc handler helper bit */
|
||||
KMC_BIT_ALLOC = 19, /* Proc handler helper bit */
|
||||
KMC_BIT_MAX = 20, /* Proc handler helper bit */
|
||||
KMC_BIT_RECLAIMABLE = 21, /* Can be freed by shrinker */
|
||||
} kmc_bit_t;
|
||||
|
||||
/* kmem move callback return values */
|
||||
@@ -66,9 +67,7 @@ typedef enum kmem_cbrc {
|
||||
#define KMC_TOTAL (1 << KMC_BIT_TOTAL)
|
||||
#define KMC_ALLOC (1 << KMC_BIT_ALLOC)
|
||||
#define KMC_MAX (1 << KMC_BIT_MAX)
|
||||
|
||||
#define KMC_REAP_CHUNK INT_MAX
|
||||
#define KMC_DEFAULT_SEEKS 1
|
||||
#define KMC_RECLAIMABLE (1 << KMC_BIT_RECLAIMABLE)
|
||||
|
||||
extern struct list_head spl_kmem_cache_list;
|
||||
extern struct rw_semaphore spl_kmem_cache_sem;
|
||||
|
||||
Reference in New Issue
Block a user