diff options
| author | 2019-06-03 07:25:25 +0200 | |
|---|---|---|
| committer | 2019-06-03 07:25:25 +0200 | |
| commit | 119a7fdfeecefa5a4062256ac2dcd3b69eaa8414 (patch) | |
| tree | 40d834b32ce97857f3f974c95b64b6b48d415e6e /include/linux/memcontrol.h | |
| parent | usb: avoid redundant allocation and free of memory (diff) | |
| parent | Linux 5.2-rc3 (diff) | |
| download | linux-dev-119a7fdfeecefa5a4062256ac2dcd3b69eaa8414.tar.xz linux-dev-119a7fdfeecefa5a4062256ac2dcd3b69eaa8414.zip | |
Merge 5.2-rc3 into usb-next
we want the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/memcontrol.h')
| -rw-r--r-- | include/linux/memcontrol.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index bc74d6a4407c..edf9e8f32d70 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* memcontrol.h - Memory Controller * * Copyright IBM Corporation, 2007 @@ -5,16 +6,6 @@ * * Copyright 2007 OpenVZ SWsoft Inc * Author: Pavel Emelianov <xemul@openvz.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #ifndef _LINUX_MEMCONTROL_H @@ -746,8 +737,14 @@ static inline void count_memcg_event_mm(struct mm_struct *mm, static inline void memcg_memory_event(struct mem_cgroup *memcg, enum memcg_memory_event event) { - atomic_long_inc(&memcg->memory_events[event]); - cgroup_file_notify(&memcg->events_file); + do { + atomic_long_inc(&memcg->memory_events[event]); + cgroup_file_notify(&memcg->events_file); + + if (cgrp_dfl_root.flags & CGRP_ROOT_MEMORY_LOCAL_EVENTS) + break; + } while ((memcg = parent_mem_cgroup(memcg)) && + !mem_cgroup_is_root(memcg)); } static inline void memcg_memory_event_mm(struct mm_struct *mm, |
