From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm@kvack.org, Andy Whitcroft <apw@shadowen.org>,
Dave Hansen <haveblue@us.ibm.com>
Subject: Re: [PATCH] Get rid of zone_table V2
Date: Mon, 18 Sep 2006 23:12:31 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0609182309050.3152@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060918173134.d3850903.akpm@osdl.org>
Hmmm... Actually one can get much better code. If I remove the padding
from struct zone then struct zone shrinks from 0x480 to 0x400 in length
on i386 smp and then we get code without a multiply operation:
00000787 <__inc_zone_page_state>:
787: 8b 00 mov (%eax),%eax
789: c1 e8 0f shr $0xf,%eax
78c: 25 00 04 00 00 and $0x400,%eax
791: 05 00 00 00 00 add $0x0,%eax
796: e9 58 fe ff ff jmp 5f3 <__inc_zone_state>
Is there some way to get a structure to be sized a power of two? This is
so nice and small that one would do good to inline __inc_zone_page_state.
Remove padding from struct zone
Index: linux-2.6.18-rc6-mm1/include/linux/mmzone.h
===================================================================
--- linux-2.6.18-rc6-mm1.orig/include/linux/mmzone.h 2006-09-18 20:20:34.000000000 -0700
+++ linux-2.6.18-rc6-mm1/include/linux/mmzone.h 2006-09-18 20:34:24.000000000 -0700
@@ -31,21 +31,6 @@
struct pglist_data;
-/*
- * zone->lock and zone->lru_lock are two of the hottest locks in the kernel.
- * So add a wild amount of padding here to ensure that they fall into separate
- * cachelines. There are very few zone structures in the machine, so space
- * consumption is not a concern here.
- */
-#if defined(CONFIG_SMP)
-struct zone_padding {
- char x[0];
-} ____cacheline_internodealigned_in_smp;
-#define ZONE_PADDING(name) struct zone_padding name;
-#else
-#define ZONE_PADDING(name)
-#endif
-
enum zone_stat_item {
NR_ANON_PAGES, /* Mapped anonymous pages */
NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
@@ -186,9 +171,6 @@
#endif
struct free_area free_area[MAX_ORDER];
-
- ZONE_PADDING(_pad1_)
-
/* Fields commonly accessed by the page reclaim scanner */
spinlock_t lru_lock;
struct list_head active_list;
@@ -231,7 +213,6 @@
int prev_priority;
- ZONE_PADDING(_pad2_)
/* Rarely used or read-mostly fields */
/*
--
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:[~2006-09-19 6:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-18 19:21 Christoph Lameter
2006-09-18 20:28 ` Andrew Morton
2006-09-18 22:51 ` Christoph Lameter
2006-09-18 23:15 ` Andrew Morton
2006-09-18 23:46 ` Christoph Lameter
2006-09-18 23:58 ` Andrew Morton
2006-09-19 0:08 ` Christoph Lameter
2006-09-19 0:14 ` Christoph Lameter
2006-09-19 0:31 ` Andrew Morton
2006-09-19 1:20 ` Christoph Lameter
2006-09-19 6:12 ` Christoph Lameter [this message]
2006-09-19 6:33 ` Andrew Morton
2006-09-19 14:10 ` Christoph Lameter
2006-09-19 15:38 ` Andrew Morton
2006-09-19 15:41 ` Christoph Lameter
2006-09-19 16:23 ` Nick Piggin
2006-09-19 16:45 ` Nick Piggin
2006-09-19 17:50 ` Christoph Lameter
2006-09-19 18:24 ` Andi Kleen
2006-09-19 16:17 ` Nick Piggin
2006-09-24 10:06 ` Andrew Morton
2006-09-24 16:58 ` Christoph Lameter
2006-09-27 9:19 ` Andrew Morton
2006-09-27 9:26 ` Andy Whitcroft
2006-09-27 11:23 ` [PATCH] zone table removal miss merge Andy Whitcroft
2006-09-27 16:19 ` Christoph Lameter
2006-09-27 11:27 ` [PATCH] Get rid of zone_table V2 Andy Whitcroft
2006-09-27 16:24 ` Andrew Morton
2006-09-30 18:47 ` Christoph Lameter
2006-09-30 18:48 ` Christoph Lameter
2006-09-30 20:08 ` Andrew Morton
2006-10-02 15:57 ` Christoph Lameter
2006-10-02 17:10 ` Christoph Lameter
2006-10-04 10:10 ` Andy Whitcroft
2006-10-06 14:45 ` [PATCH] zoneid fix up calculations for ZONEID_PGSHIFT Andy Whitcroft
2006-10-06 17:00 ` Christoph Lameter
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=Pine.LNX.4.64.0609182309050.3152@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@osdl.org \
--cc=apw@shadowen.org \
--cc=haveblue@us.ibm.com \
--cc=linux-mm@kvack.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