summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-08-24 17:48:22 +0000
committeravg <avg@FreeBSD.org>2010-08-24 17:48:22 +0000
commite53e8421943f9039b5292b87288a893fa083cd4b (patch)
treef66e672d0c150dea368b8127f0450444cec347bc
parent8bd4a7f02f572060c4c70c3a32f43f357583c697 (diff)
downloadFreeBSD-src-e53e8421943f9039b5292b87288a893fa083cd4b.zip
FreeBSD-src-e53e8421943f9039b5292b87288a893fa083cd4b.tar.gz
zfs arc_reclaim_thread: no need to call arc_reclaim_needed when
resetting needfree needfree is checked at the very start of arc_reclaim_needed. This change makes code easier to follow and maintain in face of potential changed in arc_reclaim_needed. Also, put the whole sub-block under _KERNEL because needfree can be set only in kernel code. To do: rename needfree to something else to aovid confusion with OpenSolaris global variable of the same name which is used in the same code, but has different meaning (page deficit). Note: I have an impression that locking around accesses to this variable as well as mutual notifications between arc_reclaim_thread and arc_lowmem are not proper. MFC after: 1 week
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 1666e41..32c079a 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -2317,12 +2317,12 @@ arc_reclaim_thread(void *dummy __unused)
if (arc_eviction_list != NULL)
arc_do_user_evicts();
- if (arc_reclaim_needed()) {
- needfree = 0;
#ifdef _KERNEL
+ if (needfree) {
+ needfree = 0;
wakeup(&needfree);
-#endif
}
+#endif
/* block until needed, or one second, whichever is shorter */
CALLB_CPR_SAFE_BEGIN(&cpr);
OpenPOWER on IntegriCloud