From: Davidlohr Bueso <dave@stgolabs.net>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, mingo@kernel.org, peterz@infradead.org,
akpm@linux-foundation.org, jack@suse.cz,
kirill.shutemov@linux.intel.com, ldufour@linux.vnet.ibm.com,
mhocko@suse.com, mgorman@techsingularity.net,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 5/5] lib/interval_tree: Fast overlap detection
Date: Tue, 30 May 2017 08:44:10 -0700 [thread overview]
Message-ID: <20170530154410.GA19563@linux-80c1.suse> (raw)
In-Reply-To: <201705301226.XFa9xKaP%fengguang.wu@intel.com>
On Tue, 30 May 2017, kbuild test robot wrote:
>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);
Ah, I missed that interval tree user. The following fixes it along with
a bogus semicolon for rb_cached_first(). I can add this in v2 if we get
there.
Thanks,
Davidlohr
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c
index ccbf52c8ff6f..1835447dcd73 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.c
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.c
@@ -54,7 +54,7 @@
struct mmu_rb_handler {
struct mmu_notifier mn;
- struct rb_root root;
+ struct rb_root_cached root;
void *ops_arg;
spinlock_t lock; /* protect the RB tree */
struct mmu_rb_ops *ops;
@@ -111,7 +111,7 @@ int hfi1_mmu_rb_register(void *ops_arg, struct mm_struct *mm,
if (!handlr)
return -ENOMEM;
- handlr->root = RB_ROOT;
+ handlr->root = RB_ROOT_CACHED;
handlr->ops = ops;
handlr->ops_arg = ops_arg;
INIT_HLIST_NODE(&handlr->mn.hlist);
@@ -152,9 +152,9 @@ void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler)
INIT_LIST_HEAD(&del_list);
spin_lock_irqsave(&handler->lock, flags);
- while ((node = rb_first(&handler->root))) {
+ while ((node = rb_first_cached(&handler->root))) {
rbnode = rb_entry(node, struct mmu_rb_node, node);
- rb_erase(node, &handler->root);
+ rb_erase_cached(node, &handler->root);
/* move from LRU list to delete list */
list_move(&rbnode->list, &del_list);
}
@@ -305,7 +305,7 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn,
{
struct mmu_rb_handler *handler =
container_of(mn, struct mmu_rb_handler, mn);
- struct rb_root *root = &handler->root;
+ struct rb_root_cached *root = &handler->root;
struct mmu_rb_node *node, *ptr = NULL;
unsigned long flags;
bool added = false;
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index eb4544811cfd..71c9ee585454 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -78,7 +78,7 @@ extern void rb_insert_color_cached(struct rb_node *,
struct rb_root_cached *, bool);
extern void rb_erase_cached(struct rb_node *node, struct rb_root_cached *);
/* Same as rb_first(), but O(1) */
-#define rb_first_cached(root) (root)->rb_leftmost;
+#define rb_first_cached(root) (root)->rb_leftmost
/* Postorder iteration - always visit the parent after its children */
extern struct rb_node *rb_first_postorder(const struct rb_root *);
next prev parent reply other threads:[~2017-05-30 15:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 2:09 [rfc PATCH -next 0/5] rbtree: Cache leftmost node internally Davidlohr Bueso
2017-05-30 2:09 ` [PATCH 1/5] " Davidlohr Bueso
2017-06-08 13:03 ` Peter Zijlstra
2017-06-08 15:36 ` Davidlohr Bueso
2017-05-30 2:09 ` [PATCH 2/5] sched/fair: Replace cfs_rq->rb_leftmost Davidlohr Bueso
2017-05-30 2:09 ` [PATCH 3/5] locking/rtmutex: Replace top-waiter and pi_waiters leftmost caching Davidlohr Bueso
2017-05-30 2:09 ` [PATCH 4/5] sched/deadline: Replace earliest deadline and runqueue " Davidlohr Bueso
2017-05-30 2:09 ` [PATCH 5/5] lib/interval_tree: Fast overlap detection Davidlohr Bueso
2017-05-30 4:54 ` kbuild test robot
2017-05-30 15:44 ` Davidlohr Bueso [this message]
2017-06-07 15:05 ` [rfc PATCH -next 0/5] rbtree: Cache leftmost node internally Davidlohr Bueso
2017-06-08 13:42 ` Peter Zijlstra
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=20170530154410.GA19563@linux-80c1.suse \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=dbueso@suse.de \
--cc=jack@suse.cz \
--cc=kbuild-all@01.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=ldufour@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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