From: Alexander Beregalov <a.beregalov@gmail.com>
To: penberg@cs.helsinki.fi, mel@csn.ul.ie, Larry.Finger@lwfinger.net,
linux-next@vger.kernel.org
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Subject: [PATCH] SLUB: fix build when !SLUB_DEBUG
Date: Thu, 11 Jun 2009 14:08:48 +0400 [thread overview]
Message-ID: <1244714928-1050-1-git-send-email-a.beregalov@gmail.com> (raw)
Fix this build error when CONFIG_SLUB_DEBUG is not set:
mm/slub.c: In function 'slab_out_of_memory':
mm/slub.c:1551: error: 'struct kmem_cache_node' has no member named 'nr_slabs'
mm/slub.c:1552: error: 'struct kmem_cache_node' has no member named 'total_objects'
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
mm/slub.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 409e900..83c5c16 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1541,20 +1541,27 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid)
for_each_online_node(node) {
struct kmem_cache_node *n = get_node(s, node);
+ unsigned long nr_free;
+#ifdef CONFIG_SLUB_DEBUG
unsigned long nr_slabs;
unsigned long nr_objs;
- unsigned long nr_free;
+#endif
if (!n)
continue;
+ nr_free = count_partial(n, count_free);
+#ifdef CONFIG_SLUB_DEBUG
nr_slabs = atomic_long_read(&n->nr_slabs);
nr_objs = atomic_long_read(&n->total_objects);
- nr_free = count_partial(n, count_free);
printk(KERN_WARNING
" node %d: slabs: %ld, objs: %ld, free: %ld\n",
node, nr_slabs, nr_objs, nr_free);
+#else
+ printk(KERN_WARNING " node %d: free: %ld\n",
+ node, nr_free);
+#endif
}
}
--
1.6.3.1
next reply other threads:[~2009-06-11 11:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 10:08 Alexander Beregalov [this message]
2009-06-11 11:40 ` [PATCH] SLUB: fix build when !SLUB_DEBUG Pekka Enberg
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=1244714928-1050-1-git-send-email-a.beregalov@gmail.com \
--to=a.beregalov@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=linux-next@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=penberg@cs.helsinki.fi \
/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