lkml.org 
[lkml]   [2020]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/4] mm: memcontrol: use helpers to access page's memcg data
On Thu, Oct 01, 2020 at 09:46:38AM -0400, Johannes Weiner wrote:
> On Wed, Sep 30, 2020 at 05:27:07PM -0700, Roman Gushchin wrote:
> > +/*
> > + * set_page_memcg - associate a page with a memory cgroup
> > + * @page: a pointer to the page struct
> > + * @memcg: a pointer to the memory cgroup
> > + *
> > + * Associates a page with a memory cgroup.
> > + */
> > +static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
> > +{
> > + VM_BUG_ON_PAGE(PageSlab(page), page);
> > +
> > + /*
> > + * Please, refer to page_memcg()'s description for the page and memcg
> > + * binding stability requirements.
> > + */
> > + page->memcg_data = (unsigned long)memcg;
> > +}
>
> Please delete and inline this as per previous feedback, thanks.

Why it's better?
It's ok for set_page_memcg(), but obviously worse for set_page_objcgs():
it was nice to have all bit magic in one place, in few helper functions.
And now it spills into several places. What's the win?

Thanks.

\
 
 \ /
  Last update: 2020-10-01 20:29    [W:0.082 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site