linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Paul Menzel <pmenzel+linux-mm@molgen.mpg.de>
Cc: linux-mm@kvack.org, x86@kernel.org
Subject: Re: How to profile 160 ms spent in `add_highpages_with_active_regions()`?
Date: Thu, 13 Sep 2018 14:04:58 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1809131400070.1473@nanos.tec.linutronix.de> (raw)
In-Reply-To: <d2ad2459-61ea-edb1-3b22-da92c039bfae@molgen.mpg.de>

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

On Tue, 4 Sep 2018, Paul Menzel wrote:
> On 08/22/18 15:41, Thomas Gleixner wrote:
> > On Wed, 22 Aug 2018, Paul Menzel wrote:
> >> Am 21.08.2018 um 11:37 schrieb Paul Menzel:
> >>> [Removed non-working Pavel Tatashin <pasha.tatashin@oracle.com>]
> >>
> >> So a??freea??inga?? pfn = 225278 to e_pfn = 818492 in the for loop takes 160 ms.
> > 
> > That's 593214 pages and each one takes about 270ns. I don't see much
> > optimization potential with that.
> > 
> > 32bit and highmem sucks ...

We all know that.

> Interestingly on my ASRock E350M1 with 4 GB, `pfn_valid()` is always true.
>
> Additionally, after removing the for loop, the system still boots and seems
> to work fine.
> 
> Here is the hunk I removed (with my debug statements).
> 
> -               for ( ; pfn < e_pfn; pfn++)
> -                       if (pfn_valid(pfn)) {
> -                               free_highmem_page(pfn_to_page(pfn));
> -                               //printk(KERN_INFO "%s: in for loop pfn_valid(pfn) after fre
> e_highmem_page, pfn = %lu\n", __func__, pfn);
> -                       } else {
> -                               printk(KERN_INFO "%s: pfn = %lu is invalid\n", __func__);
> -                       }
> 
> Is the code there for certain memory sizes?

No, it's there to give the highmem pages back for allocation. You're losing
usable memory that way. /proc/meminfo should tell you the difference.

Thanks,

	tglx

      reply	other threads:[~2018-09-13 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  8:12 Paul Menzel
2018-08-21  9:37 ` Paul Menzel
2018-08-22 13:25   ` Paul Menzel
2018-08-22 13:41     ` Thomas Gleixner
2018-09-04  9:16       ` Paul Menzel
2018-09-13 12:04         ` Thomas Gleixner [this message]

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.21.1809131400070.1473@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-mm@kvack.org \
    --cc=pmenzel+linux-mm@molgen.mpg.de \
    --cc=x86@kernel.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