]>
git.karo-electronics.de Git - karo-tx-linux.git/log
KAMEZAWA Hiroyuki [Fri, 16 Dec 2011 04:49:23 +0000 (15:49 +1100)]
memcg: add mem_cgroup_replace_page_cache() to fix LRU issue
Commit
ef6a3c6311 ("mm: add replace_page_cache_page() function") added a
function replace_page_cache_page(). This function replaces a page in the
radix-tree with a new page. WHen doing this, memory cgroup needs to fix
up the accounting information. memcg need to check PCG_USED bit etc.
In some(many?) cases, 'newpage' is on LRU before calling
replace_page_cache(). So, memcg's LRU accounting information should be
fixed, too.
This patch adds mem_cgroup_replace_page_cache() and removes the old hooks.
In that function, old pages will be unaccounted without touching
res_counter and new page will be accounted to the memcg (of old page).
WHen overwriting pc->mem_cgroup of newpage, take zone->lru_lock and avoid
races with LRU handling.
Background:
replace_page_cache_page() is called by FUSE code in its splice() handling.
Here, 'newpage' is replacing oldpage but this newpage is not a newly allocated
page and may be on LRU. LRU mis-accounting will be critical for memory cgroup
because rmdir() checks the whole LRU is empty and there is no account leak.
If a page is on the other LRU than it should be, rmdir() will fail.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stephen Rothwell [Wed, 21 Dec 2011 05:37:52 +0000 (16:37 +1100)]
Merge remote-tracking branch 'uapi/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:36:18 +0000 (16:36 +1100)]
Merge remote-tracking branch 'kvmtool/master'
Conflicts:
include/net/9p/9p.h
scripts/kconfig/Makefile
Stephen Rothwell [Wed, 21 Dec 2011 05:31:53 +0000 (16:31 +1100)]
Merge remote-tracking branch 'remoteproc/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:30:22 +0000 (16:30 +1100)]
Merge remote-tracking branch 'xshm/xshm-for-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:27:11 +0000 (16:27 +1100)]
Merge remote-tracking branch 'kmap_atomic/kmap_atomic'
Conflicts:
Documentation/feature-removal-schedule.txt
Stephen Rothwell [Wed, 21 Dec 2011 05:20:32 +0000 (16:20 +1100)]
Merge remote-tracking branch 'vhost/linux-next'
Conflicts:
arch/hexagon/Kconfig
arch/m68k/Kconfig
arch/score/Kconfig
Stephen Rothwell [Wed, 21 Dec 2011 05:19:02 +0000 (16:19 +1100)]
Merge remote-tracking branch 'pinctrl/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:12:36 +0000 (16:12 +1100)]
Merge remote-tracking branch 'writeback/writeback-for-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:10:42 +0000 (16:10 +1100)]
Merge remote-tracking branch 'tmem/tmem'
Conflicts:
mm/swapfile.c
Stephen Rothwell [Wed, 21 Dec 2011 05:09:04 +0000 (16:09 +1100)]
Merge remote-tracking branch 'char-misc/char-misc-next'
Stephen Rothwell [Wed, 21 Dec 2011 05:07:24 +0000 (16:07 +1100)]
Merge remote-tracking branch 'staging/staging-next'
Conflicts:
drivers/hid/hid-hyperv.c
drivers/staging/hv/Kconfig
drivers/staging/hv/Makefile
drivers/staging/iio/adc/ad799x_core.c
Stephen Rothwell [Wed, 21 Dec 2011 04:57:20 +0000 (15:57 +1100)]
Merge remote-tracking branch 'usb/usb-next'
Stephen Rothwell [Wed, 21 Dec 2011 04:55:21 +0000 (15:55 +1100)]
Merge remote-tracking branch 'tty/tty-next'
Conflicts:
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
Stephen Rothwell [Wed, 21 Dec 2011 04:48:27 +0000 (15:48 +1100)]
Merge remote-tracking branch 'driver-core/driver-core-next'
Stephen Rothwell [Wed, 21 Dec 2011 04:46:55 +0000 (15:46 +1100)]
Merge remote-tracking branch 'hsi/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 04:45:25 +0000 (15:45 +1100)]
Merge remote-tracking branch 'regmap/for-next'
Conflicts:
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c
Stephen Rothwell [Wed, 21 Dec 2011 04:43:40 +0000 (15:43 +1100)]
Merge remote-tracking branch 'namespace/master'
Stephen Rothwell [Wed, 21 Dec 2011 04:42:03 +0000 (15:42 +1100)]
Merge remote-tracking branch 'sysctl/master'
Stephen Rothwell [Wed, 21 Dec 2011 04:35:55 +0000 (15:35 +1100)]
Merge remote-tracking branch 'xen-two/linux-next'
Conflicts:
arch/x86/xen/Kconfig
Stephen Rothwell [Wed, 21 Dec 2011 04:34:25 +0000 (15:34 +1100)]
Merge remote-tracking branch 'xen/upstream/xen'
Conflicts:
arch/x86/xen/Kconfig
Stephen Rothwell [Wed, 21 Dec 2011 04:28:10 +0000 (15:28 +1100)]
Merge remote-tracking branch 'oprofile/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 04:21:39 +0000 (15:21 +1100)]
Merge remote-tracking branch 'kmemleak/kmemleak'
Stephen Rothwell [Wed, 21 Dec 2011 04:15:20 +0000 (15:15 +1100)]
Merge remote-tracking branch 'cgroup/for-next'
Conflicts:
block/blk-cgroup.c
Stephen Rothwell [Wed, 21 Dec 2011 04:08:25 +0000 (15:08 +1100)]
Merge remote-tracking branch 'uprobes/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 04:02:05 +0000 (15:02 +1100)]
Merge remote-tracking branch 'rcu/rcu/next'
Stephen Rothwell [Wed, 21 Dec 2011 03:55:11 +0000 (14:55 +1100)]
Merge remote-tracking branch 'tip/auto-latest'
Conflicts:
arch/arm/mm/init.c
arch/powerpc/include/asm/cputime.h
Stephen Rothwell [Wed, 21 Dec 2011 03:52:37 +0000 (14:52 +1100)]
Merge remote-tracking branch 'gpio/gpio/next'
Stephen Rothwell [Wed, 21 Dec 2011 03:51:03 +0000 (14:51 +1100)]
Merge remote-tracking branch 'edac-amd/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:47:55 +0000 (14:47 +1100)]
Merge remote-tracking branch 'fsnotify/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:46:22 +0000 (14:46 +1100)]
Merge remote-tracking branch 'apm/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:39:25 +0000 (14:39 +1100)]
Merge remote-tracking branch 'pm/linux-next'
Conflicts:
fs/xfs/xfs_buf.c
Stephen Rothwell [Wed, 21 Dec 2011 03:32:27 +0000 (14:32 +1100)]
Merge remote-tracking branch 'trivial/for-next'
Conflicts:
arch/powerpc/platforms/40x/Kconfig
Stephen Rothwell [Wed, 21 Dec 2011 03:32:17 +0000 (14:32 +1100)]
Merge remote-tracking branch 'osd/linux-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:29:03 +0000 (14:29 +1100)]
Merge remote-tracking branch 'iommu/next'
Conflicts:
drivers/pci/hotplug/acpiphp_glue.c
include/linux/pci_regs.h
Stephen Rothwell [Wed, 21 Dec 2011 03:27:28 +0000 (14:27 +1100)]
Merge remote-tracking branch 'watchdog/linux-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:24:43 +0000 (14:24 +1100)]
Merge remote-tracking branch 'security/next'
Conflicts:
lib/Makefile
Stephen Rothwell [Wed, 21 Dec 2011 03:23:16 +0000 (14:23 +1100)]
Merge remote-tracking branch 'regulator/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:21:09 +0000 (14:21 +1100)]
Merge remote-tracking branch 'fbdev/fbdev-next'
Stephen Rothwell [Wed, 21 Dec 2011 03:16:22 +0000 (14:16 +1100)]
Merge remote-tracking branch 'drm/drm-next'
Conflicts:
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Stephen Rothwell [Wed, 21 Dec 2011 02:58:33 +0000 (13:58 +1100)]
Merge remote-tracking branch 'mfd/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:57:03 +0000 (13:57 +1100)]
Merge remote-tracking branch 'md/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:55:31 +0000 (13:55 +1100)]
Merge remote-tracking branch 'slab/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:55:22 +0000 (13:55 +1100)]
Merge remote-tracking branch 'kgdb/kgdb-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:53:54 +0000 (13:53 +1100)]
Merge remote-tracking branch 'mmc/mmc-next'
Conflicts:
drivers/mmc/card/block.c
Stephen Rothwell [Wed, 21 Dec 2011 02:52:21 +0000 (13:52 +1100)]
Merge remote-tracking branch 'battery/master'
Stephen Rothwell [Wed, 21 Dec 2011 02:49:51 +0000 (13:49 +1100)]
Merge remote-tracking branch 'block/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:48:18 +0000 (13:48 +1100)]
Merge remote-tracking branch 'input/next'
Conflicts:
drivers/input/keyboard/samsung-keypad.c
Stephen Rothwell [Wed, 21 Dec 2011 02:36:47 +0000 (13:36 +1100)]
Merge commit 'refs/next/
20111219 /rr'
Stephen Rothwell [Wed, 21 Dec 2011 02:30:32 +0000 (13:30 +1100)]
Merge remote-tracking branch 'cpufreq/next'
Stephen Rothwell [Wed, 21 Dec 2011 02:29:03 +0000 (13:29 +1100)]
Merge remote-tracking branch 'sound-asoc/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 02:27:18 +0000 (13:27 +1100)]
Merge remote-tracking branch 'sound/for-next'
Conflicts:
arch/arm/mach-s3c64xx/mach-crag6410.c
Stephen Rothwell [Wed, 21 Dec 2011 02:25:47 +0000 (13:25 +1100)]
Merge remote-tracking branch 'crypto/master'
Stephen Rothwell [Wed, 21 Dec 2011 02:24:20 +0000 (13:24 +1100)]
Merge remote-tracking branch 'l2-mtd/master'
Conflicts:
drivers/mtd/maps/bcm963xx-flash.c
Stephen Rothwell [Wed, 21 Dec 2011 02:19:40 +0000 (13:19 +1100)]
Merge remote-tracking branch 'mtd/master'
Stephen Rothwell [Wed, 21 Dec 2011 02:09:16 +0000 (13:09 +1100)]
Merge commit 'refs/next/
20111220 /bluetooth'
Stephen Rothwell [Wed, 21 Dec 2011 01:24:21 +0000 (12:24 +1100)]
Merge remote-tracking branch 'net-next/master'
Conflicts:
net/bluetooth/l2cap_core.c
Stephen Rothwell [Wed, 21 Dec 2011 01:20:41 +0000 (12:20 +1100)]
Merge remote-tracking branch 'slave-dma/next'
Conflicts:
drivers/dma/Kconfig
drivers/dma/pl330.c
Stephen Rothwell [Wed, 21 Dec 2011 01:04:28 +0000 (12:04 +1100)]
Merge remote-tracking branch 'target-merge/for-next-merge'
Stephen Rothwell [Wed, 21 Dec 2011 01:03:00 +0000 (12:03 +1100)]
Merge remote-tracking branch 'target-updates/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 01:01:16 +0000 (12:01 +1100)]
Merge remote-tracking branch 'scsi/master'
Stephen Rothwell [Wed, 21 Dec 2011 00:59:47 +0000 (11:59 +1100)]
Merge remote-tracking branch 'dlm/next'
Stephen Rothwell [Wed, 21 Dec 2011 00:58:24 +0000 (11:58 +1100)]
Merge remote-tracking branch 'ubi/linux-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:56:25 +0000 (11:56 +1100)]
Merge remote-tracking branch 'libata/NEXT'
Stephen Rothwell [Wed, 21 Dec 2011 00:56:21 +0000 (11:56 +1100)]
Merge remote-tracking branch 'kconfig/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:54:52 +0000 (11:54 +1100)]
Merge remote-tracking branch 'kbuild/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:51:28 +0000 (11:51 +1100)]
Merge remote-tracking branch 'v4l-dvb/master'
Stephen Rothwell [Wed, 21 Dec 2011 00:50:03 +0000 (11:50 +1100)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:48:41 +0000 (11:48 +1100)]
Merge branch 'quilt/jdelvare-hwmon'
Stephen Rothwell [Wed, 21 Dec 2011 00:47:18 +0000 (11:47 +1100)]
Merge remote-tracking branch 'bjdooks-i2c/next-i2c'
Conflicts:
drivers/i2c/busses/i2c-designware-platdrv.c
Stephen Rothwell [Wed, 21 Dec 2011 00:45:49 +0000 (11:45 +1100)]
Merge branch 'quilt/i2c'
Stephen Rothwell [Wed, 21 Dec 2011 00:44:20 +0000 (11:44 +1100)]
Merge remote-tracking branch 'hid/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:38:21 +0000 (11:38 +1100)]
Merge remote-tracking branch 'pci/linux-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:09:00 +0000 (11:09 +1100)]
Merge remote-tracking branch 'xfs/master'
Stephen Rothwell [Wed, 21 Dec 2011 00:07:38 +0000 (11:07 +1100)]
Merge remote-tracking branch 'ubifs/linux-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:06:07 +0000 (11:06 +1100)]
Merge remote-tracking branch 'nfsd/nfsd-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:04:43 +0000 (11:04 +1100)]
Merge remote-tracking branch 'logfs/master'
Conflicts:
fs/logfs/file.c
Stephen Rothwell [Wed, 21 Dec 2011 00:03:08 +0000 (11:03 +1100)]
Merge remote-tracking branch 'gfs2/master'
Stephen Rothwell [Wed, 21 Dec 2011 00:01:38 +0000 (11:01 +1100)]
Merge remote-tracking branch 'fuse/for-next'
Stephen Rothwell [Wed, 21 Dec 2011 00:00:13 +0000 (11:00 +1100)]
Merge remote-tracking branch 'ext4/dev'
Stephen Rothwell [Tue, 20 Dec 2011 23:58:50 +0000 (10:58 +1100)]
Merge remote-tracking branch 'ecryptfs/next'
Stephen Rothwell [Tue, 20 Dec 2011 23:57:23 +0000 (10:57 +1100)]
Merge remote-tracking branch 'xtensa/master'
Stephen Rothwell [Tue, 20 Dec 2011 23:55:57 +0000 (10:55 +1100)]
Merge remote-tracking branch 's390/features'
Stephen Rothwell [Tue, 20 Dec 2011 23:55:40 +0000 (10:55 +1100)]
Merge remote-tracking branch '52xx-and-virtex/powerpc/next'
Stephen Rothwell [Tue, 20 Dec 2011 23:53:17 +0000 (10:53 +1100)]
Merge remote-tracking branch '4xx/next'
Stephen Rothwell [Tue, 20 Dec 2011 23:50:55 +0000 (10:50 +1100)]
Merge remote-tracking branch 'powerpc/next'
Stephen Rothwell [Tue, 20 Dec 2011 23:49:29 +0000 (10:49 +1100)]
Merge remote-tracking branch 'parisc/for-next'
Stephen Rothwell [Tue, 20 Dec 2011 23:47:43 +0000 (10:47 +1100)]
Merge remote-tracking branch 'mips/mips-for-linux-next'
Conflicts:
arch/mips/kernel/perf_event_mipsxx.c
Stephen Rothwell [Tue, 20 Dec 2011 23:46:20 +0000 (10:46 +1100)]
Merge remote-tracking branch 'm68knommu/for-next'
Conflicts:
arch/m68k/Kconfig.debug
Stephen Rothwell [Tue, 20 Dec 2011 23:44:57 +0000 (10:44 +1100)]
Merge remote-tracking branch 'm68k/for-next'
Stephen Rothwell [Tue, 20 Dec 2011 23:43:34 +0000 (10:43 +1100)]
Merge remote-tracking branch 'ia64/next'
Stephen Rothwell [Tue, 20 Dec 2011 23:42:09 +0000 (10:42 +1100)]
Merge branch 'quilt/hexagon'
Stephen Rothwell [Tue, 20 Dec 2011 23:40:30 +0000 (10:40 +1100)]
Merge remote-tracking branch 'cris/for-next'
Stephen Rothwell [Tue, 20 Dec 2011 23:35:10 +0000 (10:35 +1100)]
Merge remote-tracking branch 'c6x/for-linux-next'
Stephen Rothwell [Tue, 20 Dec 2011 23:33:48 +0000 (10:33 +1100)]
Merge remote-tracking branch 'blackfin/for-linus'
Stephen Rothwell [Tue, 20 Dec 2011 23:32:29 +0000 (10:32 +1100)]
Merge remote-tracking branch 'tegra/for-next'
Conflicts:
arch/arm/mach-tegra/board-dt-tegra20.c
arch/arm/mach-tegra/common.c
Stephen Rothwell [Tue, 20 Dec 2011 23:23:37 +0000 (10:23 +1100)]
Merge remote-tracking branch 's5p/for-next'
Conflicts:
arch/arm/mach-exynos/cpu.c
arch/arm/mach-exynos/include/mach/entry-macro.S
Stephen Rothwell [Tue, 20 Dec 2011 23:22:05 +0000 (10:22 +1100)]
Merge remote-tracking branch 'i.MX/for-next'
Conflicts:
arch/arm/mach-imx/clock-imx35.c
arch/arm/mach-imx/clock-mx51-mx53.c
arch/arm/mach-imx/devices-imx53.h
arch/arm/mach-imx/mm-imx5.c
arch/arm/mach-mx5/Kconfig
arch/arm/mach-mx5/Makefile
arch/arm/mach-mx5/pm-imx5.c
arch/arm/plat-mxc/include/mach/hardware.h
Stephen Rothwell [Tue, 20 Dec 2011 23:14:09 +0000 (10:14 +1100)]
Merge remote-tracking branch 'arm-soc/for-next'
Conflicts:
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-mxs/include/mach/common.h
arch/arm/mach-omap2/board-ti8168evm.c
Stephen Rothwell [Tue, 20 Dec 2011 23:08:20 +0000 (10:08 +1100)]
Merge remote-tracking branch 'arm/for-next'
Conflicts:
arch/arm/mach-mxs/mach-m28evk.c
arch/arm/mach-mxs/mach-stmp378x_devb.c
arch/arm/mach-shmobile/board-kota2.c