Prevent zevent list from consuming all of kernel memory

There are a couple changes included here. The first is to introduce 
a cap on the size the ZED will grow the zevent list to. One million 
entries is more than enough for most use cases, and if you are 
overflowing that value, the problem needs to be addressed another 
way. The value is also tunable, for those who want the limit to be 
higher or lower. 
 
The other change is to add a kernel module parameter that allows 
snapshot creation/deletion to be exempted from the history logging; 
for most workloads, having these things logged is valuable, but for 
some workloads it produces large quantities of log spam and isn't 
especially helpful.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Issue #13374 
Closes #13753
This commit is contained in:
Paul Dagnelie
2022-08-22 12:36:22 -07:00
committed by GitHub
parent d22dd77c4d
commit 17e212652d
6 changed files with 60 additions and 9 deletions
+12
View File
@@ -27,6 +27,7 @@
.Op Fl P Ar path
.Op Fl s Ar statefile
.Op Fl j Ar jobs
.Op Fl b Ar buflen
.
.Sh DESCRIPTION
The
@@ -96,6 +97,17 @@ ZEDLETs to run concurrently,
delaying execution of new ones until they finish.
Defaults to
.Sy 16 .
.It Fl b Ar buflen
Cap kernel event buffer growth to
.Ar buflen
entries.
This buffer is grown when the daemon misses an event, but results in
unreclaimable memory use in the kernel.
A value of
.Sy 0
removes the cap.
Defaults to
.Sy 1048576 .
.El
.Sh ZEVENTS
A zevent is comprised of a list of nvpairs (name/value pairs).