Go to file
Ralph Campbell dd2e2fa23a mm/memcg: fix device private memcg accounting
[ Upstream commit 9a137153fc8798a89d8fce895cd0a06ea5b8e37c ]

The code in mc_handle_swap_pte() checks for non_swap_entry() and returns
NULL before checking is_device_private_entry() so device private pages are
never handled.  Fix this by checking for non_swap_entry() after handling
device private swap PTEs.

I assume the memory cgroup accounting would be off somehow when moving
a process to another memory cgroup.  Currently, the device private page
is charged like a normal anonymous page when allocated and is uncharged
when the page is freed so I think that path is OK.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Link: https://lkml.kernel.org/r/20201009215952.2726-1-rcampbell@nvidia.com
xFixes: c733a82874a7 ("mm/memcontrol: support MEMORY_DEVICE_PRIVATE")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-16 16:38:46 +08:00
Documentation x86/fpu: Allow multiple bits in clearcpuid= parameter 2021-03-16 16:38:22 +08:00
LICENSES Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arch x86/events/amd/iommu: Fix sizeof mismatch 2021-03-16 16:38:24 +08:00
block blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue 2021-03-16 16:38:30 +08:00
certs Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crypto crypto: algif_skcipher - EBUSY on aio should be an error 2021-03-16 16:38:24 +08:00
drivers net: korina: fix kfree of rx/tx descriptor array 2021-03-16 16:38:46 +08:00
fs quota: clear padding in v2r1_mem2diskdqb() 2021-03-16 16:38:41 +08:00
include netfilter: nf_log: missing vlan offload tag and proto 2021-03-16 16:38:46 +08:00
init kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot 2021-03-16 16:37:39 +08:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2021-03-16 16:27:51 +08:00
kernel sched/fair: Fix wrong cpu selecting from isolated domain 2021-03-16 16:38:23 +08:00
lib Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts 2021-03-16 16:37:52 +08:00
mm mm/memcg: fix device private memcg accounting 2021-03-16 16:38:46 +08:00
net netfilter: nf_log: missing vlan offload tag and proto 2021-03-16 16:38:46 +08:00
package config/arm64: OPEN CONFIG_PSI and phytium configs 2021-03-16 11:02:59 +08:00
samples bpf: Fix fds_example SIGSEGV error 2021-03-16 16:33:24 +08:00
scripts scripts/dtc: only append to HOST_EXTRACFLAGS instead of overwriting 2021-03-16 16:37:50 +08:00
security ima: Don't ignore errors from crypto_shash_update() 2021-03-16 16:38:21 +08:00
sound ASoC: fsl_sai: Instantiate snd_soc_dai_driver 2021-03-16 16:38:42 +08:00
tools selftests: rtnetlink: load fou module for kci_test_encap_fou() test 2021-03-16 16:38:18 +08:00
usr Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virt KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch 2021-03-16 16:37:40 +08:00
.clang-format Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.cocciconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.get_maintainer.ignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitattributes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
COPYING Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
CREDITS Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kbuild Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2021-03-16 16:34:24 +08:00
Makefile kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
README Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
README.md Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
backport_remove_lists.txt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tools_key.pub Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00

README.md

Tencent Linux Kernel 4.0