Skip to content

Extend the IPC cache of get/put operations to support evictions and size threshold  #1003

Closed
@vinser52

Description

@vinser52

Rationale

Today we have two IPC caches in UMF:

  1. For the "producer" flow when an IPC handle is created by calling the umfGetIPCHandle function and released by calling the umfPutIPCHandle function.
  2. For the "consumer" flow when an IPC handle is opened (usually by another process) by calling the umfOpenIPCHandle and closed by calling the umfCloseIPCHandle function.

This issue is related to the "producer" flow. Today it uses just the critnib map to cache created IPC handles from memory provider. BUt we need to support the threshold for the cache size as we do for the opened IPC handles cache in #998.

Description

Introduce the UMF_MAX_CREATED_IPC_HANDLES environment variable (the name is subject to discussion) to limit the cache size. As for the consumer flow use true cache implementation (hash amp + LRU list) instead of just a map.

API Changes

No API changes. Only a new environment variable to control the maximum cache size

Implementation details

See the ipc_cache.h and the ipc_cache.c for how IPC cache is implemented for the "consumer" flow. We need almost the same for the "producer" flow. Only the cache key and value structures will be different.

Meta

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions