• Vlastimil Babka's avatar
    mm, slab: move slab_memcg hooks to mm/memcontrol.c · e6100a45
    Vlastimil Babka authored
    The hooks make multiple calls to functions in mm/memcontrol.c, including
    to th current_obj_cgroup() marked __always_inline.  It might be faster to
    make a single call to the hook in mm/memcontrol.c instead.  The hooks also
    don't use almost anything from mm/slub.c.  obj_full_size() can move with
    the hooks and cache_vmstat_idx() to the internal mm/slab.h
    
    Link: https://lkml.kernel.org/r/20240326-slab-memcg-v3-2-d85d2563287a@suse.czSigned-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Reviewed-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
    Cc: Al Viro <viro@ZenIV.linux.org.uk>
    Cc: Chengming Zhou <chengming.zhou@linux.dev>
    Cc: Christian Brauner <brauner@kernel.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Chuck Lever <chuck.lever@oracle.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Jeff Layton <jlayton@kernel.org>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Josh Poimboeuf <jpoimboe@kernel.org>
    Cc: Kees Cook <kees@kernel.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Pekka Enberg <penberg@kernel.org>
    Cc: Shakeel Butt <shakeel.butt@linux.dev>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    e6100a45
memcontrol.c 216 KB