suricata
util-hugepages.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18/**
19 * \file
20 *
21 * \author Lukas Sismis <lsismis@oisf.net>
22 */
23
24#ifndef UTIL_HUGEPAGES_H
25#define UTIL_HUGEPAGES_H
26
27typedef struct {
28 uint32_t size_kb;
29 uint16_t allocated;
30 uint16_t free;
32
33// Structure to hold information about individual NUMA nodes in the system and
34// and their respective allocated hugepages
35// So for e.g. NUMA node 0 there can be 2 hugepage_size - 2 MB and 1 GB
36// Each hugepage size will then have a record of number of allocated/free hpages
37typedef struct {
40} NodeInfo;
41
42// Structure to hold information about all hugepage sizes residing on all NUMA
43// nodes in the system
44typedef struct {
45 uint16_t num_nodes;
48
52
53#endif /* UTIL_HUGEPAGES_H */
uint16_t allocated
uint32_t size_kb
HugepageInfo * hugepages
uint16_t num_hugepage_sizes
void SystemHugepageEvaluateHugepages(SystemHugepageSnapshot *pre_s, SystemHugepageSnapshot *post_s)
The function compares two hugepage snapshots and prints out recommendations for hugepage configuratio...
void SystemHugepageSnapshotDestroy(SystemHugepageSnapshot *s)
SystemHugepageSnapshot * SystemHugepageSnapshotCreate(void)
The function creates a snapshot of the system's hugepage usage per NUMA node and per hugepage size....