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/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_NUMA_H__
|
|
|
|
# define __VIR_NUMA_H__
|
|
|
|
|
2013-03-20 11:35:08 +08:00
|
|
|
# include "internal.h"
|
|
|
|
# include "virbitmap.h"
|
|
|
|
# include "virutil.h"
|
|
|
|
|
|
|
|
|
2013-03-18 17:04:01 +08:00
|
|
|
char *virNumaGetAutoPlacementAdvice(unsigned short vcups,
|
|
|
|
unsigned long long balloon);
|
|
|
|
|
2014-11-06 12:16:54 +01:00
|
|
|
int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
|
|
|
virBitmapPtr nodeset);
|
2013-10-17 16:57:29 +02:00
|
|
|
|
2016-09-13 15:55:06 +02:00
|
|
|
virBitmapPtr virNumaGetHostMemoryNodeset(void);
|
2017-07-12 11:07:17 +01:00
|
|
|
bool virNumaNodesetIsAvailable(virBitmapPtr nodeset) ATTRIBUTE_NOINLINE;
|
|
|
|
bool virNumaIsAvailable(void) ATTRIBUTE_NOINLINE;
|
|
|
|
int virNumaGetMaxNode(void) ATTRIBUTE_NOINLINE;
|
|
|
|
bool virNumaNodeIsAvailable(int node) ATTRIBUTE_NOINLINE;
|
2014-06-02 12:06:56 +02:00
|
|
|
int virNumaGetDistances(int node,
|
|
|
|
int **distances,
|
2017-07-12 11:07:17 +01:00
|
|
|
int *ndistances) ATTRIBUTE_NOINLINE;
|
2013-10-17 18:30:09 +02:00
|
|
|
int virNumaGetNodeMemory(int node,
|
|
|
|
unsigned long long *memsize,
|
2017-07-12 11:07:17 +01:00
|
|
|
unsigned long long *memfree) ATTRIBUTE_NOINLINE;
|
2013-10-17 17:42:22 +02:00
|
|
|
|
2013-10-18 14:43:34 +02:00
|
|
|
unsigned int virNumaGetMaxCPUs(void);
|
|
|
|
|
2017-07-12 11:07:17 +01:00
|
|
|
int virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) ATTRIBUTE_NOINLINE;
|
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)
|
2017-07-12 11:07:17 +01:00
|
|
|
ATTRIBUTE_NONNULL(5) ATTRIBUTE_NOINLINE;
|
2014-09-18 09:24:16 +02:00
|
|
|
int virNumaSetPagePoolSize(int node,
|
|
|
|
unsigned int page_size,
|
|
|
|
unsigned long long page_count,
|
|
|
|
bool add);
|
2013-03-18 17:04:01 +08:00
|
|
|
#endif /* __VIR_NUMA_H__ */
|