Re: [PATCH 5/5] lib/interval_tree: Fast overlap detection

From: kbuild test robot
Date: Tue May 30 2017 - 00:55:17 EST


Hi Davidlohr,

[auto build test ERROR on next-20170529]

url: https://github.com/0day-ci/linux/commits/Davidlohr-Bueso/rbtree-Cache-leftmost-node-internally/20170530-101713
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

include/linux/compiler.h:260:8: sparse: attribute 'no_sanitize_address': unknown attribute
drivers/infiniband/hw/hfi1/mmu_rb.c: In function 'hfi1_mmu_rb_insert':
>> drivers/infiniband/hw/hfi1/mmu_rb.c:183:29: error: passing argument 2 of '__mmu_int_rb_insert' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_insert(mnode, &handler->root);
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:68:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _insert(ITSTRUCT *node, \
^~~~~~~~
>> drivers/infiniband/hw/hfi1/mmu_rb.c:188:30: error: passing argument 2 of '__mmu_int_rb_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_remove(mnode, &handler->root);
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:95:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c: In function '__mmu_rb_search':
>> drivers/infiniband/hw/hfi1/mmu_rb.c:205:34: error: passing argument 1 of '__mmu_int_rb_iter_first' from incompatible pointer type [-Werror=incompatible-pointer-types]
node = __mmu_int_rb_iter_first(&handler->root, addr,
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:149:1: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITPREFIX ## _iter_first(struct rb_root_cached *root, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c:208:39: error: passing argument 1 of '__mmu_int_rb_iter_first' from incompatible pointer type [-Werror=incompatible-pointer-types]
for (node = __mmu_int_rb_iter_first(&handler->root, addr,
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:149:1: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITPREFIX ## _iter_first(struct rb_root_cached *root, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c: In function 'hfi1_mmu_rb_extract':
drivers/infiniband/hw/hfi1/mmu_rb.c:229:29: error: passing argument 2 of '__mmu_int_rb_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_remove(node, &handler->root);
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:95:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c: In function 'hfi1_mmu_rb_evict':
drivers/infiniband/hw/hfi1/mmu_rb.c:251:32: error: passing argument 2 of '__mmu_int_rb_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_remove(rbnode, &handler->root);
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:95:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c: In function 'hfi1_mmu_rb_remove':
drivers/infiniband/hw/hfi1/mmu_rb.c:281:28: error: passing argument 2 of '__mmu_int_rb_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_remove(node, &handler->root);
^
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:95:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c: In function 'mmu_notifier_mem_invalidate':
drivers/infiniband/hw/hfi1/mmu_rb.c:314:38: error: passing argument 1 of '__mmu_int_rb_iter_first' from incompatible pointer type [-Werror=incompatible-pointer-types]
for (node = __mmu_int_rb_iter_first(root, start, end - 1);
^~~~
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:149:1: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITPREFIX ## _iter_first(struct rb_root_cached *root, \
^~~~~~~~
drivers/infiniband/hw/hfi1/mmu_rb.c:321:30: error: passing argument 2 of '__mmu_int_rb_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
__mmu_int_rb_remove(node, root);
^~~~
In file included from drivers/infiniband/hw/hfi1/mmu_rb.c:50:0:
drivers/infiniband/hw/hfi1/mmu_rb.c:90:47: note: expected 'struct rb_root_cached *' but argument is of type 'struct rb_root *'
mmu_node_start, mmu_node_last, static, __mmu_int_rb);
^
include/linux/interval_tree_generic.h:95:15: note: in definition of macro 'INTERVAL_TREE_DEFINE'
ITSTATIC void ITPREFIX ## _remove(ITSTRUCT *node, \
^~~~~~~~
cc1: some warnings being treated as errors

vim +/__mmu_int_rb_insert +183 drivers/infiniband/hw/hfi1/mmu_rb.c

06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 44 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 45 *
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 46 */
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 47 #include <linux/list.h>
67caea1fe drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-05-12 48 #include <linux/rculist.h>
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 49 #include <linux/mmu_notifier.h>
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 @50 #include <linux/interval_tree_generic.h>
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 51
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 52 #include "mmu_rb.h"
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 53 #include "trace.h"
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 54
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 55 struct mmu_rb_handler {
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 56 struct mmu_notifier mn;
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 57 struct rb_root root;
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 58 void *ops_arg;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 59 spinlock_t lock; /* protect the RB tree */
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 60 struct mmu_rb_ops *ops;
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 61 struct mm_struct *mm;
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 62 struct list_head lru_list;
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 63 struct work_struct del_work;
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 64 struct list_head del_list;
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 65 struct workqueue_struct *wq;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 66 };
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 67
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 68 static unsigned long mmu_node_start(struct mmu_rb_node *);
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 69 static unsigned long mmu_node_last(struct mmu_rb_node *);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 70 static inline void mmu_notifier_page(struct mmu_notifier *, struct mm_struct *,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 71 unsigned long);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 72 static inline void mmu_notifier_range_start(struct mmu_notifier *,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 73 struct mm_struct *,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 74 unsigned long, unsigned long);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 75 static void mmu_notifier_mem_invalidate(struct mmu_notifier *,
f19bd643d drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 76 struct mm_struct *,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 77 unsigned long, unsigned long);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 78 static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 79 unsigned long, unsigned long);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 80 static void do_remove(struct mmu_rb_handler *handler,
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 81 struct list_head *del_list);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 82 static void handle_remove(struct work_struct *work);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 83
0fc859a65 drivers/infiniband/hw/hfi1/mmu_rb.c Bhumika Goyal 2016-11-19 84 static const struct mmu_notifier_ops mn_opts = {
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 85 .invalidate_page = mmu_notifier_page,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 86 .invalidate_range_start = mmu_notifier_range_start,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 87 };
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 88
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 89 INTERVAL_TREE_DEFINE(struct mmu_rb_node, node, unsigned long, __last,
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 90 mmu_node_start, mmu_node_last, static, __mmu_int_rb);
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 91
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 92 static unsigned long mmu_node_start(struct mmu_rb_node *node)
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 93 {
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 94 return node->addr & PAGE_MASK;
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 95 }
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 96
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 97 static unsigned long mmu_node_last(struct mmu_rb_node *node)
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 98 {
de79093b2 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 99 return PAGE_ALIGN(node->addr + node->len) - 1;
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 100 }
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 101
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 102 int hfi1_mmu_rb_register(void *ops_arg, struct mm_struct *mm,
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 103 struct mmu_rb_ops *ops,
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 104 struct workqueue_struct *wq,
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 105 struct mmu_rb_handler **handler)
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 106 {
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 107 struct mmu_rb_handler *handlr;
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 108 int ret;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 109
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 110 handlr = kmalloc(sizeof(*handlr), GFP_KERNEL);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 111 if (!handlr)
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 112 return -ENOMEM;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 113
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 114 handlr->root = RB_ROOT;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 115 handlr->ops = ops;
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 116 handlr->ops_arg = ops_arg;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 117 INIT_HLIST_NODE(&handlr->mn.hlist);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 118 spin_lock_init(&handlr->lock);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 119 handlr->mn.ops = &mn_opts;
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 120 handlr->mm = mm;
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 121 INIT_WORK(&handlr->del_work, handle_remove);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 122 INIT_LIST_HEAD(&handlr->del_list);
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 123 INIT_LIST_HEAD(&handlr->lru_list);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 124 handlr->wq = wq;
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 125
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 126 ret = mmu_notifier_register(&handlr->mn, handlr->mm);
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 127 if (ret) {
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 128 kfree(handlr);
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 129 return ret;
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 130 }
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 131
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 132 *handler = handlr;
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 133 return 0;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 134 }
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 135
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 136 void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler)
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 137 {
20a42d083 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 138 struct mmu_rb_node *rbnode;
20a42d083 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 139 struct rb_node *node;
c81e1f645 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 140 unsigned long flags;
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 141 struct list_head del_list;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 142
782f6697d drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 143 /* Unregister first so we don't get any more notifications. */
3faa3d9a3 drivers/infiniband/hw/hfi1/mmu_rb.c Ira Weiny 2016-07-28 144 mmu_notifier_unregister(&handler->mn, handler->mm);
782f6697d drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 145
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 146 /*
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 147 * Make sure the wq delete handler is finished running. It will not
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 148 * be triggered once the mmu notifiers are unregistered above.
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 149 */
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 150 flush_work(&handler->del_work);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 151
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 152 INIT_LIST_HEAD(&del_list);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 153
782f6697d drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 154 spin_lock_irqsave(&handler->lock, flags);
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 155 while ((node = rb_first(&handler->root))) {
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 156 rbnode = rb_entry(node, struct mmu_rb_node, node);
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 157 rb_erase(node, &handler->root);
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 158 /* move from LRU list to delete list */
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 159 list_move(&rbnode->list, &del_list);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 160 }
782f6697d drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 161 spin_unlock_irqrestore(&handler->lock, flags);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 162
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 163 do_remove(handler, &del_list);
b85ced915 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 164
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 165 kfree(handler);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 166 }
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 167
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 168 int hfi1_mmu_rb_insert(struct mmu_rb_handler *handler,
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 169 struct mmu_rb_node *mnode)
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 170 {
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 171 struct mmu_rb_node *node;
c81e1f645 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 172 unsigned long flags;
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 173 int ret = 0;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 174
c81e1f645 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 175 spin_lock_irqsave(&handler->lock, flags);
353b71c7c drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 176 hfi1_cdbg(MMU, "Inserting node addr 0x%llx, len %u", mnode->addr,
353b71c7c drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 177 mnode->len);
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 178 node = __mmu_rb_search(handler, mnode->addr, mnode->len);
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 179 if (node) {
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 180 ret = -EINVAL;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 181 goto unlock;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 182 }
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 @183 __mmu_int_rb_insert(mnode, &handler->root);
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 184 list_add(&mnode->list, &handler->lru_list);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 185
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 186 ret = handler->ops->insert(handler->ops_arg, mnode);
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 187 if (ret) {
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 @188 __mmu_int_rb_remove(mnode, &handler->root);
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 189 list_del(&mnode->list); /* remove from LRU list */
0636e9ab8 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 190 }
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 191 unlock:
c81e1f645 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 192 spin_unlock_irqrestore(&handler->lock, flags);
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 193 return ret;
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 194 }
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 195
de82bdff6 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-04-12 196 /* Caller must hold handler lock */
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 197 static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *handler,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 198 unsigned long addr,
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 199 unsigned long len)
06e0ffa69 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 200 {
0f310a00e drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 201 struct mmu_rb_node *node = NULL;
df5a00f81 drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 202
353b71c7c drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 203 hfi1_cdbg(MMU, "Searching for addr 0x%llx, len %u", addr, len);
0f310a00e drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 204 if (!handler->ops->filter) {
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 @205 node = __mmu_int_rb_iter_first(&handler->root, addr,
0f310a00e drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 206 (addr + len) - 1);
0f310a00e drivers/staging/rdma/hfi1/mmu_rb.c Mitko Haralanov 2016-03-08 207 } else {
e0b09ac55 drivers/infiniband/hw/hfi1/mmu_rb.c Dean Luick 2016-07-28 208 for (node = __mmu_int_rb_iter_first(&handler->root, addr,

:::::: The code at line 183 was first introduced by commit
:::::: e0b09ac55d51bb9bf6a4a320bf4029e40bdabd6c IB/hfi1: Make the cache handler own its rb tree root

:::::: TO: Dean Luick <dean.luick@xxxxxxxxx>
:::::: CC: Doug Ledford <dledford@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip