Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Include other sources of freeable memory in the freemem calculation
Browse files Browse the repository at this point in the history
Prevents ARC collapse when non-ZFS filesystems, the block layer or other
memory consumers use a lot of reclaimable memory in the page cache.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes openzfs/zfs#3680
Closes #471
  • Loading branch information
dweeezil authored and behlendorf committed Aug 19, 2015
1 parent 8ac6ffe commit 851a549
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/sys/vmsystm.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@

#define membar_producer() smp_wmb()
#define physmem totalram_pages
#define freemem nr_free_pages()
#define freemem (nr_free_pages() + \
global_page_state(NR_INACTIVE_FILE) + \
global_page_state(NR_INACTIVE_ANON) + \
global_page_state(NR_SLAB_RECLAIMABLE))

#define xcopyin(from, to, size) copy_from_user(to, from, size)
#define xcopyout(from, to, size) copy_to_user(to, from, size)
Expand Down

0 comments on commit 851a549

Please sign in to comment.