From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org, akpm@linux-foundation.org,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 09/12] Don't use inline node_page_state for sysfs output functions
Date: Thu, 13 Oct 2011 16:08:49 -0700 [thread overview]
Message-ID: <1318547332-23155-9-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1318547332-23155-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
These are not time critical, and using an out of line function
saves about 2.5k text on a non force inline kernel.
I left the main hotpath user -- readahead -- inline for now.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
drivers/base/node.c | 72 +++++++++++++++++++++++++++-----------------------
1 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 793f796..0b8e7a2 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -58,6 +58,12 @@ static inline ssize_t node_read_cpulist(struct sys_device *dev,
static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL);
static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL);
+/* Don't inline */
+static unsigned long my_node_page_state(int node, enum zone_stat_item item)
+{
+ return node_page_state(node, item);
+}
+
#define K(x) ((x) << (PAGE_SHIFT - 10))
static ssize_t node_read_meminfo(struct sys_device * dev,
struct sysdev_attribute *attr, char * buf)
@@ -82,16 +88,16 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
nid, K(i.totalram),
nid, K(i.freeram),
nid, K(i.totalram - i.freeram),
- nid, K(node_page_state(nid, NR_ACTIVE_ANON) +
- node_page_state(nid, NR_ACTIVE_FILE)),
- nid, K(node_page_state(nid, NR_INACTIVE_ANON) +
- node_page_state(nid, NR_INACTIVE_FILE)),
- nid, K(node_page_state(nid, NR_ACTIVE_ANON)),
- nid, K(node_page_state(nid, NR_INACTIVE_ANON)),
- nid, K(node_page_state(nid, NR_ACTIVE_FILE)),
- nid, K(node_page_state(nid, NR_INACTIVE_FILE)),
- nid, K(node_page_state(nid, NR_UNEVICTABLE)),
- nid, K(node_page_state(nid, NR_MLOCK)));
+ nid, K(my_node_page_state(nid, NR_ACTIVE_ANON) +
+ my_node_page_state(nid, NR_ACTIVE_FILE)),
+ nid, K(my_node_page_state(nid, NR_INACTIVE_ANON) +
+ my_node_page_state(nid, NR_INACTIVE_FILE)),
+ nid, K(my_node_page_state(nid, NR_ACTIVE_ANON)),
+ nid, K(my_node_page_state(nid, NR_INACTIVE_ANON)),
+ nid, K(my_node_page_state(nid, NR_ACTIVE_FILE)),
+ nid, K(my_node_page_state(nid, NR_INACTIVE_FILE)),
+ nid, K(my_node_page_state(nid, NR_UNEVICTABLE)),
+ nid, K(my_node_page_state(nid, NR_MLOCK)));
#ifdef CONFIG_HIGHMEM
n += sprintf(buf + n,
@@ -123,30 +129,30 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
"Node %d AnonHugePages: %8lu kB\n"
#endif
,
- nid, K(node_page_state(nid, NR_FILE_DIRTY)),
- nid, K(node_page_state(nid, NR_WRITEBACK)),
- nid, K(node_page_state(nid, NR_FILE_PAGES)),
- nid, K(node_page_state(nid, NR_FILE_MAPPED)),
- nid, K(node_page_state(nid, NR_ANON_PAGES)
+ nid, K(my_node_page_state(nid, NR_FILE_DIRTY)),
+ nid, K(my_node_page_state(nid, NR_WRITEBACK)),
+ nid, K(my_node_page_state(nid, NR_FILE_PAGES)),
+ nid, K(my_node_page_state(nid, NR_FILE_MAPPED)),
+ nid, K(my_node_page_state(nid, NR_ANON_PAGES)
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
- + node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
+ + my_node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
HPAGE_PMD_NR
#endif
),
- nid, K(node_page_state(nid, NR_SHMEM)),
- nid, node_page_state(nid, NR_KERNEL_STACK) *
+ nid, K(my_node_page_state(nid, NR_SHMEM)),
+ nid, my_node_page_state(nid, NR_KERNEL_STACK) *
THREAD_SIZE / 1024,
- nid, K(node_page_state(nid, NR_PAGETABLE)),
- nid, K(node_page_state(nid, NR_UNSTABLE_NFS)),
- nid, K(node_page_state(nid, NR_BOUNCE)),
- nid, K(node_page_state(nid, NR_WRITEBACK_TEMP)),
- nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
- node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
- nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
- nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
+ nid, K(my_node_page_state(nid, NR_PAGETABLE)),
+ nid, K(my_node_page_state(nid, NR_UNSTABLE_NFS)),
+ nid, K(my_node_page_state(nid, NR_BOUNCE)),
+ nid, K(my_node_page_state(nid, NR_WRITEBACK_TEMP)),
+ nid, K(my_node_page_state(nid, NR_SLAB_RECLAIMABLE) +
+ my_node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
+ nid, K(my_node_page_state(nid, NR_SLAB_RECLAIMABLE)),
+ nid, K(my_node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
, nid,
- K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
+ K(my_node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
HPAGE_PMD_NR)
#endif
);
@@ -167,12 +173,12 @@ static ssize_t node_read_numastat(struct sys_device * dev,
"interleave_hit %lu\n"
"local_node %lu\n"
"other_node %lu\n",
- node_page_state(dev->id, NUMA_HIT),
- node_page_state(dev->id, NUMA_MISS),
- node_page_state(dev->id, NUMA_FOREIGN),
- node_page_state(dev->id, NUMA_INTERLEAVE_HIT),
- node_page_state(dev->id, NUMA_LOCAL),
- node_page_state(dev->id, NUMA_OTHER));
+ my_node_page_state(dev->id, NUMA_HIT),
+ my_node_page_state(dev->id, NUMA_MISS),
+ my_node_page_state(dev->id, NUMA_FOREIGN),
+ my_node_page_state(dev->id, NUMA_INTERLEAVE_HIT),
+ my_node_page_state(dev->id, NUMA_LOCAL),
+ my_node_page_state(dev->id, NUMA_OTHER));
}
static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
--
1.7.4.4
next prev parent reply other threads:[~2011-10-13 23:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 23:08 [PATCH 01/12] RADEON: Drop inlines from evergreen_cs.c / r600_cs.c Andi Kleen
2011-10-13 23:08 ` [PATCH 02/12] RADEON: Move r100_*_*reg out of line Andi Kleen
2011-10-13 23:08 ` [PATCH 03/12] RADEON: drop inlines in r600_blit.c Andi Kleen
2011-10-13 23:08 ` [PATCH 04/12] RADEON: Remove now unused functions in radeon driver Andi Kleen
2011-10-13 23:08 ` [PATCH 05/12] FB_ATY: Move register accesses out of line Andi Kleen
2011-10-13 23:08 ` [PATCH 06/12] RADEON: Remove more bogus inlines in the radeon driver Andi Kleen
2011-10-13 23:08 ` [PATCH 07/12] RADEON: Move more code out of line Andi Kleen
2011-10-13 23:08 ` [PATCH 08/12] X86: Move alloc_intr_gate " Andi Kleen
2011-10-13 23:08 ` Andi Kleen [this message]
2011-10-13 23:08 ` [PATCH 10/12] REISERFS: reiserfs drop unnecessary inlines Andi Kleen
2011-10-13 23:08 ` [PATCH 11/12] i915: Move i915_read/write out of line Andi Kleen
2011-10-15 13:49 ` Daniel Vetter
2011-10-18 5:47 ` Ben Widawsky
2011-10-13 23:08 ` [PATCH 12/12] Force always inline for gcc 4.5 when optimizing for size Andi Kleen
2011-10-18 8:59 ` [PATCH 01/12] RADEON: Drop inlines from evergreen_cs.c / r600_cs.c David Airlie
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=1318547332-23155-9-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.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