2013-03-18 17:04:01 +08:00
|
|
|
/*
|
|
|
|
* virnuma.h: helper APIs for managing numa
|
|
|
|
*
|
2014-06-06 16:50:39 +02:00
|
|
|
* Copyright (C) 2011-2014 Red Hat, Inc.
|
2013-03-18 17:04:01 +08:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 11:13:08 -05:00
|
|
|
#pragma once
|
2013-03-18 17:04:01 +08:00
|
|
|
|
2019-06-18 11:13:08 -05:00
|
|
|
#include "internal.h"
|
|
|
|
#include "virbitmap.h"
|
2013-03-20 11:35:08 +08:00
|
|
|
|
|
|
|
|
2018-10-22 14:37:54 +01:00
|
|
|
char *virNumaGetAutoPlacementAdvice(unsigned short vcpus,
|
2013-03-18 17:04:01 +08:00
|
|
|
unsigned long long balloon);
|
|
|
|
|
2014-11-06 12:16:54 +01:00
|
|
|
int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
2021-03-11 08:16:13 +01:00
|
|
|
virBitmap *nodeset);
|
2013-10-17 16:57:29 +02:00
|
|
|
|
2021-03-11 08:16:13 +01:00
|
|
|
virBitmap *virNumaGetHostMemoryNodeset(void);
|
|
|
|
bool virNumaNodesetIsAvailable(virBitmap *nodeset) G_GNUC_NO_INLINE;
|
2019-10-15 13:24:34 +02:00
|
|
|
bool virNumaIsAvailable(void) G_GNUC_NO_INLINE;
|
|
|
|
int virNumaGetMaxNode(void) G_GNUC_NO_INLINE;
|
|
|
|
bool virNumaNodeIsAvailable(int node) G_GNUC_NO_INLINE;
|
2014-06-02 12:06:56 +02:00
|
|
|
int virNumaGetDistances(int node,
|
|
|
|
int **distances,
|
2019-10-15 13:24:34 +02:00
|
|
|
int *ndistances) G_GNUC_NO_INLINE;
|
2013-10-17 18:30:09 +02:00
|
|
|
int virNumaGetNodeMemory(int node,
|
|
|
|
unsigned long long *memsize,
|
2019-10-15 13:24:34 +02:00
|
|
|
unsigned long long *memfree) G_GNUC_NO_INLINE;
|
2013-10-17 17:42:22 +02:00
|
|
|
|
2021-05-17 12:43:35 +02:00
|
|
|
unsigned int virNumaGetMaxCPUs(void) G_GNUC_NO_INLINE;
|
2013-10-18 14:43:34 +02:00
|
|
|
|
2021-03-11 08:16:13 +01:00
|
|
|
int virNumaGetNodeCPUs(int node, virBitmap **cpus) G_GNUC_NO_INLINE;
|
|
|
|
int virNumaNodesetToCPUset(virBitmap *nodeset,
|
|
|
|
virBitmap **cpuset);
|
2013-10-18 16:21:24 +02:00
|
|
|
|
2014-06-06 18:09:01 +02:00
|
|
|
int virNumaGetPageInfo(int node,
|
|
|
|
unsigned int page_size,
|
2014-06-23 15:04:11 +02:00
|
|
|
unsigned long long huge_page_sum,
|
2018-04-23 16:36:53 +02:00
|
|
|
unsigned long long *page_avail,
|
|
|
|
unsigned long long *page_free);
|
2014-06-06 18:09:01 +02:00
|
|
|
int virNumaGetPages(int node,
|
|
|
|
unsigned int **pages_size,
|
2018-04-23 16:36:53 +02:00
|
|
|
unsigned long long **pages_avail,
|
|
|
|
unsigned long long **pages_free,
|
2014-06-06 18:09:01 +02:00
|
|
|
size_t *npages)
|
2019-10-15 13:24:34 +02:00
|
|
|
ATTRIBUTE_NONNULL(5) G_GNUC_NO_INLINE;
|
2014-09-18 09:24:16 +02:00
|
|
|
int virNumaSetPagePoolSize(int node,
|
|
|
|
unsigned int page_size,
|
|
|
|
unsigned long long page_count,
|
|
|
|
bool add);
|