* [PATCH] memcg: do not check for do_swap_account in mem_cgroup_{read,write,reset}
@ 2013-03-19 13:06 Michal Hocko
2013-03-27 15:08 ` Johannes Weiner
0 siblings, 1 reply; 2+ messages in thread
From: Michal Hocko @ 2013-03-19 13:06 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, Kamezawa Hiroyuki, Tejun Heo, Johannes Weiner,
linux-kernel
since 2d11085e (memcg: do not create memsw files if swap accounting
is disabled) memsw files are created only if memcg swap accounting is
enabled so there doesn't make any sense to check for it explicitely in
mem_cgroup_read, mem_cgroup_write and mem_cgroup_reset.
Signed-off-by: Michal Hocko <mhocko@suse.cz>
---
mm/memcontrol.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2e01167..f608546 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5091,9 +5091,6 @@ static ssize_t mem_cgroup_read(struct cgroup *cont, struct cftype *cft,
type = MEMFILE_TYPE(cft->private);
name = MEMFILE_ATTR(cft->private);
- if (!do_swap_account && type == _MEMSWAP)
- return -EOPNOTSUPP;
-
switch (type) {
case _MEM:
if (name == RES_USAGE)
@@ -5329,9 +5326,6 @@ static int mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
type = MEMFILE_TYPE(cft->private);
name = MEMFILE_ATTR(cft->private);
- if (!do_swap_account && type == _MEMSWAP)
- return -EOPNOTSUPP;
-
switch (name) {
case RES_LIMIT:
if (mem_cgroup_is_root(memcg)) { /* Can't set limit on root */
@@ -5408,9 +5402,6 @@ static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)
type = MEMFILE_TYPE(event);
name = MEMFILE_ATTR(event);
- if (!do_swap_account && type == _MEMSWAP)
- return -EOPNOTSUPP;
-
switch (name) {
case RES_MAX_USAGE:
if (type == _MEM)
--
1.7.10.4
--
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>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] memcg: do not check for do_swap_account in mem_cgroup_{read,write,reset}
2013-03-19 13:06 [PATCH] memcg: do not check for do_swap_account in mem_cgroup_{read,write,reset} Michal Hocko
@ 2013-03-27 15:08 ` Johannes Weiner
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Weiner @ 2013-03-27 15:08 UTC (permalink / raw)
To: Michal Hocko
Cc: Andrew Morton, linux-mm, Kamezawa Hiroyuki, Tejun Heo,
linux-kernel
On Tue, Mar 19, 2013 at 02:06:55PM +0100, Michal Hocko wrote:
> since 2d11085e (memcg: do not create memsw files if swap accounting
> is disabled) memsw files are created only if memcg swap accounting is
> enabled so there doesn't make any sense to check for it explicitely in
> mem_cgroup_read, mem_cgroup_write and mem_cgroup_reset.
>
> Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-27 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 13:06 [PATCH] memcg: do not check for do_swap_account in mem_cgroup_{read,write,reset} Michal Hocko
2013-03-27 15:08 ` Johannes Weiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).