diff options
author | Michal Hocko <[email protected]> | 2013-02-22 16:34:43 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2013-02-23 17:50:17 -0800 |
commit | 2d11085e404f7b45ac4de60db2c9685e349c172d (patch) | |
tree | afc63263964e8b0167113419e2d375e9fd72d4fb /drivers/scsi/mpt3sas/mpi/mpi2_raid.h | |
parent | 75f7ad8e043d9383337d917584297f7737154bbf (diff) |
memcg: do not create memsw files if swap accounting is disabled
Zhouping Liu has reported that memsw files are exported even though swap
accounting is runtime disabled if MEMCG_SWAP is enabled. This behavior
has been introduced by commit af36f906c0f4 ("memcg: always create memsw
files if CGROUP_MEM_RES_CTLR_SWAP") and it causes any attempt to open
the file to return EOPNOTSUPP. Although EOPNOTSUPP should say be clear
that memsw operations are not supported in the given configuration it is
fair to say that this behavior could be quite confusing.
Let's tear memsw files out of default cgroup files and add them only if
the swap accounting is really enabled (either by MEMCG_SWAP_ENABLED or
swapaccount=1 boot parameter). We can hook into mem_cgroup_init which
is called when the memcg subsystem is initialized and which happens
after boot command line is processed.
Signed-off-by: Michal Hocko <[email protected]>
Reported-by: Zhouping Liu <[email protected]>
Tested-by: Zhouping Liu <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: CAI Qian <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions