No description
Find a file
Roman Gushchin 37d5985c00 mm: kmem: prepare remote memcg charging infra for interrupt contexts
Remote memcg charging API uses current->active_memcg to store the
currently active memory cgroup, which overwrites the memory cgroup of the
current process.  It works well for normal contexts, but doesn't work for
interrupt contexts: indeed, if an interrupt occurs during the execution of
a section with an active memcg set, all allocations inside the interrupt
will be charged to the active memcg set (given that we'll enable
accounting for allocations from an interrupt context).  But because the
interrupt might have no relation to the active memcg set outside, it's
obviously wrong from the accounting prospective.

To resolve this problem, let's add a global percpu int_active_memcg
variable, which will be used to store an active memory cgroup which will
be used from interrupt contexts.  set_active_memcg() will transparently
use current->active_memcg or int_active_memcg depending on the context.

To make the read part simple and transparent for the caller, let's
introduce two new functions:
  - struct mem_cgroup *active_memcg(void),
  - struct mem_cgroup *get_active_memcg(void).

They are returning the active memcg if it's set, hiding all implementation
details: where to get it depending on the current context.

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Link: http://lkml.kernel.org/r/20200827225843.1270629-4-guro@fb.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-10-18 09:27:09 -07:00
arch ia64: fix build error with !COREDUMP 2020-10-18 09:27:09 -07:00
block docs: bio: fix a kerneldoc markup 2020-10-15 07:49:48 +02:00
certs
crypto drivers-5.10-2020-10-12 2020-10-13 13:04:41 -07:00
Documentation RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
drivers RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
fs mm, memcg: rework remote charging API to support nesting 2020-10-18 09:27:09 -07:00
include mm: kmem: prepare remote memcg charging infra for interrupt contexts 2020-10-18 09:27:09 -07:00
init networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
ipc ipc: adjust proc_ipc_sem_dointvec definition to match prototype 2020-09-05 12:14:29 -07:00
kernel docs updates for v5.10-rc1 2020-10-16 15:02:21 -07:00
lib RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm: kmem: prepare remote memcg charging infra for interrupt contexts 2020-10-18 09:27:09 -07:00
net networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
samples networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
scripts docs updates for v5.10-rc1 2020-10-16 15:02:21 -07:00
security networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
sound dma-mapping updates for 5.10 2020-10-15 14:43:29 -07:00
tools perf tools changes for v5.10: 1st batch 2020-10-17 11:47:46 -07:00
usr
virt KVM: fix memory leak in kvm_io_bus_unregister_dev() 2020-09-11 13:15:11 -04:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: docs: ignore sphinx_*/ directories 2020-09-10 10:44:31 -06:00
.mailmap MAINTAINERS: jarkko.sakkinen@linux.intel.com -> jarkko@kernel.org 2020-10-16 11:11:19 -07:00
COPYING
CREDITS networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
Kbuild
Kconfig
MAINTAINERS RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
Makefile networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.