2013-03-18 09:04:01 +00:00
|
|
|
/*
|
|
|
|
* virnuma.h: helper APIs for managing numa
|
|
|
|
*
|
2014-06-06 14:50:39 +00:00
|
|
|
* Copyright (C) 2011-2014 Red Hat, Inc.
|
2013-03-18 09:04:01 +00: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 16:13:08 +00:00
|
|
|
#pragma once
|
2013-03-18 09:04:01 +00:00
|
|
|
|
2019-06-18 16:13:08 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include "virbitmap.h"
|
|
|
|
#include "virutil.h"
|
2013-03-20 03:35:08 +00:00
|
|
|
|
|
|
|
|
2018-10-22 13:37:54 +00:00
|
|
|
char *virNumaGetAutoPlacementAdvice(unsigned short vcpus,
|
2013-03-18 09:04:01 +00:00
|
|
|
unsigned long long balloon);
|
|
|
|
|
2014-11-06 11:16:54 +00:00
|
|
|
int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
|
|
|
virBitmapPtr nodeset);
|
2013-10-17 14:57:29 +00:00
|
|
|
|
2016-09-13 13:55:06 +00:00
|
|
|
virBitmapPtr virNumaGetHostMemoryNodeset(void);
|
2017-07-12 10:07:17 +00: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 10:06:56 +00:00
|
|
|
int virNumaGetDistances(int node,
|
|
|
|
int **distances,
|
2017-07-12 10:07:17 +00:00
|
|
|
int *ndistances) ATTRIBUTE_NOINLINE;
|
2013-10-17 16:30:09 +00:00
|
|
|
int virNumaGetNodeMemory(int node,
|
|
|
|
unsigned long long *memsize,
|
2017-07-12 10:07:17 +00:00
|
|
|
unsigned long long *memfree) ATTRIBUTE_NOINLINE;
|
2013-10-17 15:42:22 +00:00
|
|
|
|
2013-10-18 12:43:34 +00:00
|
|
|
unsigned int virNumaGetMaxCPUs(void);
|
|
|
|
|
2017-07-12 10:07:17 +00:00
|
|
|
int virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) ATTRIBUTE_NOINLINE;
|
2019-05-30 16:01:35 +00:00
|
|
|
int virNumaNodesetToCPUset(virBitmapPtr nodeset,
|
|
|
|
virBitmapPtr *cpuset);
|
2013-10-18 14:21:24 +00:00
|
|
|
|
2014-06-06 16:09:01 +00:00
|
|
|
int virNumaGetPageInfo(int node,
|
|
|
|
unsigned int page_size,
|
2014-06-23 13:04:11 +00:00
|
|
|
unsigned long long huge_page_sum,
|
2018-04-23 14:36:53 +00:00
|
|
|
unsigned long long *page_avail,
|
|
|
|
unsigned long long *page_free);
|
2014-06-06 16:09:01 +00:00
|
|
|
int virNumaGetPages(int node,
|
|
|
|
unsigned int **pages_size,
|
2018-04-23 14:36:53 +00:00
|
|
|
unsigned long long **pages_avail,
|
|
|
|
unsigned long long **pages_free,
|
2014-06-06 16:09:01 +00:00
|
|
|
size_t *npages)
|
2017-07-12 10:07:17 +00:00
|
|
|
ATTRIBUTE_NONNULL(5) ATTRIBUTE_NOINLINE;
|
2014-09-18 07:24:16 +00:00
|
|
|
int virNumaSetPagePoolSize(int node,
|
|
|
|
unsigned int page_size,
|
|
|
|
unsigned long long page_count,
|
|
|
|
bool add);
|