* + memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch added to -mm tree
@ 2021-07-28 22:30 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-28 22:30 UTC (permalink / raw)
To: mm-commits, shakeelb, mhocko, hannes, guro, vvs
The patch titled
Subject: memcg: replace in_interrupt() by !in_task() in active_memcg()
has been added to the -mm tree. Its filename is
memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch
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: Vasily Averin <vvs@virtuozzo.com>
Subject: memcg: replace in_interrupt() by !in_task() in active_memcg()
set_active_memcg() uses in_interrupt() check to select proper storage for
cgroup: pointer on task struct or per-cpu pointer.
It isn't fully correct: obsoleted in_interrupt() includes tasks with
disabled BH. It's better to use '!in_task()' instead.
Link: https://lkml.org/lkml/2021/7/26/487
Link: https://lkml.kernel.org/r/ed4448b0-4970-616f-7368-ef9dd3cb628d@virtuozzo.com
Fixes: 37d5985c003d ("mm: kmem: prepare remote memcg charging infra for interrupt contexts")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/sched/mm.h | 2 +-
mm/memcontrol.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/include/linux/sched/mm.h~memcg-replace-in_interrupt-by-in_task-in-active_memcg
+++ a/include/linux/sched/mm.h
@@ -306,7 +306,7 @@ set_active_memcg(struct mem_cgroup *memc
{
struct mem_cgroup *old;
- if (in_interrupt()) {
+ if (!in_task()) {
old = this_cpu_read(int_active_memcg);
this_cpu_write(int_active_memcg, memcg);
} else {
--- a/mm/memcontrol.c~memcg-replace-in_interrupt-by-in_task-in-active_memcg
+++ a/mm/memcontrol.c
@@ -878,7 +878,7 @@ EXPORT_SYMBOL(mem_cgroup_from_task);
static __always_inline struct mem_cgroup *active_memcg(void)
{
- if (in_interrupt())
+ if (!in_task())
return this_cpu_read(int_active_memcg);
else
return current->active_memcg;
_
Patches currently in -mm which might be from vvs@virtuozzo.com are
memcg-enable-accounting-for-pids-in-nested-pid-namespaces.patch
memcg-enable-accounting-for-mnt_cache-entries.patch
memcg-enable-accounting-for-pollfd-and-select-bits-arrays.patch
memcg-enable-accounting-for-file-lock-caches.patch
memcg-enable-accounting-for-fasync_cache.patch
memcg-enable-accounting-for-new-namesapces-and-struct-nsproxy.patch
memcg-enable-accounting-of-ipc-resources.patch
memcg-enable-accounting-for-signals.patch
memcg-enable-accounting-for-posix_timers_cache-slab.patch
memcg-enable-accounting-for-ldt_struct-objects.patch
memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-28 22:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 22:30 + memcg-replace-in_interrupt-by-in_task-in-active_memcg.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.