From: menage@google.com
To: akpm@linux-foundation.org, balbir@in.ibm.com, pj@sgi.com,
Pavel Emelianov <xemul@openvz.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org
Subject: [PATCH 03/10] CGroup API files: Use read_u64 in memory controller
Date: Sat, 23 Feb 2008 14:47:28 -0800 [thread overview]
Message-ID: <20080223232617.634408000@menage.corp.google.com> (raw)
In-Reply-To: <20080223224725.115590000@menage.corp.google.com>
[-- Attachment #1: memcontrol_use_res_counter_read_uint.patch --]
[-- Type: text/plain, Size: 1559 bytes --]
Update the memory controller to use read_u64 for its
limit/usage/failcnt control files, calling the new
res_counter_read_u64() function.
Signed-off-by: Paul Menage <menage@google.com>
---
mm/memcontrol.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
Index: cgroup-2.6.25-rc2-mm1/mm/memcontrol.c
===================================================================
--- cgroup-2.6.25-rc2-mm1.orig/mm/memcontrol.c
+++ cgroup-2.6.25-rc2-mm1/mm/memcontrol.c
@@ -922,13 +922,10 @@ int mem_cgroup_write_strategy(char *buf,
return 0;
}
-static ssize_t mem_cgroup_read(struct cgroup *cont,
- struct cftype *cft, struct file *file,
- char __user *userbuf, size_t nbytes, loff_t *ppos)
+static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
{
- return res_counter_read(&mem_cgroup_from_cont(cont)->res,
- cft->private, userbuf, nbytes, ppos,
- NULL);
+ return res_counter_read_u64(&mem_cgroup_from_cont(cont)->res,
+ cft->private);
}
static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
@@ -1024,18 +1021,18 @@ static struct cftype mem_cgroup_files[]
{
.name = "usage_in_bytes",
.private = RES_USAGE,
- .read = mem_cgroup_read,
+ .read_u64 = mem_cgroup_read,
},
{
.name = "limit_in_bytes",
.private = RES_LIMIT,
.write = mem_cgroup_write,
- .read = mem_cgroup_read,
+ .read_u64 = mem_cgroup_read,
},
{
.name = "failcnt",
.private = RES_FAILCNT,
- .read = mem_cgroup_read,
+ .read_u64 = mem_cgroup_read,
},
{
.name = "force_empty",
--
next prev parent reply other threads:[~2008-02-23 23:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-23 22:47 [PATCH 00/10] CGroup API files: Various cleanup to CGroup control files menage
2008-02-23 22:47 ` [PATCH 01/10] CGroup API files: Rename read/write_uint methods to read_write_u64 menage
2008-02-23 22:47 ` [PATCH 02/10] CGroup API files: Add res_counter_read_u64() menage
2008-02-23 22:47 ` menage [this message]
2008-02-23 22:47 ` [PATCH 04/10] CGroup API files: Strip all trailing whitespace in cgroup_write_u64 menage
2008-02-23 22:47 ` [PATCH 05/10] CGroup API files: Update cpusets to use cgroup structured file API menage
2008-02-27 0:54 ` Li Zefan
2008-02-27 1:09 ` Paul Menage
2008-02-23 22:47 ` [PATCH 06/10] CGroup API files: Add cgroup map data type menage
2008-02-23 22:47 ` [PATCH 07/10] CGroup API files: Use cgroup map for memcontrol stats file menage
2008-02-23 22:47 ` [PATCH 08/10] CGroup API files: Drop mem_cgroup_force_empty() menage
2008-02-23 22:47 ` [PATCH 09/10] CGroup API files: Move "releasable" to cgroup_debug subsystem menage
2008-02-23 22:47 ` [PATCH 10/10] CGroup API files: Make CGROUP_DEBUG default to off menage
2008-02-26 3:23 ` [PATCH 00/10] CGroup API files: Various cleanup to CGroup control files Li Zefan
2008-02-26 6:19 ` Paul Menage
2008-02-26 7:48 ` Li Zefan
2008-02-27 1:09 ` Paul Menage
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=20080223232617.634408000@menage.corp.google.com \
--to=menage@google.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@in.ibm.com \
--cc=containers@lists.linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
--cc=xemul@openvz.org \
--cc=yamamoto@valinux.co.jp \
/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
Powered by JetHome