mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
memcg: do not check for do_swap_account in mem_cgroup_{read,write,reset}
Since commit 2d11085e40
("memcg: do not create memsw files if swap
accounting is disabled") memsw files are created only if memcg swap
accounting is enabled so it doesn't make any sense to check for it
explicitly in mem_cgroup_read(), mem_cgroup_write() and
mem_cgroup_reset().
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ee5df0570c
commit
acb6d558f4
@ -5025,9 +5025,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)
|
||||
@ -5162,9 +5159,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 */
|
||||
@ -5241,9 +5235,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)
|
||||
|
Loading…
Reference in New Issue
Block a user