mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
It's rare to find a system that has more than 4 sockets, but a system can have more than 4 NUMA nodes if each socket exposes its chiplets as separate NUMA nodes. In particular, our CI caught a failure in this test on a system with two sockets, each containing an 'AMD EPYC 7601 32-Core Processor'. Bump the limit to 32, just in case. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-ID: <20260612150038.1277394-1-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
52 lines
1.4 KiB
C
52 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Tools for integrating with lru_gen, like parsing the lru_gen debugfs output.
|
|
*
|
|
* Copyright (C) 2025, Google LLC.
|
|
*/
|
|
#ifndef SELFTEST_KVM_LRU_GEN_UTIL_H
|
|
#define SELFTEST_KVM_LRU_GEN_UTIL_H
|
|
|
|
#include <inttypes.h>
|
|
#include <limits.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "test_util.h"
|
|
|
|
#define MAX_NR_GENS 16 /* MAX_NR_GENS in include/linux/mmzone.h */
|
|
#define MAX_NR_NODES 32 /* Maximum number of nodes supported by the test */
|
|
|
|
#define LRU_GEN_DEBUGFS "/sys/kernel/debug/lru_gen"
|
|
#define LRU_GEN_ENABLED_PATH "/sys/kernel/mm/lru_gen/enabled"
|
|
#define LRU_GEN_ENABLED 1
|
|
#define LRU_GEN_MM_WALK 2
|
|
|
|
struct generation_stats {
|
|
int gen;
|
|
long age_ms;
|
|
long nr_anon;
|
|
long nr_file;
|
|
};
|
|
|
|
struct node_stats {
|
|
int node;
|
|
int nr_gens; /* Number of populated gens entries. */
|
|
struct generation_stats gens[MAX_NR_GENS];
|
|
};
|
|
|
|
struct memcg_stats {
|
|
unsigned long memcg_id;
|
|
int nr_nodes; /* Number of populated nodes entries. */
|
|
struct node_stats nodes[MAX_NR_NODES];
|
|
};
|
|
|
|
void lru_gen_read_memcg_stats(struct memcg_stats *stats, const char *memcg);
|
|
long lru_gen_sum_memcg_stats(const struct memcg_stats *stats);
|
|
long lru_gen_sum_memcg_stats_for_gen(int gen, const struct memcg_stats *stats);
|
|
void lru_gen_do_aging(struct memcg_stats *stats, const char *memcg);
|
|
int lru_gen_find_generation(const struct memcg_stats *stats,
|
|
unsigned long total_pages);
|
|
bool lru_gen_usable(void);
|
|
|
|
#endif /* SELFTEST_KVM_LRU_GEN_UTIL_H */
|