diff --git a/share/man/man4/nvme.4 b/share/man/man4/nvme.4 index c82bef0a626..e0ea6c2dbe8 100644 --- a/share/man/man4/nvme.4 +++ b/share/man/man4/nvme.4 @@ -126,7 +126,7 @@ Buffer for capable devices, set the following tunable: hw.nvme.hmb_max .Ed .Pp -The default value is 1% of physical memory size per device. +The default value is 5% of physical memory size per device. .Pp The .Xr nvd 4 diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 7efb9ff38e8..155c65d8fdb 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -886,7 +886,7 @@ nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); min = (long long unsigned)ctrlr->cdata.hmmin * 4096; - if (max < min) + if (max == 0 || max < min) return; pref = MIN((long long unsigned)ctrlr->cdata.hmpre * 4096, max); minc = MAX(ctrlr->cdata.hmminds * 4096, PAGE_SIZE);