From: Christoph Lameter <cl@gentwo.org>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pekka Enberg <penberg@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>
Subject: Re: [PATCH 4/4] slab: Use for_each_kmem_cache_node function
Date: Mon, 2 Jun 2014 10:53:51 -0500 (CDT) [thread overview]
Message-ID: <alpine.DEB.2.10.1406021052300.2987@gentwo.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1406021043160.2987@gentwo.org>
Additional use cases for kmem_cache_node:
Subject: slab: use for_each_kmem_cache_node instead of for_each_online_node
Some use cases. There could be more work done to clean this up and use
for_each_kmem_cache_node in more places but the structure of some of these
functions may have to be changed a bit.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/slab.c
===================================================================
--- linux.orig/mm/slab.c 2014-05-30 13:23:24.879105040 -0500
+++ linux/mm/slab.c 2014-06-02 10:50:26.631319986 -0500
@@ -1632,14 +1632,10 @@ slab_out_of_memory(struct kmem_cache *ca
printk(KERN_WARNING " cache: %s, object size: %d, order: %d\n",
cachep->name, cachep->size, cachep->gfporder);
- for_each_online_node(node) {
+ for_each_kmem_cache_node(cachep, node, n) {
unsigned long active_objs = 0, num_objs = 0, free_objects = 0;
unsigned long active_slabs = 0, num_slabs = 0;
- n = cachep->node[node];
- if (!n)
- continue;
-
spin_lock_irqsave(&n->list_lock, flags);
list_for_each_entry(page, &n->slabs_full, lru) {
active_objs += cachep->num;
@@ -4040,10 +4036,7 @@ void get_slabinfo(struct kmem_cache *cac
active_objs = 0;
num_slabs = 0;
- for_each_online_node(node) {
- n = get_node(cachep, node);
- if (!n)
- continue;
+ for_each_kmem_cache_node(cachep, node, n) {
check_irq_on();
spin_lock_irq(&n->list_lock);
@@ -4277,10 +4270,7 @@ static int leaks_show(struct seq_file *m
x[1] = 0;
- for_each_online_node(node) {
- n = get_node(cachep, node);
- if (!n)
- continue;
+ for_each_kmem_cache_node(cachep, node, n) {
check_irq_on();
spin_lock_irq(&n->list_lock);
--
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:[~2014-06-02 15:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 18:27 [PATCH 0/4] slab: common kmem_cache_cpu functions V1 Christoph Lameter
2014-05-30 18:27 ` [PATCH 1/4] slab common: Add functions for kmem_cache_node access Christoph Lameter
2014-05-30 18:27 ` [PATCH 2/4] slub: Use new node functions Christoph Lameter
2014-06-02 4:59 ` Joonsoo Kim
2014-06-02 15:42 ` Christoph Lameter
2014-06-03 6:57 ` Joonsoo Kim
2014-06-03 14:47 ` Christoph Lameter
2014-05-30 18:27 ` [PATCH 3/4] slab: Use get_node function Christoph Lameter
2014-05-30 18:27 ` [PATCH 4/4] slab: Use for_each_kmem_cache_node function Christoph Lameter
2014-06-02 5:12 ` Joonsoo Kim
2014-06-02 15:45 ` Christoph Lameter
2014-06-02 15:53 ` Christoph Lameter [this message]
2014-06-02 17:43 ` 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=alpine.DEB.2.10.1406021052300.2987@gentwo.org \
--to=cl@gentwo.org \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
/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