linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] mm: kmem: optimize obj_cgroup pointer retrieval
@ 2022-12-20 18:27 Roman Gushchin
  2022-12-20 18:27 ` [PATCH RFC 1/2] mm: kmem: optimize get_obj_cgroup_from_current() Roman Gushchin
  2022-12-20 18:27 ` [PATCH RFC 2/2] mm: kmem: add direct objcg pointer to task_struct Roman Gushchin
  0 siblings, 2 replies; 9+ messages in thread
From: Roman Gushchin @ 2022-12-20 18:27 UTC (permalink / raw)
  To: linux-mm
  Cc: cgroups, linux-kernel, Shakeel Butt, Johannes Weiner,
	Michal Hocko, Muchun Song, Andrew Morton, Roman Gushchin

This patchset improves the performance of get_obj_cgroup_from_current(), which
is used to get an objcg pointer on the kernel memory allocation fast path.

Results (1M 8-bytes accounted allocations):

| version         | accounted (us) | delta | unaccounted (us) |  delta |
|-----------------+----------------+-------+------------------+--------|
| baseline (6.1+) |          81042 |       |            45269 |        |
| patch 1         |          78756 | -2.8% |            42731 |  -5.6% |
| patch 2         |          73650 | -9.1% |            30662 | -32.3% |

Unaccounted allocations were performed from a user's task belonging to
the root cgroup, so savings are particularly large because previously
the root_mem_cgroup pointer was obtained first just to learn that it's
corresponding objcg is NULL.


Roman Gushchin (2):
  mm: kmem: optimize get_obj_cgroup_from_current()
  mm: kmem: add direct objcg pointer to task_struct

 include/linux/sched.h |   4 ++
 mm/memcontrol.c       | 102 ++++++++++++++++++++++++++++++++----------
 2 files changed, 83 insertions(+), 23 deletions(-)

-- 
2.39.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-02 16:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 18:27 [PATCH RFC 0/2] mm: kmem: optimize obj_cgroup pointer retrieval Roman Gushchin
2022-12-20 18:27 ` [PATCH RFC 1/2] mm: kmem: optimize get_obj_cgroup_from_current() Roman Gushchin
2022-12-20 19:55   ` Shakeel Butt
2022-12-20 21:15     ` Roman Gushchin
2022-12-20 18:27 ` [PATCH RFC 2/2] mm: kmem: add direct objcg pointer to task_struct Roman Gushchin
2022-12-20 20:44   ` Shakeel Butt
2022-12-22 13:50   ` Michal Koutný
2022-12-22 16:21     ` Roman Gushchin
2023-01-02 16:09       ` Michal Koutný

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox