[libvirt] [PATCH 2/7] shared_memory: Define the APIs to get/set shared memory parameters

Osier Yang jyang at redhat.com
Mon Sep 10 12:25:32 UTC 2012


On 2012年09月10日 20:08, Osier Yang wrote:
> * include/libvirt/libvirt.h.in: (Add macros for the param fields,
>    declare the APIs).
> * src/driver.h: (New methods for the driver struct)
> * src/libvirt.c: (Implement the public APIs)
> * src/libvirt_public.syms: (Export the public symbols)
> ---
>   include/libvirt/libvirt.h.in |   63 ++++++++++++++++++++++
>   python/generator.py          |    2 +
>   src/driver.h                 |   14 +++++
>   src/libvirt.c                |  121 ++++++++++++++++++++++++++++++++++++++++++
>   src/libvirt_public.syms      |    2 +
>   5 files changed, 202 insertions(+), 0 deletions(-)
>
> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> index f63178c..5d8e6f4 100644
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -4272,6 +4272,69 @@ typedef struct _virTypedParameter virMemoryParameter;
>    */
>   typedef virMemoryParameter *virMemoryParameterPtr;
>
> +/*
> + * VIR_NODE_KSM_PAGES_TO_SCAN:
> + *
> + * Macro for typed parameter that represents how many present pages
> + * to scan before ksmd goes to sleep.
> + */
> +# define VIR_NODE_SHARED_MEMORY_PAGES_TO_SCAN     "pages_to_scan"
> +
> +/*
> + * VIR_NODE_KSM_SLEEP_MILLISECS:
> + *
> + * Macro for typed parameter that represents how many milliseconds
> + * ksmd should sleep before next scan.
> + */
> +# define VIR_NODE_SHARED_MEMORY_SLEEP_MILLISECS   "sleep_millisecs"
> +
> +/*
> + * VIR_NODE_KSM_PAGES_SHARED:
> + *
> + * Macro for typed parameter that represents how many ksm shared pages
> + * are being used.
> + */
> +# define VIR_NODE_SHARED_MEMORY_PAGES_SHARED       "pages_shared"
> +
> +/*
> + * VIR_NODE_KSM_PAGES_SHARING:
> + *
> + * Macro for typed parameter that represents how many sites are
> + * sharing the pages i.e. how much saved.
> + */
> +# define VIR_NODE_SHARED_MEMORY_PAGES_SHARING      "pages_sharing"
> +
> +/* VIR_NODE_KSM_PAGES_UNSHARED:
> + *
> + * Macro for typed parameter that represents how many pages unique
> + * but repeatedly checked for merging.
> + */
> +# define VIR_NODE_SHARED_MEMORY_PAGES_UNSHARED     "pages_unshared"
> +
> +/* VIR_NODE_KSM_PAGES_VOLATILE:
> + *
> + * Macro for typed parameter that represents how many pages changing
> + * too fast to be placed in a tree.
> + */
> +# define VIR_NODE_SHARED_MEMORY_PAGES_VOLATILE     "pages_volatile"
> +
> +/* VIR_NODE_KSM_FULL_SCAN:
> + *
> + * Macro for typed parameter that represents how many times all
> + * mergeable areas have been scanned.
> + */
> +# define VIR_NODE_SHARED_MEMORY_FULL_SCANS         "full_scans"
> +

Oh, I forgot to change the comments, squashed with following diff
on my local repo:

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120910/88464462/attachment-0001.ksh>


More information about the libvir-list mailing list