You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intention of a CTL for the UMF is to provide path-oriented method to library control and metrics acquisition. Current implementation of the CTL internal rely on Piotr's CTL taken from PDMK.
The name is a path-like string that traverse through the structure tree (e.g. umf.pool.default.log.enable). Rest of the arguments depends on what name should handle, and it will be covered in next chapter.
Distinguish the context - optional
Each entity should have distinct magic header to differentiate that context is either pool, provider or something else.
typedefstruct {
uint32_tmagic; // Magic number to identify the typeintfield1;
floatfield2;
} StructType1;
Name
Correct name should meet the following regexp:
^[a-zA-Z0-9]+((\.[a-zA-Z0-9]+)|(\.{}))*$
Context-free grammar:
S → A B
B → ε | A B |. A B | . {} B
A → 'a' | 'b' | 'c' | ... | 'z' | 'A' | 'B' | 'C' | ... | 'Z' | '0' | '1' | '2' | ... | '9'
User can set up default values using string , e.g.:
umfCtlSet("umf.pool.%s.min_page_size", "disjoint", &new_value); // set default value for disjoint poolumfCtlGet("umf.pool.%s.max_page_size", "disjoint", &value); // get default value
Another way to set up global namespace is passing values by an environment variable (TBD).
Global namespace can be used for storing values for future creation of pools/providers or set up common features (e.g.: enabling logging mechanism or logging level). Storing configuration for common features is similar to operating on a given context (existing pools/providers). Storing default values for non-existent pools/providers forces to using some kind of key-value store and then retrieve matching pairs at the creation time during initialize() function.
Examples of using global namespace:
// Change default for future providers of the given typeUmfCtlSet(NULL, "provider.<provider_name>.always_zero_memory", &newvalue);
// Change value for existent provider using handle// Notice: there is a handle provided as a contextumfCtlSet(osMemoryProviderHandle, "always_zero_memory", &newvalue);
// But user can use full path if it is preferred umfCtlSet(osMemoryProviderHandle, "provider.<provider_name>.always_zero_memory", &newvalue);
Options tree
TODO: provide tree structure with possible options that will be implemented
umf
├── common
│ └── TODO
├── pool
| ├── by_handle
| | └── TODO
| └── default
| └── TODO
└── provider
├── by_handle
└── default
Uh oh!
There was an error while loading. Please reload this page.
CTL
API proposal
Intention of a CTL for the UMF is to provide path-oriented method to library control and metrics acquisition. Current implementation of the CTL internal rely on Piotr's CTL taken from PDMK.
General API
Global API should looks like:
The
name
is a path-like string that traverse through the structure tree (e.g.umf.pool.default.log.enable
). Rest of the arguments depends on whatname
should handle, and it will be covered in next chapter.Distinguish the context - optional
Each entity should have distinct magic header to differentiate that context is either pool, provider or something else.
Name
Correct name should meet the following regexp:
Context-free grammar:
Examples of accepted strings:
Arg
Raw pointer to provide or retrieve data from the callback function implemented in specific module (pool/provider/etc), e.g.:
Global namespace
User can set up default values using string , e.g.:
Another way to set up global namespace is passing values by an environment variable (TBD).
Global namespace can be used for storing values for future creation of pools/providers or set up common features (e.g.: enabling logging mechanism or logging level). Storing configuration for common features is similar to operating on a given context (existing pools/providers). Storing default values for non-existent pools/providers forces to using some kind of key-value store and then retrieve matching pairs at the creation time during
initialize()
function.Examples of using global namespace:
Options tree
TODO: provide tree structure with possible options that will be implemented
Internal disjoint pool tree:
Invocation to set
SlabMinSize
should looks like:Modification needed for this approach
TODO: what extra modifications are needed to make it works
Provider
include/umf/memory_provider.h
ctl
function pointer declaration inumf_memory_provider_ext_ops_t
(memory_provider_ops.h
)Steps
Pull request related
CTL: Add a CTL sources to the UMF #913
Issues related
UMF: use CTL/env to allow changing default jemalloc pool options #1019
UMF: Performance Testing #786
UMF: Expose allocation statistics for memory provideres (and pools?) #282
UR: Control and instrospection API #1454
The text was updated successfully, but these errors were encountered: