From: Andrew Morton <akpm@linux-foundation.org>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>,
Andy Whitcroft <apw@shadowen.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Bias the location of pages freed for min_free_kbytes in the same MAX_ORDER_NR_PAGES blocks
Date: Sun, 18 Mar 2007 12:45:47 -0800 [thread overview]
Message-ID: <20070318124547.c46b0e69.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0703181941160.648@skynet.skynet.ie>
On Sun, 18 Mar 2007 20:08:49 +0000 (GMT) Mel Gorman <mel@csn.ul.ie> wrote:
> On Sun, 18 Mar 2007, Andrew Morton wrote:
>
> > On Sun, 18 Mar 2007 19:05:41 +0000 (GMT) Mel Gorman <mel@csn.ul.ie> wrote:
> >
> >>> How much additional memory consumption are we expecting here?
> >>>
> >>
> >> Short answer, about 1.5KB on a 1GB system of which 1.3KB is statically
> >> defined in the 3 struct zones on a 1 node x86 system.
> >>
> >> Longer answer that I hopefully have not made any mistakes in - There is
> >> the zone overhead which is statically sized and a runtime overhead which
> >> depends on the amount of memory in the system. The additional zone
> >> overhead is the overhead for additional freelists (larger struct
> >> free_area) and is as follows;
> >>
> >> (MIGRATE_TYPES-1) * sizeof(list_head) * (MAX_ORDER-1)
> >>
> >> so, on 32 bit in general, thats
> >>
> >> 4 * 8 * 10 = 320 bytes per zone (would be 240 bytes if MIGRATE_RESERVE is
> >> sufficient for higher order allocations
> >> instead of MIGRATE_HIGHALLOC)
> >>
> >> on x86 with DMA, Normal and HighMem, thats 1280 bytes. On a NUMA system,
> >> it's 1280 bytes per node. On 64 bit, it would be double because of the
> >> larger pointer size. At worst, I guess you are looking at 3KB per node.
> >
> > That a very modest overhead - not worth the config option, IMO.
> >
> > The runtime overhead might be a concern - is it possible to quantify
> > it?
> >
>
> Do you mean performance wise or memory wise?
CPU load. From your earlier email I'd decided memory consumption was a
non-issue ;)
> Memory-wise, something like
>
> ===
> FLATMEM Case
> bits = 0;
> for_each_zone(zone) {
> bits += (zone->spanned_pages >> (MAX_ORDER-1)) * NR_PAGEBLOCK_BITS);
> }
> bytes_consumed = bits / 8;
>
> === SPARSEMEM Case, a rough approximation is
> ((vm_total_pages * PAGE_SIZE) >> SECTION_SIZE_BITS) * 8
>
> The consumption could be stored in a zone variable similar to
> zone->present_pages and visible through /proc/zoneinfo. Would that be
> useful?
>
> Performance wise is harder to quantify. There are three places where
> issues can show up. The first is with allocation fallbacks where
> __rmqueue_fallback() is called. Fallbacks are expensive but fallbacks are
> rare except when the zone is too small which is why I probably should be
> catching that case explicitly. I used to have a counters patch for
> fallbacks. I could bring it up to date to use __count_vm_events() to
> quantify fallbacks if you think it would be useful?
>
> The second hotpoint is where the per-cpu lists are searched for a page of
> the suitable migrate type. An instruction-level profile on x86 when I
> looked at this on x86 showed about 2-4% of the time spent in
> get_page_from_freelist() was searching the per-cpu lists for a page of a
> suitable type. IIRC, something like 85% of the time there was clearing the
> pages although I'd need to double check this to be 100% sure.
>
> The last potential performance hotpoint is where the pageblock flags are
> read on every free in get_pageblock_flags_group(). There is probably room
> for optimisation there. I haven't an exact quantification available at the
> moment but I remember seeing it far down the list of functions time was
> spent when I was last looking at this.
hm, well. It'd be good to drill down, quantify and, where needed, fix
these things. Because the existence of that config option is quite
undesirabe.
next prev parent reply other threads:[~2007-03-18 20:46 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-08 4:18 2.6.21-rc3-mm1 Andrew Morton
2007-03-08 9:59 ` ext4, wireless (was Re: 2.6.21-rc3-mm1) Jeff Garzik
2007-03-08 14:50 ` 2.6.21-rc3-mm1 John W. Linville
2007-03-08 16:37 ` 2.6.21-rc3-mm1 Dave Jones
2007-03-08 17:56 ` 2.6.21-rc3-mm1 Valdis.Kletnieks
2007-03-08 18:34 ` 2.6.21-rc3-mm1 John W. Linville
2007-03-08 20:27 ` 2.6.21-rc3-mm1 Valdis.Kletnieks
2007-03-08 20:50 ` 2.6.21-rc3-mm1 Michal Piotrowski
2007-03-10 2:18 ` 2.6.21-rc3-mm1 Andrew Morton
2007-03-10 15:45 ` 2.6.21-rc3-mm1 Paul E. McKenney
[not found] ` <6bffcb0e0703111002t75a8ac51vcce7d52684e04a9d@mail.gmail.com>
2007-03-12 4:41 ` 2.6.21-rc3-mm1 Paul E. McKenney
2007-03-09 11:40 ` 2.6.21-rc3-mm1 Frederik Deweerdt
2007-03-15 9:22 ` ipw2200: can't load firmware (was Re: 2.6.21-rc3-mm1) Frederik Deweerdt
2007-03-10 8:33 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-10 8:48 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-10 8:58 ` 2.6.21-rc3-mm1 Andrew Morton
2007-03-10 9:18 ` 2.6.21-rc3-mm1 Greg KH
2007-03-10 12:43 ` 2.6.21-rc3-mm1 Jiri Kosina
2007-03-10 15:36 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-10 16:00 ` [linux-usb-devel] 2.6.21-rc3-mm1 Alan Stern
2007-03-10 16:36 ` Mariusz Kozlowski
2007-03-10 19:02 ` Alan Stern
2007-03-12 20:50 ` Mariusz Kozlowski
2007-03-12 20:53 ` Jiri Kosina
2007-03-10 13:32 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-12 18:14 ` 2.6.21-rc3-mm1 Radoslaw Szkodzinski
2007-03-14 19:06 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-15 1:07 ` 2.6.21-rc3-mm1 Andrew Morton
2007-03-15 6:09 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-15 10:16 ` 2.6.21-rc3-mm1 Mel Gorman
2007-03-15 15:37 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-15 19:59 ` 2.6.21-rc3-mm1 Mel Gorman
2007-03-16 6:43 ` 2.6.21-rc3-mm1 Mariusz Kozlowski
2007-03-16 10:03 ` 2.6.21-rc3-mm1 Mel Gorman
2007-03-17 18:26 ` [PATCH] Bias the location of pages freed for min_free_kbytes in the same MAX_ORDER_NR_PAGES blocks Mel Gorman
2007-03-18 8:22 ` Andrew Morton
2007-03-18 11:35 ` Mel Gorman
2007-03-18 18:12 ` Andrew Morton
2007-03-18 19:05 ` Mel Gorman
2007-03-18 19:28 ` Andrew Morton
2007-03-18 20:08 ` Mel Gorman
2007-03-18 20:45 ` Andrew Morton [this message]
2007-03-18 22:21 ` Mel Gorman
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=20070318124547.c46b0e69.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.kozlowski@tuxland.pl \
--cc=mel@csn.ul.ie \
/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