]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
list_lru: per-node list infrastructure fix
authorGlauber Costa <glommer@gmail.com>
Thu, 15 Aug 2013 23:39:46 +0000 (09:39 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 Aug 2013 07:27:17 +0000 (17:27 +1000)
After a while investigating, it seems to us that the imbalance we are
seeing are due to a multi-node race already in tree (our guess).  Although
the WARN is useful to show us the race, BUG_ON is too much, since it seems
the kernel should be fine going on after that.

Signed-off-by: Glauber Costa <glommer@openvz.org>
Cc: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/list_lru.c

index f2d1d6e78eb69228c6697bbdb47e74794ef81d6f..1efe4ecc02b1f6d14738a3dc7e6ea2e9255f540b 100644 (file)
@@ -15,7 +15,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item)
        struct list_lru_node *nlru = &lru->node[nid];
 
        spin_lock(&nlru->lock);
-       BUG_ON(nlru->nr_items < 0);
+       WARN_ON_ONCE(nlru->nr_items < 0);
        if (list_empty(item)) {
                list_add_tail(item, &nlru->list);
                if (nlru->nr_items++ == 0)
@@ -38,7 +38,7 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item)
                list_del_init(item);
                if (--nlru->nr_items == 0)
                        node_clear(nid, lru->active_nodes);
-               BUG_ON(nlru->nr_items < 0);
+               WARN_ON_ONCE(nlru->nr_items < 0);
                spin_unlock(&nlru->lock);
                return true;
        }
@@ -56,7 +56,7 @@ unsigned long list_lru_count(struct list_lru *lru)
                struct list_lru_node *nlru = &lru->node[nid];
 
                spin_lock(&nlru->lock);
-               BUG_ON(nlru->nr_items < 0);
+               WARN_ON_ONCE(nlru->nr_items < 0);
                count += nlru->nr_items;
                spin_unlock(&nlru->lock);
        }
@@ -91,7 +91,7 @@ restart:
                case LRU_REMOVED:
                        if (--nlru->nr_items == 0)
                                node_clear(nid, lru->active_nodes);
-                       BUG_ON(nlru->nr_items < 0);
+                       WARN_ON_ONCE(nlru->nr_items < 0);
                        isolated++;
                        break;
                case LRU_ROTATE: