| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
utils: split NUMA helpers out of data.c into numa_setup Move the NUMA-backed mapping/migration helpers out of src/utils/data.c and include/utils/data.h into a dedicated numa_setup module: include/utils/numa_setup.h (enum numa_map_method + map_numa_memory, unmap_numa_memory, move_pages_simple, trigger_demand_paging) src/utils/numa_setup.c (the implementations + their static helpers do_mbind, mbind_simple, do_move_pages, map_numa_memory_numa_alloc) data.c / data.h previously bundled two unrelated concerns: deterministic test-data pattern logic (fill/check/permute) and NUMA placement. The data.h file-level docstring even promised only "deterministic test-data helpers", while the NUMA API was undocumented there and shared no state, helpers, or types with the pattern code. Splitting them gives each translation unit a single responsibility and stops forcing readers of the pattern code past ~250 lines of NUMA syscall wrappers (and vice versa). Pure code move: the moved functions are byte-identical to their previous bodies, no behavior change. data.c drops the now-unused <numa.h>, <numaif.h>, <sys/mman.h>, <time.h> (was unused), and <unistd.h> (only sysconf in the moved code) includes; numa_setup.c carries the NUMA-specific includes instead. The NUMA API has no external callers, so no caller updates are needed. Wire numa_setup.c into src/framework/CMakeLists.txt alongside the other utils sources, and list utils/numa_setup.h in doc/test-writers/api.md so the new header is discoverable (next to the NUMA-related os_info.h entry). Verified: clean build with the project warning set; local_smoke 8/8 (both data contract tests still pass). | 2 个月前 | |
tests: remove param_filter_func field and hardcoded datapath_spec entries - Remove the param_filter_func field from struct test_case in include/framework/obmm_test.h. The field was added in commit 2e5257c but the framework never read it: the orchestrator only checked test_func != NULL, and the conductor dispatched via test_func() directly. The field was purely test-side shared state with a duplicated invocation pattern across 8 consumer sites in tests/obmm/consistency/. Each consumer now calls its local *_param_filter() function directly, which is the pattern the field was hinting at without ever providing. The three _PARAM registration macros drop the .param_filter_func = NULL initializer. - Remove the UBMEM_DATAPATH_SYMMETRIC_PORT_TO_PORT_INIT macro from include/utils/datapath.h. The macro wrapped a 14-line compound designated initializer into a 14-line compound designated initializer — it saved no lines and added one level of indirection. All 8 call sites that used the macro with identical args (0,1,0,0,1) are replaced by dropping the hardcoded datapath_spec entirely and relying on the runtime select_datapath() call the tests already make. The one parameterized site in share_rr_remap.c now uses dp_sel directly (the full select_datapath() output) instead of rebuilding a struct with hardcoded package_id=0, die_id=0. - Remove all hardcoded datapath_spec arrays from the consistency test family (atomic, lock, producer_consumer, producer_consumer_wo, notify_round_trip_nc, notify_round_trip_ccnc, share_rr_remap, flush_range_test). Each test_case's datapath_spec is now {.items = NULL, .count = 0}. The orchestrator's pre-validation is sacrificed (it can no longer skip tests whose declared links are not connected), but the runtime select_datapath() call provides a clear failure if no link exists. This is the correct trade-off: hardcoded port/die IDs in datapath_spec were a source of false negatives on hardware with different link geometry. Concretely, tests the orchestrator previously skipped via LOG_WARN on missing links now fail at runtime via select_datapath(); CI dashboards and timeout accounting will see different surface behavior on hosts without the declared topology. - Add align_up_size() and align_down_size() to include/utils/sizes.h (next to the existing gcd_size and lcm_size helpers). Remove the 5 test-local copies (align_up, pc_align_up, rr_align_up, nrt_align_up, align_up_size) from the consistency test files and rename all callers to the shared name. All 6 affected files already include utils/sizes.h. The shared helpers' @param contract acknowledges the align == 0 passthrough (matching the originals); callers in share_rr_remap.c that previously relied on the uintptr_t-typed local helper now narrow through an explicit (size_t) cast for visibility. | 2 个月前 | |
style: reformat C sources with clang-format Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 | |
param_fmt: harden formatter overflow handling and input guards - sprintf_ubmem_decoder_config: bounds-check the vendor callback's return value before advancing offset, and run the full overflow epilogue (LOG_WARN + null-terminate + errno=ENOBUFS) on overflow. Restores the offset <= size invariant before the closing "\n}" snprintf and makes the callback and fallback paths symmetric. - FMT_CHECK_OVERFLOW: include ret < 0 in the guard so snprintf encoding errors are routed through the same epilogue as truncation, matching APPEND_CHECK. - format_flag_list: reject NULL names with non-zero count; update flag_fmt.h @pre to document the names/count contract. - Add the buf == NULL || size == 0 input guard to all six sprintf_*_params formatters (export/import/unexport/unimport/map/ unmap), matching the convention every leaf formatter already follows. - *_to_str wrappers: on ret < 0, null-terminate at offset 0 instead of the buffer's last byte so a failed call returns a deterministic empty string rather than stale content from a previous successful call. Closes implementation formatter findings #1, #2, #3, #4, #5, #6, #7 and structural formatter-utils findings #1, #2. | 2 个月前 | |
Style: apply clang-format to all tracked C sources and headers Run scripts/format_all.sh to normalize indentation, line wrapping, and spacing across the codebase after the merge. Signed-off-by: Gao Tianxiong <318328978@qq.com> | 2 个月前 | |
feat: add aarch64 mem_ops helpers Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 | |
tests: drop remote-NUMA mem-op RAS coverage due to unstable cache eviction Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 | |
tests: drop remote-NUMA mem-op RAS coverage due to unstable cache eviction Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 5 个月前 | |
numa_setup: warn on unsupported prot in trigger_demand_paging trigger_demand_paging's loop body only acts on PROT_READ (exact match) or PROT_WRITE (bitwise). A prot value with neither bit set (e.g. PROT_NONE, PROT_EXEC alone) would silently no-op through the entire loop, leaving the caller under the impression that demand paging had been triggered when it had not. Add an early LOG_WARN + return for prot values lacking both PROT_READ and PROT_WRITE so the no-op is explicit rather than silent. Document the behavior in the header. All in-tree callers (map_numa_memory dispatching to the MAPPED_PAGES and DIRTY_PAGES variants) pass PROT_READ or PROT_WRITE, so the new guard is a defensive check for future callers and external test writers. | 2 个月前 | |
obmm_dev: add get_obmm_dev_size helper and migrate callers Reading a device's size sysfs attribute is the single most common OBMM sysfs read across the test tree: 22 call sites across 14 files open-coded get_obmm_sysfs_attr_ul(&x, id, "size"). Add a named thin wrapper get_obmm_dev_size(size_t *size, id) next to the existing named-attr wrappers (is_obmm_dev_import, get_obmm_import_remote_numa) and migrate every genuine size-read call site to it. The output type is size_t to match the semantic type of a memory size. The helper bridges the underlying get_obmm_sysfs_attr_ul (unsigned long) via a local, so callers no longer need their own unsigned long local plus a (size_t) cast: - Where the local fed only a size_t target field (run_cfg.size, ctx->size, handle->size), the local is eliminated entirely; the call writes directly into the target field. - Where the local is also used in a LOG_DEBUG, it is retyped to size_t and the (size_t) casts removed; format strings updated from %lx/%lu to %zx/%zu per the style-guide size-logging rule. - basic_mmap's two helpers (verify_partial_mmap_offset, verify_offset_overflow_rejected) take size_t region_size now to match the caller. tests/framework_tests/obmm_dev.c is intentionally not migrated: its get_obmm_sysfs_attr_ul(NULL, 0, "size") call is a self-test of the *generic* reader's NULL-argument contract, where "size" is just a sample attribute name, not a genuine size read. | 2 个月前 | |
utils/os_info: add kernel-log helper and drop bugfix-local dmesg copies The two ownership_call_trace bugfix tests each carried byte-identical copies of get_dmesg_line_count() and check_dmesg_for_call_trace(). Kernel-log introspection is OS-level, so promote the scan to os_info as dmesg_contains_since(), taking a caller-captured system-time baseline, and switch both callers over. The scan is time-based: callers capture a wall-clock baseline with time(NULL) before the test action, then dmesg_contains_since() filters the kernel log with dmesg --since=<baseline>. Filtering by message timestamp rather than line position is robust to ring-buffer wraparound -- a line-count baseline silently under-reports once the buffer is full (the common case on a system with uptime), which for a "no Call trace" assertion is the dangerous false-negative direction. Named without an os_ prefix to match the rest of the os_info surface. Requires util-linux dmesg for --since. | 2 个月前 | |
mami4ubmem: adapt to map() breaking change (multi-descriptor + embedded decoder_config) The mami4ubmem wrapper header underwent a breaking change to mami4ubmem_map(): the standalone decoder_config parameter is removed (the config now lives in struct mami4ubmem_map_attr.decoder_config), the single ubmd argument becomes an ubmds[] array with an ubmd_count, and the attr struct gains intlv_granu for interleave granularity. Adapt the compat shim, loader, formatters, and all call sites. - include/compat/mami4ubmem-compat.h: carry the breaking-change fields (intlv_granu, decoder_config) on struct mami4ubmem_map_attr and the new mami4ubmem_map signature; update the struct and mami4ubmem_map Doxygen to describe ubmds/ubmd_count and the new attr fields. - src/loaders/mami4ubmem_module.c: update mami4ubmem_map_guard and the function-pointer variable to the new signature. - include/utils/param_fmt.h, src/utils/param_fmt.c: sprintf_mami4ubmem_map_params and log_mami4ubmem_map_error drop the standalone config arg and take ubmd_count; the map_attr formatter now renders intlv_granu and the embedded decoder_config; map_params prints ubmd_count and loops the ubmds array. - Call sites (datapath_setup.c do_map, import_test_common.h setup_import_map, query_addr.c, share_parallel.c, time_import.c): copy the built/received decoder config into attr.decoder_config, pass ubmd_count=1 for the single-descriptor maps, and set intlv_granu=0 (no interleave). Helper signatures are unchanged to preserve the test-writer-visible API. - datapath_setup.c: also fix include order (utils/datapath.h was placed before the system headers) per style-guide Include Order. Built clean in compat mode (OBMM_TEST_MAMI4UBMEM_DIRECT_LINK=OFF). Direct-link mode (=ON) requires the upstream mami4ubmem.h to carry the same breaking change; not verifiable in this tree. Signed-off-by: Yiqun Liu <yiqun.liu.dev@outlook.com> | 2 个月前 | |
utils: simplify parse_preimport_line and move parse_size_bytes to parse.c parse_preimport_line: scan start/end/dcna/scna/nid directly via sscanf %lx/%li/%lu instead of routing through 5 intermediate char buffers and parse_ulong_text. Only deid/seid still need buffers for parse_eid. Reduces from 7 to 2 local buffers. parse_size_bytes: move from obmm_dev.c (static) to parse.c (public) where it belongs alongside the other text-parsing helpers. Add declaration to parse.h. | 2 个月前 | |
Style: apply clang-format to all tracked C sources and headers Run scripts/format_all.sh to normalize indentation, line wrapping, and spacing across the codebase after the merge. Signed-off-by: Gao Tianxiong <318328978@qq.com> | 2 个月前 | |
tests: remove param_filter_func field and hardcoded datapath_spec entries - Remove the param_filter_func field from struct test_case in include/framework/obmm_test.h. The field was added in commit 2e5257c but the framework never read it: the orchestrator only checked test_func != NULL, and the conductor dispatched via test_func() directly. The field was purely test-side shared state with a duplicated invocation pattern across 8 consumer sites in tests/obmm/consistency/. Each consumer now calls its local *_param_filter() function directly, which is the pattern the field was hinting at without ever providing. The three _PARAM registration macros drop the .param_filter_func = NULL initializer. - Remove the UBMEM_DATAPATH_SYMMETRIC_PORT_TO_PORT_INIT macro from include/utils/datapath.h. The macro wrapped a 14-line compound designated initializer into a 14-line compound designated initializer — it saved no lines and added one level of indirection. All 8 call sites that used the macro with identical args (0,1,0,0,1) are replaced by dropping the hardcoded datapath_spec entirely and relying on the runtime select_datapath() call the tests already make. The one parameterized site in share_rr_remap.c now uses dp_sel directly (the full select_datapath() output) instead of rebuilding a struct with hardcoded package_id=0, die_id=0. - Remove all hardcoded datapath_spec arrays from the consistency test family (atomic, lock, producer_consumer, producer_consumer_wo, notify_round_trip_nc, notify_round_trip_ccnc, share_rr_remap, flush_range_test). Each test_case's datapath_spec is now {.items = NULL, .count = 0}. The orchestrator's pre-validation is sacrificed (it can no longer skip tests whose declared links are not connected), but the runtime select_datapath() call provides a clear failure if no link exists. This is the correct trade-off: hardcoded port/die IDs in datapath_spec were a source of false negatives on hardware with different link geometry. Concretely, tests the orchestrator previously skipped via LOG_WARN on missing links now fail at runtime via select_datapath(); CI dashboards and timeout accounting will see different surface behavior on hosts without the declared topology. - Add align_up_size() and align_down_size() to include/utils/sizes.h (next to the existing gcd_size and lcm_size helpers). Remove the 5 test-local copies (align_up, pc_align_up, rr_align_up, nrt_align_up, align_up_size) from the consistency test files and rename all callers to the shared name. All 6 affected files already include utils/sizes.h. The shared helpers' @param contract acknowledges the align == 0 passthrough (matching the originals); callers in share_rr_remap.c that previously relied on the uintptr_t-typed local helper now narrow through an explicit (size_t) cast for visibility. | 2 个月前 | |
utils: add actor_barrier and eliminate hand-rolled barriers Replace hand-rolled two-actor send/recv barrier helpers in cleanup_env.c and share_parallel.c with a centralized actor_barrier in utils/sync.c. The barrier uses a star topology: actor 0 collects ready tokens from all other actors, then broadcasts an ACK. Scales from 1 actor (no-op) to N actors. Requires actor 0 to have channels to every other actor. | 2 个月前 | |
utils: consolidate datapath APIs into one header, three sources Merge include/utils/ub_topology.h into datapath.h and split the implementation by concern: - datapath.c: basic attribute-query resolvers (NUMA/host/package of an explicit datapath); deps: ub_sysfs only. - datapath_select.c (was ub_topology.c): datapath selection from the link graph; deps: ub_link + ubmem_vendor. The ub_sysfs include is dropped here since selection no longer uses it. - datapath_setup.c: setup/teardown operation (already split out). The public header datapath.h now declares all three groups (selection, attribute query, setup/teardown) and drops the dead UBMEM_DATAPATH_SYMMETRIC_PORT_TO_PORT_INIT macro. The 'do not select datapaths' caveat is removed since the header now hosts selection. Also fix select_datapath()'s doc to reference get_host_id() (what the implementation actually uses) instead of the non-existent get_proc_id(). Update CMake, the five test includes, and the api.md / datapath.md docs. The framework-internal src/framework/ub_topology.{h,c} (orchestrator comparison/connectivity helpers) is unrelated and left untouched. | 2 个月前 | |
ub_sysfs: resolve physical port IDs in load_controller_ports load_controller_ports now owns the full port-storage lifecycle: it queries mami4ubmem_get_enabled_port_mask for the controller's die, scans the UB bus controller sysfs, and converts each scanned entry from its firmware-enabled (sysfs-facing) port ID to its static physical port ID in-place before caching it. This keeps all mask handling inside one function instead of splitting the scan and the relabel across load_controller_info and load_controller_state. load_controller_state queries the UB die version once and resolves the static physical port count from the contract spec via the new ubmem_physical_ports_per_die helper (summing ports_per_decoder[]), passing it into load_controller_ports. The spec is now the source of truth for the physical port count, including boot-time-disabled ports, rather than deriving it from the enabled-port mask. This fixes the conflation bug where a boot-time-disabled physical port caused sysfs to renumber the remaining ports densely from 0, and the cached view silently treated the renumbered (enabled) IDs as physical IDs -- producing wrong decoder/UMMU resolution and wrong port CNAs once any port was disabled. With the in-place conversion, get_ub_controller_port_cna and get_ub_controller_physical_port_count speak physical IDs externally, and resolve_controller_and_validate_port inherits the fix unchanged via the spec-derived count. When the mask query returns EOPNOTSUPP (real libmami4ubmem has not shipped the symbol yet, or MAMI does not support it on this host), the conversion is identity and the cached view is unchanged, preserving the legacy behavior. When the die version or spec is unavailable, the scanned count is used as the degraded physical port count. The bijection formulas are exposed as the static-inline ub_port_id_physical_to_enabled and ub_port_id_enabled_to_physical helpers in ub_sysfs.h. | 2 个月前 | |
ubmem: shrink vendor-dispatch internal header to a public-surface symbol Promote ub_die_vendor_lookup to the public header and make the framework-private dispatch state file-local in ubmem_vendor.c. - Move the ub_die_vendor_lookup declaration (with Doxygen) from src/utils/ubmem_vendor_internal.h into include/utils/ubmem_vendor.h. - Delete src/utils/ubmem_vendor_internal.h; move UB_DIE_VERSION_MAX into src/utils/ubmem_vendor.c as a file-local macro and make g_die_ops and dummy_ops static. They have no external consumer (param_fmt.c dispatches by config version via the now-public lookup, not by g_die_ops; main.c only calls ub_die_vendor_init). - Swap src/utils/param_fmt.c and src/conductor/main.c to include utils/ubmem_vendor.h instead of the deleted internal header. - Tighten obmm_test's include surface: ${CMAKE_SOURCE_DIR}/src/utils moves from PUBLIC to PRIVATE. No external translation unit reaches into src/utils/ after this change (no headers remain under it). - Document the g_die_ops-init-called precondition on the 5 public dispatch functions and the ops != NULL precondition on ub_die_vendor_register in include/utils/ubmem_vendor.h. Closes structural dispatch-core #1, structural build-wiring #1/#2, implementation dispatch-core #1/#2, and implementation conductor-test #1. | 2 个月前 | |
Style: apply clang-format to all tracked C sources and headers Run scripts/format_all.sh to normalize indentation, line wrapping, and spacing across the codebase after the merge. Signed-off-by: Gao Tianxiong <318328978@qq.com> | 2 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 2 个月前 | ||
| 5 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 5 个月前 | ||
| 5 个月前 | ||
| 5 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 | ||
| 2 个月前 |