From: Chris Wilson <chris@chris-wilson.co.uk>
To: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Rik van Riel <riel@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
intel-gfx@lists.freedesktop.org,
Akash Goel <akash.goel@intel.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] lib: Always build and export interval_tree
Date: Sun, 26 Jan 2014 11:27:59 +0000 [thread overview]
Message-ID: <20140126112759.GD23557@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <CANN689HFrS5XOpkBmTmTD=Q=sEoK654xP7gqDX=KJ=x4SmvPAQ@mail.gmail.com>
On Fri, Jan 24, 2014 at 08:42:18PM -0800, Michel Lespinasse wrote:
> Hi Chris,
>
> On Tue, Jan 21, 2014 at 7:07 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > lib/interval_tree.c provides a simple interface for an interval-tree
> > (an augmented red-black tree) but is only built when testing the generic
> > macros for building interval-trees. For drivers with modest needs,
> > export the simple interval-tree library as is.
>
> Thanks for suggesting this. I did plan for this use case, and thought
> it would show up earlier.
>
> My only concern is that I think we should keep the code under a config
> option (unless a use case shows up in core kernel). So I would
> suggest:
>
> in lib/Kconfig:
> config INTERVAL_TREE
> bool
+config INTERVAL_TREE
+ boolean
+ help
+ Simple, embeddable, interval-tree. Can find the start of an
+ overlapping range in log(n) time and then iterate over all
+ overlapping nodes. The algorithm is implemented as an
+ augmented rbtree.
+
+ See:
+
+ Documentation/rbtree.txt
+
+ for more information.
Though you probably have some better spiel. :)
> in lib/Kconfig.debug:
> make INTERVAL_TREE_TEST depend on m && DEBUG_KERNEL && INTERVAL_TREE
Done. Are you sure you do not just want to select INTERVAL_TREE here to
maintain the status quo?
> in lib/Makefile:
> obj-$(CONFIG_INTERVAL_TREE) += interval_tree.o
>
> You would probably also need to add #include <linux/module.h> in
> lib/interval_tree.c to plan for that code being configured as a
> module.
>
> Hope this helps,
Thanks!
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2014-01-26 11:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 15:07 [PATCH 1/3] lib: Always build and export interval_tree Chris Wilson
2014-01-21 15:07 ` [PATCH 2/3] drm/i915: Do not call retire_requests from wait_for_rendering Chris Wilson
2014-01-21 15:07 ` [PATCH 3/3] drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl Chris Wilson
2014-01-22 9:46 ` [PATCH] " Chris Wilson
2014-01-24 9:00 ` Chris Wilson
2014-01-27 17:56 ` Volkin, Bradley D
2014-01-27 18:09 ` Chris Wilson
2014-01-25 4:42 ` [PATCH 1/3] lib: Always build and export interval_tree Michel Lespinasse
2014-01-26 11:27 ` Chris Wilson [this message]
2014-01-26 11:58 ` Michel Lespinasse
2014-01-26 12:25 ` Chris Wilson
2014-01-26 12:24 ` [PATCH] lib: Export interval_tree Chris Wilson
2014-01-26 12:34 ` Michel Lespinasse
2014-01-26 13:54 ` Daniel Vetter
2014-01-26 14:03 ` [Intel-gfx] " Michel Lespinasse
2014-01-27 23:13 ` Andrew Morton
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=20140126112759.GD23557@nuc-i3427.alporthouse.com \
--to=chris@chris-wilson.co.uk \
--cc=a.p.zijlstra@chello.nl \
--cc=aarcange@redhat.com \
--cc=akash.goel@intel.com \
--cc=akpm@linux-foundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=riel@redhat.com \
--cc=walken@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