OpenCloudOS-Kernel/drivers/staging
Vladimir Davydov 5d097056c9 kmemcg: account certain kmem allocations to memcg
Mark those kmem allocations that are known to be easily triggered from
userspace as __GFP_ACCOUNT/SLAB_ACCOUNT, which makes them accounted to
memcg.  For the list, see below:

 - threadinfo
 - task_struct
 - task_delay_info
 - pid
 - cred
 - mm_struct
 - vm_area_struct and vm_region (nommu)
 - anon_vma and anon_vma_chain
 - signal_struct
 - sighand_struct
 - fs_struct
 - files_struct
 - fdtable and fdtable->full_fds_bits
 - dentry and external_name
 - inode for all filesystems. This is the most tedious part, because
   most filesystems overwrite the alloc_inode method.

The list is far from complete, so feel free to add more objects.
Nevertheless, it should be close to "account everything" approach and
keep most workloads within bounds.  Malevolent users will be able to
breach the limit, but this was possible even with the former "account
everything" approach (simply because it did not account everything in
fact).

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Greg Thelen <gthelen@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-14 16:00:49 -08:00
..
android Staging patches for 4.5-rc1 2016-01-13 10:13:36 -08:00
board staging: board: Set PM domain before probe 2015-10-29 09:05:57 +09:00
clocking-wizard
comedi STAGING: COMEDI: Using kernel types in plx9080.h 2015-12-21 16:02:21 -08:00
dgap staging: dgap: add spaces around binary operator '|' 2015-10-24 19:33:42 -07:00
dgnc staging: dgnc: dgnc_cls.c: Replaced udelay by usleep_range 2015-12-21 15:52:34 -08:00
emxx_udc staging: emxx_udc: use list_first_entry_or_null() 2015-12-21 18:32:52 -08:00
fbtft spi: Updates for v4.4 2015-11-05 13:15:12 -08:00
fsl-mc staging: fsl-mc: section mismatch bug fix 2015-10-27 14:40:14 +09:00
fwserial Staging: fwserial: Declare fwtty_port_put as static 2015-11-15 20:02:47 -08:00
gdm72xx staging: gdm72xx: add userspace data struct 2015-12-26 17:13:33 -08:00
gdm724x staging: gdm724x: constify tty_port_operations structs 2015-12-26 17:13:33 -08:00
goldfish
gs_fpgaboot
iio Third set of new stuff for IIO in the 4.5 cycle. 2015-12-26 17:05:25 -08:00
lustre kmemcg: account certain kmem allocations to memcg 2016-01-14 16:00:49 -08:00
media media updates for v4.5-rc1 2016-01-13 11:46:37 -08:00
most staging: most: Delete an unnecessary check before the function call "module_put" 2015-11-15 20:02:47 -08:00
mt29f_spinand staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers 2016-01-07 10:23:41 -08:00
netlogic staging: netlogic: Fix build error due to missed API change 2016-01-10 22:06:58 -05:00
nvec staging: nvec: Add space around '<<' 2015-11-15 20:02:47 -08:00
octeon Staging patches for 4.5-rc1 2016-01-13 10:13:36 -08:00
octeon-usb staging: octeon-usb: Replace kmalloc with kmalloc_array 2015-10-24 19:28:52 -07:00
olpc_dcon Staging: olpc_dcon: Remove NULL comparison 2015-10-16 23:06:38 -07:00
panel Staging: panel: Logical continuations should be on the previous line 2015-10-29 07:55:17 +09:00
rdma staging/rdma/hfi1: Fix module parameter spelling 2015-12-21 14:01:14 -08:00
rtl8188eu staging: rtl8188eu: goto removed 2015-11-15 20:02:47 -08:00
rtl8192e staging: rtl8192e: Remove unnecessary variable 2015-11-15 20:02:47 -08:00
rtl8192u staging: rtl8192u: Remove unnecessary function 2015-11-15 20:02:47 -08:00
rtl8712 staging: rtl8712: rtl871x_mlme: Remove wrapper function 2015-11-15 20:02:47 -08:00
rtl8723au Staging: rtl8723au: Declare function static 2015-11-15 20:02:47 -08:00
rts5208 Staging: rts5208: use dmam_alloc_coherent 2015-10-16 23:17:26 -07:00
skein skein: fix coding style 2015-10-24 19:30:12 -07:00
slicoss staging: slicoss: Fixes block comment style 2015-10-27 14:43:31 +09:00
sm750fb Staging: sm750fb: Remove unused modedb.h file 2015-11-15 20:02:47 -08:00
speakup Staging driver update for 4.4-rc1 2015-11-04 21:40:53 -08:00
ste_rmi4
unisys staging: unisys: better config switch comments 2015-11-25 08:42:14 -08:00
vme drivers: staging: vme: Deleted casting to (void *) 2015-11-24 15:30:50 -08:00
vt6655 staging: vt6655: Add space around '*' 2015-10-24 19:38:48 -07:00
vt6656 staging: vt6656: remove address from GPL text 2015-11-19 16:53:09 -08:00
wilc1000 staging: wilc1000: bug fix on memory free 2015-12-21 13:21:09 -08:00
wlan-ng Staging: wlan-ng: Remove unused function declaration 2015-11-15 20:02:47 -08:00
xgifb Staging: xgifb: Remove space after cast 2015-10-24 19:11:30 -07:00
Kconfig staging: ft1000: remove obsolete driver 2015-10-24 19:19:43 -07:00
Makefile staging: ft1000: remove obsolete driver 2015-10-24 19:19:43 -07:00
staging.c