From: Andrea Arcangeli <aarcange@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Khalid Aziz <khalid.aziz@oracle.com>,
Pravin Shelar <pshelar@nicira.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ben Hutchings <bhutchings@solarflare.com>,
Christoph Lameter <cl@linux.com>,
Johannes Weiner <jweiner@redhat.com>,
Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
Andi Kleen <andi@firstfloor.org>,
Minchan Kim <minchan@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/3] mm: hugetlbfs: fix hugetlbfs optimization
Date: Wed, 20 Nov 2013 01:26:00 +0100 [thread overview]
Message-ID: <20131120002600.GF10493@redhat.com> (raw)
In-Reply-To: <20131119151146.a1e1f9073a0e5d35c4e83bab@linux-foundation.org>
On Tue, Nov 19, 2013 at 03:11:46PM -0800, Andrew Morton wrote:
> This is all rather verbose. How about we do this?
>
> --- a/mm/hugetlb.c~mm-hugetlbc-simplify-pageheadhuge-and-pagehuge
> +++ a/mm/hugetlb.c
> @@ -690,15 +690,11 @@ static void prep_compound_gigantic_page(
> */
> int PageHuge(struct page *page)
> {
> - compound_page_dtor *dtor;
> -
> if (!PageCompound(page))
> return 0;
>
> page = compound_head(page);
> - dtor = get_compound_page_dtor(page);
> -
> - return dtor == free_huge_page;
> + return get_compound_page_dtor(page) == free_huge_page;
> }
> EXPORT_SYMBOL_GPL(PageHuge);
>
> @@ -708,14 +704,10 @@ EXPORT_SYMBOL_GPL(PageHuge);
> */
> int PageHeadHuge(struct page *page_head)
> {
> - compound_page_dtor *dtor;
> -
> if (!PageHead(page_head))
> return 0;
>
> - dtor = get_compound_page_dtor(page_head);
> -
> - return dtor == free_huge_page;
> + return get_compound_page_dtor(page_head) == free_huge_page;
> }
> EXPORT_SYMBOL_GPL(PageHeadHuge);
Sure good idea!
> > @@ -82,19 +82,6 @@ static void __put_compound_page(struct page *page)
> >
> > static void put_compound_page(struct page *page)
>
> This function has become quite crazy. I sat down to refamiliarize but
> immediately failed.
>
> : static void put_compound_page(struct page *page)
> : {
> : if (unlikely(PageTail(page))) {
> : ...
> : } else if (put_page_testzero(page)) {
> : if (PageHead(page))
>
> How can a page be both PageTail() and PageHead()?
We execute the PageHead you quoted only if it's !PageTail. So then
PageHead tells us if if it's compound head or not compound by the time
all reference counts have been released (by the time the last
reference is released it can't be splitted anymore).
>
> : __put_compound_page(page);
> : else
> : __put_single_page(page);
> : }
> : }
> :
> :
>
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2013-11-20 0:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 17:47 [PATCH 0/3] mm: hugetlbfs: fix hugetlbfs optimization v2 Andrea Arcangeli
2013-11-15 17:47 ` [PATCH 1/3] mm: hugetlbfs: fix hugetlbfs optimization Andrea Arcangeli
2013-11-19 23:11 ` Andrew Morton
2013-11-20 0:26 ` Andrea Arcangeli [this message]
2013-11-15 17:47 ` [PATCH 2/3] mm: hugetlb: use get_page_foll in follow_hugetlb_page Andrea Arcangeli
2013-11-19 21:27 ` Khalid Aziz
2013-11-15 17:47 ` [PATCH 3/3] mm: tail page refcounting optimization for slab and hugetlbfs Andrea Arcangeli
2013-11-19 21:27 ` Khalid Aziz
2013-11-19 23:14 ` Andrew Morton
2013-11-20 0:20 ` Andrea Arcangeli
2013-11-18 18:04 ` [PATCH 0/3] mm: hugetlbfs: fix hugetlbfs optimization v2 Khalid Aziz
2013-11-19 20:27 ` Khalid Aziz
2013-11-19 22:52 ` Andrea Arcangeli
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=20131120002600.GF10493@redhat.com \
--to=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=bhutchings@solarflare.com \
--cc=cl@linux.com \
--cc=gregkh@linuxfoundation.org \
--cc=jweiner@redhat.com \
--cc=khalid.aziz@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
--cc=pshelar@nicira.com \
--cc=riel@redhat.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).