mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +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:
@@ -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