The patch titled
Subject: mm: memcontrol: fix get_active_memcg return value
has been added to the -mm tree. Its filename is
mm-memcontrol-fix-get_active_memcg-return-value.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-fix-get_active_memc…
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-fix-get_active_memc…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Muchun Song <songmuchun(a)bytedance.com>
Subject: mm: memcontrol: fix get_active_memcg return value
We use a global percpu int_active_memcg variable to store the remote memcg
when we are in the interrupt context. But get_active_memcg always return
the current->active_memcg or root_mem_cgroup. The remote memcg (set in
the interrupt context) is ignored. This is not what we want. So fix it.
Link: https://lkml.kernel.org/r/20210223091101.42150-1-songmuchun@bytedance.com
Fixes: 37d5985c003d ("mm: kmem: prepare remote memcg charging infra for interrupt contexts")
Signed-off-by: Muchun Song <songmuchun(a)bytedance.com>
Reviewed-by: Shakeel Butt <shakeelb(a)google.com>
Reviewed-by: Roman Gushchin <guro(a)fb.com>
Cc: Johannes Weiner <hannes(a)cmpxchg.org>
Cc: Michal Hocko <mhocko(a)kernel.org>
Cc: Vladimir Davydov <vdavydov.dev(a)gmail.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/memcontrol.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
--- a/mm/memcontrol.c~mm-memcontrol-fix-get_active_memcg-return-value
+++ a/mm/memcontrol.c
@@ -1061,13 +1061,9 @@ static __always_inline struct mem_cgroup
rcu_read_lock();
memcg = active_memcg();
- if (memcg) {
- /* current->active_memcg must hold a ref. */
- if (WARN_ON_ONCE(!css_tryget(&memcg->css)))
- memcg = root_mem_cgroup;
- else
- memcg = current->active_memcg;
- }
+ /* remote memcg must hold a ref. */
+ if (memcg && WARN_ON_ONCE(!css_tryget(&memcg->css)))
+ memcg = root_mem_cgroup;
rcu_read_unlock();
return memcg;
_
Patches currently in -mm which might be from songmuchun(a)bytedance.com are
mm-memcontrol-optimize-per-lruvec-stats-counter-memory-usage.patch
mm-memcontrol-fix-nr_anon_thps-accounting-in-charge-moving.patch
mm-memcontrol-convert-nr_anon_thps-account-to-pages.patch
mm-memcontrol-convert-nr_file_thps-account-to-pages.patch
mm-memcontrol-convert-nr_shmem_thps-account-to-pages.patch
mm-memcontrol-convert-nr_shmem_pmdmapped-account-to-pages.patch
mm-memcontrol-convert-nr_file_pmdmapped-account-to-pages.patch
mm-memcontrol-make-the-slab-calculation-consistent.patch
mm-memcontrol-replace-the-loop-with-a-list_for_each_entry.patch
mm-memcontrol-fix-swap-undercounting-in-cgroup2.patch
mm-memcontrol-fix-get_active_memcg-return-value.patch
hugetlb-convert-page_huge_active-hpagemigratable-flag-fix.patch
This is the start of the stable review cycle for the 4.9.258 release.
There are 49 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 24 Feb 2021 12:07:46 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.258-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.258-rc1
Lai Jiangshan <laijs(a)linux.alibaba.com>
kvm: check tlbs_dirty directly
Arun Easi <aeasi(a)marvell.com>
scsi: qla2xxx: Fix crash during driver load on big endian machines
Jan Beulich <jbeulich(a)suse.com>
xen-blkback: fix error handling in xen_blkbk_map()
Jan Beulich <jbeulich(a)suse.com>
xen-scsiback: don't "handle" error by BUG()
Jan Beulich <jbeulich(a)suse.com>
xen-netback: don't "handle" error by BUG()
Jan Beulich <jbeulich(a)suse.com>
xen-blkback: don't "handle" error by BUG()
Stefano Stabellini <stefano.stabellini(a)xilinx.com>
xen/arm: don't ignore return errors from set_phys_to_machine
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: correct error checking in gntdev_map_grant_pages()
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
Jan Beulich <jbeulich(a)suse.com>
Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
Jan Beulich <jbeulich(a)suse.com>
Xen/x86: don't bail early from clear_foreign_p2m_mapping()
Vasily Gorbik <gor(a)linux.ibm.com>
tracing: Avoid calling cc-option -mrecord-mcount for every Makefile
Greg Thelen <gthelen(a)google.com>
tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount
Andi Kleen <ak(a)linux.intel.com>
trace: Use -mcount-record for dynamic ftrace
Borislav Petkov <bp(a)suse.de>
x86/build: Disable CET instrumentation in the kernel for 32-bit too
Stefano Garzarella <sgarzare(a)redhat.com>
vsock: fix locking in vsock_shutdown()
Stefano Garzarella <sgarzare(a)redhat.com>
vsock/virtio: update credit only if socket is not closed
Edwin Peer <edwin.peer(a)broadcom.com>
net: watchdog: hold device global xmit lock during tx disable
Norbert Slusarek <nslusarek(a)gmx.net>
net/vmw_vsock: improve locking in vsock_connect_timeout()
Serge Semin <Sergey.Semin(a)baikalelectronics.ru>
usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
Felipe Balbi <balbi(a)kernel.org>
usb: dwc3: ulpi: fix checkpatch warning
Randy Dunlap <rdunlap(a)infradead.org>
h8300: fix PREEMPTION build, TI_PRE_COUNT undefined
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: skip identical origin tuple in same zone only
Juergen Gross <jgross(a)suse.com>
xen/netback: avoid race in xenvif_rx_ring_slots_available()
Jozsef Kadlecsik <kadlec(a)mail.kfki.hu>
netfilter: xt_recent: Fix attempt to update deleted entry
Bui Quang Minh <minhquangbui99(a)gmail.com>
bpf: Check for integer overflow when using roundup_pow_of_two()
Roman Gushchin <guro(a)fb.com>
memblock: do not start bottom-up allocations with kernel_end
Alexandre Belloni <alexandre.belloni(a)bootlin.com>
ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL
Amir Goldstein <amir73il(a)gmail.com>
ovl: skip getxattr of security labels
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Check length before giving out the filter buffer
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not count ftrace events in top level enable output
Phillip Lougher <phillip(a)squashfs.org.uk>
squashfs: add more sanity checks in xattr id lookup
Phillip Lougher <phillip(a)squashfs.org.uk>
squashfs: add more sanity checks in inode lookup
Phillip Lougher <phillip(a)squashfs.org.uk>
squashfs: add more sanity checks in id lookup
Thomas Gleixner <tglx(a)linutronix.de>
futex: Cure exit race
Peter Zijlstra <peterz(a)infradead.org>
futex: Change locking rules
Thomas Gleixner <tglx(a)linutronix.de>
futex: Ensure the correct return value from futex_lock_pi()
Theodore Ts'o <tytso(a)mit.edu>
memcg: fix a crash in wb_workfn when a device disappears
Qian Cai <cai(a)lca.pw>
include/trace/events/writeback.h: fix -Wstringop-truncation warnings
Tobin C. Harding <tobin(a)kernel.org>
lib/string: Add strscpy_pad() function
Dave Wysochanski <dwysocha(a)redhat.com>
SUNRPC: Handle 0 length opaque XDR object data properly
Dave Wysochanski <dwysocha(a)redhat.com>
SUNRPC: Move simple_get_bytes and simple_get_netobj into private header
Johannes Berg <johannes.berg(a)intel.com>
iwlwifi: mvm: guard against device removal in reprobe
Emmanuel Grumbach <emmanuel.grumbach(a)intel.com>
iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
Johannes Berg <johannes.berg(a)intel.com>
iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
Cong Wang <cong.wang(a)bytedance.com>
af_key: relax availability checks for skb size calculation
Sibi Sankar <sibis(a)codeaurora.org>
remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
fgraph: Initialize tracing_graph_pause at task creation
Johannes Weiner <hannes(a)cmpxchg.org>
mm: memcontrol: fix NULL pointer crash in test_clear_page_writeback()
-------------
Diffstat:
Makefile | 11 +-
arch/arm/boot/dts/lpc32xx.dtsi | 3 -
arch/arm/xen/p2m.c | 6 +-
arch/h8300/kernel/asm-offsets.c | 3 +
arch/x86/Makefile | 6 +-
arch/x86/xen/p2m.c | 15 +-
drivers/block/xen-blkback/blkback.c | 30 +--
.../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 3 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 +-
drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 5 +
drivers/net/xen-netback/netback.c | 4 +-
drivers/net/xen-netback/rx.c | 9 +-
drivers/remoteproc/qcom_q6v5_pil.c | 6 +
drivers/scsi/qla2xxx/qla_tmpl.c | 9 +-
drivers/scsi/qla2xxx/qla_tmpl.h | 2 +-
drivers/usb/dwc3/ulpi.c | 20 +-
drivers/xen/gntdev.c | 33 ++-
drivers/xen/xen-scsiback.c | 4 +-
fs/fs-writeback.c | 2 +-
fs/overlayfs/copy_up.c | 15 +-
fs/squashfs/export.c | 41 +++-
fs/squashfs/id.c | 40 +++-
fs/squashfs/squashfs_fs_sb.h | 1 +
fs/squashfs/super.c | 6 +-
fs/squashfs/xattr.h | 10 +-
fs/squashfs/xattr_id.c | 66 +++++-
include/linux/backing-dev.h | 10 +
include/linux/ftrace.h | 4 +-
include/linux/memcontrol.h | 33 ++-
include/linux/netdevice.h | 2 +
include/linux/string.h | 4 +
include/linux/sunrpc/xdr.h | 3 +-
include/trace/events/writeback.h | 35 ++--
include/xen/grant_table.h | 1 +
kernel/bpf/stackmap.c | 2 +
kernel/futex.c | 233 +++++++++++++++++----
kernel/trace/ftrace.c | 2 -
kernel/trace/trace.c | 2 +-
kernel/trace/trace_events.c | 3 +-
lib/string.c | 47 ++++-
mm/backing-dev.c | 1 +
mm/memblock.c | 48 +----
mm/memcontrol.c | 43 ++--
mm/page-writeback.c | 14 +-
net/key/af_key.c | 6 +-
net/netfilter/nf_conntrack_core.c | 3 +-
net/netfilter/xt_recent.c | 12 +-
net/sunrpc/auth_gss/auth_gss.c | 30 +--
net/sunrpc/auth_gss/auth_gss_internal.h | 45 ++++
net/sunrpc/auth_gss/gss_krb5_mech.c | 31 +--
net/vmw_vsock/af_vsock.c | 13 +-
net/vmw_vsock/virtio_transport_common.c | 4 +-
scripts/Makefile.build | 3 +
virt/kvm/kvm_main.c | 3 +-
54 files changed, 681 insertions(+), 309 deletions(-)
This is the start of the stable review cycle for the 4.19.177 release.
There are 50 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 24 Feb 2021 12:07:46 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.177-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.177-rc1
Lai Jiangshan <laijs(a)linux.alibaba.com>
kvm: check tlbs_dirty directly
Arun Easi <aeasi(a)marvell.com>
scsi: qla2xxx: Fix crash during driver load on big endian machines
Jan Beulich <jbeulich(a)suse.com>
xen-blkback: fix error handling in xen_blkbk_map()
Jan Beulich <jbeulich(a)suse.com>
xen-scsiback: don't "handle" error by BUG()
Jan Beulich <jbeulich(a)suse.com>
xen-netback: don't "handle" error by BUG()
Jan Beulich <jbeulich(a)suse.com>
xen-blkback: don't "handle" error by BUG()
Stefano Stabellini <stefano.stabellini(a)xilinx.com>
xen/arm: don't ignore return errors from set_phys_to_machine
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: correct error checking in gntdev_map_grant_pages()
Jan Beulich <jbeulich(a)suse.com>
Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages()
Jan Beulich <jbeulich(a)suse.com>
Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
Jan Beulich <jbeulich(a)suse.com>
Xen/x86: don't bail early from clear_foreign_p2m_mapping()
Loic Poulain <loic.poulain(a)linaro.org>
net: qrtr: Fix port ID for control messages
Paolo Bonzini <pbonzini(a)redhat.com>
KVM: SEV: fix double locking due to incorrect backport
Borislav Petkov <bp(a)suse.de>
x86/build: Disable CET instrumentation in the kernel for 32-bit too
Miklos Szeredi <mszeredi(a)redhat.com>
ovl: expand warning in ovl_d_real()
Sabyrzhan Tasbolatov <snovitoll(a)gmail.com>
net/qrtr: restrict user-controlled length in qrtr_tun_write_iter()
Sabyrzhan Tasbolatov <snovitoll(a)gmail.com>
net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS
Stefano Garzarella <sgarzare(a)redhat.com>
vsock: fix locking in vsock_shutdown()
Stefano Garzarella <sgarzare(a)redhat.com>
vsock/virtio: update credit only if socket is not closed
Edwin Peer <edwin.peer(a)broadcom.com>
net: watchdog: hold device global xmit lock during tx disable
Norbert Slusarek <nslusarek(a)gmx.net>
net/vmw_vsock: improve locking in vsock_connect_timeout()
NeilBrown <neilb(a)suse.de>
net: fix iteration for sctp transport seq_files
Serge Semin <Sergey.Semin(a)baikalelectronics.ru>
usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
Felipe Balbi <balbi(a)kernel.org>
usb: dwc3: ulpi: fix checkpatch warning
Randy Dunlap <rdunlap(a)infradead.org>
h8300: fix PREEMPTION build, TI_PRE_COUNT undefined
Alain Volmat <alain.volmat(a)foss.st.com>
i2c: stm32f7: fix configuration of the digital filter
Fangrui Song <maskray(a)google.com>
firmware_loader: align .builtin_fw to 8
Yufeng Mo <moyufeng(a)huawei.com>
net: hns3: add a check for queue_id in hclge_reset_vf_queue()
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: skip identical origin tuple in same zone only
Mohammad Athari Bin Ismail <mohammad.athari.ismail(a)intel.com>
net: stmmac: set TxQ mode back to DCB after disabling CBS
Juergen Gross <jgross(a)suse.com>
xen/netback: avoid race in xenvif_rx_ring_slots_available()
Sven Auhagen <sven.auhagen(a)voleatech.de>
netfilter: flowtable: fix tcp and udp header checksum update
Jozsef Kadlecsik <kadlec(a)mail.kfki.hu>
netfilter: xt_recent: Fix attempt to update deleted entry
Bui Quang Minh <minhquangbui99(a)gmail.com>
bpf: Check for integer overflow when using roundup_pow_of_two()
Lorenzo Bianconi <lorenzo(a)kernel.org>
mt76: dma: fix a possible memory leak in mt76_add_fragment()
Russell King <rmk+kernel(a)armlinux.org.uk>
ARM: kexec: fix oops after TLB are invalidated
Russell King <rmk+kernel(a)armlinux.org.uk>
ARM: ensure the signal page contains defined contents
Alexandre Belloni <alexandre.belloni(a)bootlin.com>
ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL
Lin Feng <linf(a)wangsu.com>
bfq-iosched: Revert "bfq: Fix computation of shallow depth"
Alexandre Ghiti <alex(a)ghiti.fr>
riscv: virt_addr_valid must check the address belongs to linear mapping
Victor Lu <victorchengchi.lu(a)amd.com>
drm/amd/display: Free atomic state after drm_atomic_commit
Victor Lu <victorchengchi.lu(a)amd.com>
drm/amd/display: Fix dc_sink kref count in emulated_link_detect
Amir Goldstein <amir73il(a)gmail.com>
ovl: skip getxattr of security labels
Miklos Szeredi <mszeredi(a)redhat.com>
cap: fix conversions on getxattr
Miklos Szeredi <mszeredi(a)redhat.com>
ovl: perform vfs_getxattr() with mounter creds
Hans de Goede <hdegoede(a)redhat.com>
platform/x86: hp-wmi: Disable tablet-mode reporting by default
Marc Zyngier <maz(a)kernel.org>
arm64: dts: rockchip: Fix PCIe DT properties on rk3399
Julien Grall <jgrall(a)amazon.com>
arm/xen: Don't probe xenbus as part of an early initcall
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Check length before giving out the filter buffer
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Do not count ftrace events in top level enable output
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/lpc32xx.dtsi | 3 -
arch/arm/include/asm/kexec-internal.h | 12 ++++
arch/arm/kernel/asm-offsets.c | 5 ++
arch/arm/kernel/machine_kexec.c | 20 +++----
arch/arm/kernel/relocate_kernel.S | 38 ++++--------
arch/arm/kernel/signal.c | 14 +++--
arch/arm/xen/enlighten.c | 2 -
arch/arm/xen/p2m.c | 6 +-
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 +-
arch/h8300/kernel/asm-offsets.c | 3 +
arch/riscv/include/asm/page.h | 5 +-
arch/x86/Makefile | 6 +-
arch/x86/kvm/svm.c | 1 -
arch/x86/xen/p2m.c | 15 +++--
block/bfq-iosched.c | 8 +--
drivers/block/xen-blkback/blkback.c | 30 +++++-----
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 +++---
drivers/i2c/busses/i2c-stm32f7.c | 11 +++-
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 7 ++-
drivers/net/wireless/mediatek/mt76/dma.c | 8 ++-
drivers/net/xen-netback/netback.c | 4 +-
drivers/net/xen-netback/rx.c | 9 ++-
drivers/platform/x86/hp-wmi.c | 14 +++--
drivers/scsi/qla2xxx/qla_tmpl.c | 9 +--
drivers/scsi/qla2xxx/qla_tmpl.h | 2 +-
drivers/usb/dwc3/ulpi.c | 20 +++++--
drivers/xen/gntdev.c | 37 ++++++------
drivers/xen/xen-scsiback.c | 4 +-
drivers/xen/xenbus/xenbus.h | 1 -
drivers/xen/xenbus/xenbus_probe.c | 2 +-
fs/overlayfs/copy_up.c | 15 ++---
fs/overlayfs/inode.c | 2 +
fs/overlayfs/super.c | 13 +++--
include/asm-generic/vmlinux.lds.h | 2 +-
include/linux/netdevice.h | 2 +
include/xen/grant_table.h | 1 +
include/xen/xenbus.h | 2 -
kernel/bpf/stackmap.c | 2 +
kernel/trace/trace.c | 2 +-
kernel/trace/trace_events.c | 3 +-
net/netfilter/nf_conntrack_core.c | 3 +-
net/netfilter/nf_flow_table_core.c | 4 +-
net/netfilter/xt_recent.c | 12 +++-
net/qrtr/qrtr.c | 2 +-
net/qrtr/tun.c | 6 ++
net/rds/rdma.c | 3 +
net/sctp/proc.c | 16 ++++--
net/vmw_vsock/af_vsock.c | 13 ++---
net/vmw_vsock/hyperv_transport.c | 4 --
net/vmw_vsock/virtio_transport_common.c | 4 +-
security/commoncap.c | 67 ++++++++++++++--------
virt/kvm/kvm_main.c | 3 +-
54 files changed, 303 insertions(+), 205 deletions(-)