linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Michael J Wolf <mjwolf@us.ibm.com>,
	akpm@osdl.org, Mel Gorman <mel@csn.ul.ie>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH 4/5] teach smaps_pte_range() about THP pmds
Date: Tue, 22 Feb 2011 14:35:20 +0100	[thread overview]
Message-ID: <20110222133520.GS13092@random.random> (raw)
In-Reply-To: <20110222015343.41586948@kernel>

On Mon, Feb 21, 2011 at 05:53:43PM -0800, Dave Hansen wrote:
> @@ -385,8 +387,25 @@ static int smaps_pte_range(pmd_t *pmd, u
>  	pte_t *pte;
>  	spinlock_t *ptl;
>  
> -	split_huge_page_pmd(walk->mm, pmd);
> -
> +	spin_lock(&walk->mm->page_table_lock);
> +	if (pmd_trans_huge(*pmd)) {
> +		if (pmd_trans_splitting(*pmd)) {
> +			spin_unlock(&walk->mm->page_table_lock);
> +			wait_split_huge_page(vma->anon_vma, pmd);
> +		} else {
> +			smaps_pte_entry(*(pte_t *)pmd, addr,
> +					HPAGE_PMD_SIZE, walk);
> +			spin_unlock(&walk->mm->page_table_lock);
> +			return 0;
> +		}
> +	} else {
> +		spin_unlock(&walk->mm->page_table_lock);
> +	}
> +	/*
> +	 * The mmap_sem held all the way back in m_start() is what
> +	 * keeps khugepaged out of here and from collapsing things
> +	 * in here.
> +	 */

This time the locking is right and HPAGE_PMD_SIZE is used instead of
HPAGE_SIZE, thanks! I think all 5 patches can go in -mm and upstream
anytime (not mandatory for 2.6.38 but definitely we want this for
2.6.39).

BTW, Andi in his NUMA THP improvement series added a THP_SPLIT vmstat
per-cpu counter so that part removed from his series, is taken care by
him.

Acked-by: Andrea Arcangeli <aarcange@redhat.com>

--
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:[~2011-02-22 13:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22  1:53 [PATCH 0/5] fix up /proc/$pid/smaps to not split huge pages Dave Hansen
2011-02-22  1:53 ` [PATCH 1/5] pagewalk: only split huge pages when necessary Dave Hansen
2011-02-22 21:21   ` David Rientjes
2011-02-23 15:30   ` Eric B Munson
2011-02-22  1:53 ` [PATCH 2/5] break out smaps_pte_entry() from smaps_pte_range() Dave Hansen
2011-02-22 21:21   ` David Rientjes
2011-02-23 15:30   ` Eric B Munson
2011-02-22  1:53 ` [PATCH 3/5] pass pte size argument in to smaps_pte_entry() Dave Hansen
2011-02-22 21:21   ` David Rientjes
2011-02-23 15:30   ` Eric B Munson
2011-02-22  1:53 ` [PATCH 4/5] teach smaps_pte_range() about THP pmds Dave Hansen
2011-02-22 13:35   ` Andrea Arcangeli [this message]
2011-02-22 21:22   ` David Rientjes
2011-02-23 15:31   ` Eric B Munson
2011-02-22  1:53 ` [PATCH 5/5] have smaps show transparent huge pages Dave Hansen
2011-02-23 15:31   ` Eric B Munson
  -- strict thread matches above, loose matches on Subject: below --
2011-02-09 19:54 [PATCH 0/5] fix up /proc/$pid/smaps to not split " Dave Hansen
2011-02-09 19:54 ` [PATCH 4/5] teach smaps_pte_range() about THP pmds Dave Hansen
2011-02-10 11:17   ` Mel Gorman
2011-02-10 18:08   ` Andrea Arcangeli
2011-02-10 19:32     ` Dave Hansen

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=20110222133520.GS13092@random.random \
    --to=aarcange@redhat.com \
    --cc=akpm@osdl.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mjwolf@us.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).