Page MenuHomeFreeBSD

nvme: change namei_request_zone into a malloc type
ClosedPublic

Authored by mjg on Nov 5 2020, 12:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 1 2024, 12:43 PM
Unknown Object (File)
Sep 27 2024, 5:10 AM
Unknown Object (File)
Sep 26 2024, 12:00 AM
Unknown Object (File)
Sep 23 2024, 1:32 AM
Unknown Object (File)
Sep 22 2024, 5:39 AM
Unknown Object (File)
Sep 18 2024, 4:23 AM
Unknown Object (File)
Sep 18 2024, 3:20 AM
Unknown Object (File)
Sep 17 2024, 12:57 PM
Subscribers

Details

Summary

Both the size (128 bytes) and ephemeral nature of allocations make it a great fit for malloc.

A dedicated zone unnecessarily avoids sharing buckets with 128-byte objects.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Nov 5 2020, 12:38 PM
mjg retitled this revision from nvme: namei_request_zone into a malloc type to nvme: change namei_request_zone into a malloc type.Nov 5 2020, 5:59 PM

My only concern would be how this affects our ability to make sure we can always make progress in a resource shortage... But it's likely a wash.

If anything the patch should make things better especially in low memory conditions. Take a look at zone stats at your favorite box.

If you vmstat -z | grep 128 you should find the zone with some number of items allocated and quite a decent number of items free. Given transient allocations from nvme, it is very likely that zone would handle all of them without pulling more pages than it does now. At the same time sysctl vm.uma.nvme_request | grep pages will show you total page count which is only used because you are not sharing buckets with the 128 byte malloc.

OK. Sounds fine for now, and it would be a lot of heavy lifting to get something significantly better (eg, reserved spaces).

This revision is now accepted and ready to land.Nov 5 2020, 7:53 PM

Right, removing all spurious zones will make you less likely to run into low memory condition. But if you get there, I suspect it's going to be a huge hit or miss.

In D27103#605127, @mjg wrote:

Right, removing all spurious zones will make you less likely to run into low memory condition. But if you get there, I suspect it's going to be a huge hit or miss.

Right. W/o having special 'low memory' handling / reserve to ensure progress is made, having this as a zone isn't beneficial.

This revision was automatically updated to reflect the committed changes.