From: David Rientjes <rientjes@google.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
andi@firstfloor.org, akpm@linux-foundation.org,
linux-mm@kvack.org, kamezawa.hiroyuki@gmail.com, mhocko@suse.cz,
hannes@cmpxchg.org, yinghan@google.com
Subject: Re: [PATCH 1/1] mm: Export a function to read vm_committed_as
Date: Sat, 10 Nov 2012 18:35:05 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1211101830250.18494@chino.kir.corp.google.com> (raw)
In-Reply-To: <1352600728-17766-1-git-send-email-kys@microsoft.com>
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.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-11-11 2:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 2:25 K. Y. Srinivasan
2012-11-11 2:35 ` David Rientjes [this message]
2012-11-11 9:24 ` KY Srinivasan
2012-11-12 21:53 ` David Rientjes
2012-11-12 22:58 ` KY Srinivasan
2012-11-12 23:32 ` Dan Magenheimer
2012-11-12 23:49 ` David Rientjes
2012-11-13 5:24 ` KY Srinivasan
2012-11-13 15:41 ` Dan Magenheimer
2012-11-13 21:04 ` David Rientjes
2012-11-13 5:16 ` KY Srinivasan
2012-11-12 21:36 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1211101830250.18494@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyuki@gmail.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=olaf@aepfle.de \
--cc=yinghan@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox