Skip to content

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 <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Closes openzfs#3680
Closes openzfs#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.