lkml.org 
[lkml]   [2011]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] memcg: fix USED bit handling at uncharge in THP
On Wed, 19 Jan 2011 13:10:43 +0100
Johannes Weiner <hannes@cmpxchg.org> wrote:

> Hello KAMEZAWA-san,
>
> On Tue, Jan 18, 2011 at 11:40:49AM +0900, KAMEZAWA Hiroyuki wrote:
> > +void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail)
> > +{
> > + struct page_cgroup *head_pc = lookup_page_cgroup(head);
> > + struct page_cgroup *tail_pc = lookup_page_cgroup(tail);
> > + unsigned long flags;
> > +
> > + /*
> > + * We have no races witch charge/uncharge but will have races with
> > + * page state accounting.
> > + */
> > + move_lock_page_cgroup(head_pc, &flags);
> > +
> > + tail_pc->mem_cgroup = head_pc->mem_cgroup;
> > + smp_wmb(); /* see __commit_charge() */
>
> I thought the barriers were needed because charging does not hold the
> lru lock. But here we do, and all the 'lockless' read-sides do so as
> well. Am I missing something or can this barrier be removed?
>

Hmm. I think this can be removed. But it's just because there is only one
referer of lockless access to pc->mem_cgroup. I think it's ok to remove
this but it should be done by independent patch with enough patch
clarification. IOW, I'll do later in another patch.

Thanks,
-Kame



\
 
 \ /
  Last update: 2011-01-20 02:03    [W:0.044 / U:2.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site