Compare commits
3 Commits
1df3a303f5
...
8dc3ae88b3
| Author | SHA1 | Date | |
|---|---|---|---|
|
8dc3ae88b3
|
|||
|
a177877ce3
|
|||
|
86cf624027
|
@@ -20,7 +20,14 @@ let
|
|||||||
arcMaxBytes = (totalRamBytes - totalHugepageBytes) * 60 / 100;
|
arcMaxBytes = (totalRamBytes - totalHugepageBytes) * 60 / 100;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
boot.zfs.package = pkgs.zfs_2_4;
|
# remove inline dbuf_evict_one call so the dedicated eviction thread
|
||||||
|
# handles cache pressure instead of stalling txg_sync on 6.14+.
|
||||||
|
# https://github.com/openzfs/zfs/issues/18426
|
||||||
|
boot.zfs.package = pkgs.zfs_2_4.overrideAttrs (old: {
|
||||||
|
patches = (old.patches or [ ]) ++ [
|
||||||
|
../patches/zfs/0001-remove-dbuf_evict_one-call.patch
|
||||||
|
];
|
||||||
|
});
|
||||||
boot.initrd.kernelModules = [ "zfs" ];
|
boot.initrd.kernelModules = [ "zfs" ];
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
|
|||||||
34
patches/zfs/0001-remove-dbuf_evict_one-call.patch
Normal file
34
patches/zfs/0001-remove-dbuf_evict_one-call.patch
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
--- a/module/zfs/dbuf.c 2026-04-24 14:20:12.565390796 -0400
|
||||||
|
+++ b/module/zfs/dbuf.c 2026-04-24 14:20:40.711198653 -0400
|
||||||
|
@@ -864,23 +864,16 @@
|
||||||
|
dbuf_evict_notify(uint64_t size)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
- * We check if we should evict without holding the dbuf_evict_lock,
|
||||||
|
- * because it's OK to occasionally make the wrong decision here,
|
||||||
|
- * and grabbing the lock results in massive lock contention.
|
||||||
|
+ * Wake the dedicated eviction thread when the cache
|
||||||
|
+ * exceeds target. Inline eviction from write-completion
|
||||||
|
+ * context is intentionally avoided: it adds a second
|
||||||
|
+ * multilist sublist lock to every write, and when
|
||||||
|
+ * kmem_cache_free is slow (__free_frozen_pages zone lock
|
||||||
|
+ * contention on 6.14+), the cascade stalls txg_sync.
|
||||||
|
+ * See openzfs#18426.
|
||||||
|
*/
|
||||||
|
- if (size > dbuf_cache_target_bytes()) {
|
||||||
|
- /*
|
||||||
|
- * Avoid calling dbuf_evict_one() from memory reclaim context
|
||||||
|
- * (e.g. Linux kswapd, FreeBSD pagedaemon) to prevent deadlocks.
|
||||||
|
- * Memory reclaim threads can get stuck waiting for the dbuf
|
||||||
|
- * hash lock.
|
||||||
|
- */
|
||||||
|
- if (size > dbuf_cache_hiwater_bytes() &&
|
||||||
|
- !current_is_reclaim_thread()) {
|
||||||
|
- dbuf_evict_one();
|
||||||
|
- }
|
||||||
|
+ if (size > dbuf_cache_target_bytes())
|
||||||
|
cv_signal(&dbuf_evict_cv);
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
Reference in New Issue
Block a user