lkml.org 
[lkml]   [2020]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 07/28] mm: memcg/slab: introduce mem_cgroup_from_obj()
On Mon, Jan 27, 2020 at 09:34:32AM -0800, Roman Gushchin wrote:
> @@ -757,13 +757,12 @@ void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
>
> void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val)
> {
> - struct page *page = virt_to_head_page(p);
> - pg_data_t *pgdat = page_pgdat(page);
> + pg_data_t *pgdat = page_pgdat(virt_to_page(p));
> struct mem_cgroup *memcg;
> struct lruvec *lruvec;
>
> rcu_read_lock();
> - memcg = memcg_from_slab_page(page);
> + memcg = mem_cgroup_from_obj(p);
>
> /* Untracked pages have no memcg, no lruvec. Update only the node */
> if (!memcg || memcg == root_mem_cgroup) {

This function is specifically for slab objects. Why does it need the
indirection and additional branch here?

If memcg_from_slab_page() is going away later, I think the conversion
to this new helper should happen at that point in the series, not now.

\
 
 \ /
  Last update: 2020-02-03 17:05    [W:0.033 / U:2.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site