Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164256308
D12163.id32516.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12163.id32516.diff
View Options
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -4140,7 +4140,7 @@
(void) arc_flush_state(arc_mfu_ghost, guid, ARC_BUFC_METADATA, retry);
}
-void
+uint64_t
arc_shrink(int64_t to_free)
{
if (arc_c > arc_c_min) {
@@ -4167,8 +4167,9 @@
if (arc_size > arc_c) {
DTRACE_PROBE2(arc__shrink_adjust, uint64_t, arc_size,
uint64_t, arc_c);
- (void) arc_adjust();
+ return (arc_adjust());
}
+ return (0);
}
static long needfree = 0;
@@ -4485,7 +4486,14 @@
#ifdef _KERNEL
to_free = MAX(to_free, ptob(needfree));
#endif
- arc_shrink(to_free);
+ evicted = arc_shrink(to_free);
+ if (needfree) {
+ /*
+ * Decrement needfree to ensure that we
+ * won't free more memory than necessary.
+ */
+ needfree -= MIN(needfree, btoc(evicted));
+ }
}
} else if (free_memory < arc_c >> arc_no_grow_shift) {
arc_no_grow = B_TRUE;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 31, 4:01 AM (50 m, 38 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35765888
Default Alt Text
D12163.id32516.diff (1 KB)
Attached To
Mode
D12163: [RFC]: decrement needfree by the amount of evicted cache
Attached
Detach File
Event Timeline
Log In to Comment