ZFS ARC: restore illumos uses of 'needfree' that were removed in r325851

This is purely a cosmetic change to have a more complete copy of
ifdef-ed out illumos code.

MFC after:	1 week
This commit is contained in:
Andriy Gapon 2018-02-02 12:57:33 +00:00
parent 64282a1274
commit 6c1e03251e

View File

@ -4236,6 +4236,7 @@ arc_available_memory(void)
free_memory_reason_t r = FMR_UNKNOWN;
#ifdef _KERNEL
#ifdef __FreeBSD__
/*
* Cooperate with pagedaemon when it's time for it to scan
* and reclaim some pages.
@ -4246,7 +4247,15 @@ arc_available_memory(void)
r = FMR_LOTSFREE;
}
#ifdef illumos
#else
if (needfree > 0) {
n = PAGESIZE * (-needfree);
if (n < lowest) {
lowest = n;
r = FMR_NEEDFREE;
}
}
/*
* check that we're out of range of the pageout scanner. It starts to
* schedule paging if freemem is less than lotsfree and needfree.
@ -4289,7 +4298,7 @@ arc_available_memory(void)
r = FMR_PAGES_PP_MAXIMUM;
}
#endif /* illumos */
#endif /* __FreeBSD__ */
#if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC)
/*
* If we're on an i386 platform, it's possible that we'll exhaust the
@ -4482,6 +4491,11 @@ arc_reclaim_thread(void *dummy __unused)
int64_t to_free =
(arc_c >> arc_shrink_shift) - free_memory;
if (to_free > 0) {
#ifdef _KERNEL
#ifdef illumos
to_free = MAX(to_free, ptob(needfree));
#endif
#endif
arc_shrink(to_free);
}
} else if (free_memory < arc_c >> arc_no_grow_shift) {