forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm: kmem: make mem_cgroup_from_obj() vmalloc()-safe
Currently mem_cgroup_from_obj() is not working properly with objects allocated using vmalloc(). It creates problems in some cases, when it's called for static objects belonging to modules or generally allocated using vmalloc(). This patch makes mem_cgroup_from_obj() safe to be called on objects allocated using vmalloc(). It also introduces mem_cgroup_from_slab_obj(), which is a faster version to use in places when we know the object is either a slab object or a generic slab page (e.g. when adding an object to a lru list). Link: https://lkml.kernel.org/r/[email protected] Suggested-by: Kefeng Wang <[email protected]> Signed-off-by: Roman Gushchin <[email protected]> Tested-by: Linux Kernel Functional Testing <[email protected]> Acked-by: Shakeel Butt <[email protected]> Tested-by: Vasily Averin <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Muchun Song <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Naresh Kamboju <[email protected]> Cc: Qian Cai <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: David S. Miller <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Florian Westphal <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Michal Koutný <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information
Showing
3 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters