lkml.org 
[lkml]   [2012]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] mm: Export a function to read vm_committed_as
On Sat, 10 Nov 2012, K. Y. Srinivasan wrote:

> diff --git a/mm/mmap.c b/mm/mmap.c
> index 2d94235..e527239 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -89,6 +89,17 @@ int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
> struct percpu_counter vm_committed_as ____cacheline_aligned_in_smp;
>
> /*
> + * A wrapper to read vm_committed_as that can be used by external modules.
> + */
> +
> +unsigned long read_vm_committed_as(void)
> +{
> + return percpu_counter_read_positive(&vm_committed_as);
> +}
> +
> +EXPORT_SYMBOL_GPL(read_vm_committed_as);
> +
> +/*
> * Check that a process has enough memory to allocate a new virtual
> * mapping. 0 means there is enough memory for the allocation to
> * succeed and -ENOMEM implies there is not.

This is precisely what I didn't want to see; I was expecting that this
function was going to have some name that would describe what a hypervisor
would use it for, regardless of its implementation and current use of
vm_committed_as. read_vm_committed_as() misses the entire point of the
suggestion and a few people have mentioned that they think this
implementation will evolve over time.

Please think of what you're trying to determine in the code that will
depend on this and then convert the existing user in
drivers/xen/xen-selfballoon.c.


\
 
 \ /
  Last update: 2012-11-11 04:21    [W:0.098 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site