FreeBSD Bugzilla – Attachment 188780 Details for
Bug 224080
ZFS: "arc_dnlc_evicts_thr" + "arc_reclaim_thread" - high CPU load during poudriere build...
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix
arcfix.diff (text/plain), 3.74 KB, created by
Jeff Roberson
on 2017-12-13 00:31:22 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jeff Roberson
Created:
2017-12-13 00:31:22 UTC
Size:
3.74 KB
patch
obsolete
>Index: vm/uma.h >=================================================================== >--- vm/uma.h (revision 326815) >+++ vm/uma.h (working copy) >@@ -698,4 +698,12 @@ struct uma_percpu_stat { > void uma_reclaim_wakeup(void); > void uma_reclaim_worker(void *); > >+unsigned long uma_limit(void); >+ >+/* Return the amount of memory managed by UMA. */ >+unsigned long uma_size(void); >+ >+/* Return the amount of memory remaining. May be negative. */ >+long uma_avail(void); >+ > #endif /* _VM_UMA_H_ */ >Index: vm/uma_core.c >=================================================================== >--- vm/uma_core.c (revision 326815) >+++ vm/uma_core.c (working copy) >@@ -3265,9 +3265,16 @@ unsigned long > uma_size(void) > { > >- return uma_kmem_total; >+ return (uma_kmem_total); > } > >+long >+uma_avail(void) >+{ >+ >+ return (uma_kmem_limit - uma_kmem_total); >+} >+ > void > uma_print_stats(void) > { >Index: vm/uma_int.h >=================================================================== >--- vm/uma_int.h (revision 326815) >+++ vm/uma_int.h (working copy) >@@ -428,10 +428,6 @@ void uma_small_free(void *mem, vm_size_t size, uin > > /* Set a global soft limit on UMA managed memory. */ > void uma_set_limit(unsigned long limit); >-unsigned long uma_limit(void); >- >-/* Return the amount of memory managed by UMA. */ >-unsigned long uma_size(void); > #endif /* _KERNEL */ > > #endif /* VM_UMA_INT_H */ >Index: cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >=================================================================== >--- cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (revision 326815) >+++ cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (working copy) >@@ -4290,6 +4290,7 @@ arc_available_memory(void) > } > > #endif /* illumos */ >+#ifdef __FreeBSD__ > #if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) > /* > * If we're on an i386 platform, it's possible that we'll exhaust the >@@ -4302,16 +4303,14 @@ arc_available_memory(void) > * heap is allocated. (Or, in the calculation, if less than 1/4th is > * free) > */ >- n = (int64_t)vmem_size(heap_arena, VMEM_FREE) - >- (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) >> 2); >+ n = uma_avail() - (long)(uma_limit() / 4); > if (n < lowest) { > lowest = n; > r = FMR_HEAP_ARENA; > } >+#endif > #define zio_arena NULL >-#else >-#define zio_arena heap_arena >-#endif >+#endif /* __FreeBSD__ */ > > /* > * If zio data pages are being allocated out of a separate heap segment, >@@ -4335,6 +4334,8 @@ arc_available_memory(void) > * Above limits know nothing about real level of KVA fragmentation. > * Start aggressive reclamation if too little sequential KVA left. > */ >+#ifndef __FreeBSD__ >+ /* FreeBSD will reclaim via a uma or vmem lowmem callback. */ > if (lowest > 0) { > n = (vmem_size(heap_arena, VMEM_MAXFREE) < SPA_MAXBLOCKSIZE) ? > -((int64_t)vmem_size(heap_arena, VMEM_ALLOC) >> 4) : >@@ -4344,6 +4345,7 @@ arc_available_memory(void) > r = FMR_ZIO_FRAG; > } > } >+#endif > > #else /* _KERNEL */ > /* Every 100 calls, free a small amount */ >@@ -6110,8 +6112,7 @@ arc_memory_throttle(uint64_t reserve, uint64_t txg > static uint64_t last_txg = 0; > > #if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) >- available_memory = >- MIN(available_memory, ptob(vmem_size(heap_arena, VMEM_FREE))); >+ available_memory = MIN(available_memory, uma_avail); > #endif > > if (freemem > (uint64_t)physmem * arc_lotsfree_percent / 100) >@@ -6492,9 +6493,13 @@ arc_init(void) > * Metadata is stored in the kernel's heap. Don't let us > * use more than half the heap for the ARC. > */ >+#ifdef __FreeBSD__ >+ arc_meta_limit = MIN(arc_meta_limit, uma_limit() / 2); >+#else > arc_meta_limit = MIN(arc_meta_limit, > vmem_size(heap_arena, VMEM_ALLOC | VMEM_FREE) / 2); > #endif >+#endif > > /* Allow the tunable to override if it is reasonable */ > if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 224080
: 188780