kernel/vm: Give VMCaches better names.

This helps with debugging and reading scheduling reports.
This commit is contained in:
Augustin Cavalier 2025-01-28 16:40:27 -05:00
parent 382ddca7fc
commit fb3a70af79
7 changed files with 9 additions and 8 deletions

View File

@ -81,7 +81,8 @@ public:
VMCache();
virtual ~VMCache();
status_t Init(uint32 cacheType, uint32 allocationFlags);
status_t Init(uint32 cacheType, uint32 allocationFlags,
const char* name);
virtual void Delete();

View File

@ -20,7 +20,7 @@
status_t
VMVnodeCache::Init(struct vnode* vnode, uint32 allocationFlags)
{
status_t error = VMCache::Init(CACHE_TYPE_VNODE, allocationFlags);
status_t error = VMCache::Init(CACHE_TYPE_VNODE, allocationFlags, "VMVnodeCache");
if (error != B_OK)
return error;

View File

@ -463,7 +463,7 @@ VMAnonymousCache::Init(bool canOvercommit, int32 numPrecommittedPages,
")\n", this, canOvercommit ? "yes" : "no", numPrecommittedPages,
numGuardPages);
status_t error = VMCache::Init(CACHE_TYPE_RAM, allocationFlags);
status_t error = VMCache::Init(CACHE_TYPE_RAM, allocationFlags, "VMAnonymousCache");
if (error != B_OK)
return error;

View File

@ -45,7 +45,7 @@ VMAnonymousNoSwapCache::Init(bool canOvercommit, int32 numPrecommittedPages,
TRACE(("VMAnonymousNoSwapCache::Init(canOvercommit = %s, numGuardPages = %ld) "
"at %p\n", canOvercommit ? "yes" : "no", numGuardPages, store));
status_t error = VMCache::Init(CACHE_TYPE_RAM, allocationFlags);
status_t error = VMCache::Init(CACHE_TYPE_RAM, allocationFlags, "VMAnonymousNoSwapCache");
if (error != B_OK)
return error;

View File

@ -630,9 +630,9 @@ VMCache::~VMCache()
status_t
VMCache::Init(uint32 cacheType, uint32 allocationFlags)
VMCache::Init(uint32 cacheType, uint32 allocationFlags, const char* name)
{
mutex_init(&fLock, "VMCache");
mutex_init(&fLock, name);
fRefCount = 1;
source = NULL;

View File

@ -16,7 +16,7 @@ status_t
VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags)
{
fBaseAddress = baseAddress;
return VMCache::Init(CACHE_TYPE_DEVICE, allocationFlags);
return VMCache::Init(CACHE_TYPE_DEVICE, allocationFlags, "VMDeviceCache");
}

View File

@ -12,7 +12,7 @@
status_t
VMNullCache::Init(uint32 allocationFlags)
{
return VMCache::Init(CACHE_TYPE_NULL, allocationFlags);
return VMCache::Init(CACHE_TYPE_NULL, allocationFlags, "VMNullCache");
}