linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org
Subject: Re: [patch] mm, thp: drop page_table_lock to uncharge memcg pages
Date: Thu, 26 Apr 2012 16:44:16 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1204261642190.15785@chino.kir.corp.google.com> (raw)
In-Reply-To: <20120426163922.4879dcb1.akpm@linux-foundation.org>

On Thu, 26 Apr 2012, Andrew Morton wrote:

> > mm->page_table_lock is hotly contested for page fault tests and isn't
> > necessary to do mem_cgroup_uncharge_page() in do_huge_pmd_wp_page().
> > 
> > ...
> >
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -968,8 +968,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
> >  	spin_lock(&mm->page_table_lock);
> >  	put_page(page);
> >  	if (unlikely(!pmd_same(*pmd, orig_pmd))) {
> > +		spin_unlock(&mm->page_table_lock);
> >  		mem_cgroup_uncharge_page(new_page);
> >  		put_page(new_page);
> > +		goto out;
> >  	} else {
> >  		pmd_t entry;
> >  		VM_BUG_ON(!PageHead(page));
> 
> But this is on the basically-never-happens race path and will surely have no
> measurable benefit?
> 

It happens more often than you may think on page fault tests; how 
representative pft has ever been of actual workloads, especially with thp 
where the benfits of allocating the hugepage usually result in better 
performance in the long-term even for a short-term performance loss, is 
debatable.  However, all other thp code has always dropped 
mm->page_table_lock before calling mem_cgroup_uncharge_page() and this one 
seems to have been missed.  Worth correcting, in my opinion.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-04-26 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 22:57 David Rientjes
2012-04-26 23:39 ` Andrew Morton
2012-04-26 23:44   ` David Rientjes [this message]
2012-04-27 19:00     ` Andrea Arcangeli
2012-04-26 23:57 ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1204261642190.15785@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox