linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] hugetlb: Do not account hugetlb pages as NR_FILE_PAGES
Date: Tue, 2 Jun 2015 12:00:37 +0200	[thread overview]
Message-ID: <20150602100037.GD4440@dhcp22.suse.cz> (raw)
In-Reply-To: <20150602093805.GC4440@dhcp22.suse.cz>

On Tue 02-06-15 11:38:05, Michal Hocko wrote:
> On Tue 02-06-15 11:33:05, Vlastimil Babka wrote:
> > On 06/02/2015 11:25 AM, Michal Hocko wrote:
[...]
> > >diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> > >index 91b7f9b2b774..bb8a70e8fc77 100644
> > >--- a/include/linux/page-flags.h
> > >+++ b/include/linux/page-flags.h
> > >@@ -547,7 +547,13 @@ static inline void ClearPageCompound(struct page *page)
> > >  #endif /* !PAGEFLAGS_EXTENDED */
> > >
> > >  #ifdef CONFIG_HUGETLB_PAGE
> > >-int PageHuge(struct page *page);
> > >+int __PageHuge(struct page *page);
> > >+static inline int PageHuge(struct page *page)
> > >+{
> > >+	if (!PageCompound(page))
> > 
> > Perhaps the above as likely()?
> 
> I have added it already when writing the changelog.
> 
> > [...]
> > 
> > >-EXPORT_SYMBOL_GPL(PageHuge);
> > >+EXPORT_SYMBOL_GPL(__PageHuge);
> > >
> > >  /*
> > >   * PageHeadHuge() only returns true for hugetlbfs head page, but not for
> > >
> > 
> > Do the same thing here by inlining the PageHead() test?
> > I guess the page_to_pgoff and __compound_tail_refcounted callers are rather
> > hot?
> 
> Yes, that sounds like a good idea.

So the overal codesize (with defconfig) has still grown with the patch:
   text    data     bss     dec     hex filename
 443075   59217   25604  527896   80e18 mm/built-in.o.before
 443477   59217   25604  528298   80faa mm/built-in.o.PageHuge
 443653   59217   25604  528474   8105a mm/built-in.o.both

It is still not ~1K with the full inline but quite large on its own.
So I am not sure it makes sense to fiddle with this without actually
seeing some penalty in profiles.

Here is what I have if somebody wants to play with it:
---

  reply	other threads:[~2015-06-02 10:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 13:27 Michal Hocko
2015-05-21 13:52 ` Mel Gorman
2015-05-21 16:18 ` Mike Kravetz
2015-05-22  6:01   ` Michal Hocko
2015-05-21 17:09 ` Johannes Weiner
2015-05-22 14:21   ` Michal Hocko
2015-05-22 14:28     ` Michal Hocko
2015-05-22 14:35     ` Mel Gorman
2015-05-25 15:24       ` Vlastimil Babka
2015-06-02  9:25         ` Michal Hocko
2015-06-02  9:33           ` Vlastimil Babka
2015-06-02  9:38             ` Michal Hocko
2015-06-02 10:00               ` Michal Hocko [this message]
2015-05-22  5:09 ` Naoya Horiguchi

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=20150602100037.GD4440@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=vbabka@suse.cz \
    /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