From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Jean Delvare (PC drivers,
core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Steve Wise <swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>,
Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-ppp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Subject: Re: idr_get_new_exact ?
Date: Mon, 20 Sep 2010 13:35:42 -0700 [thread overview]
Message-ID: <adaiq20f90h.fsf@cisco.com> (raw)
In-Reply-To: <AANLkTi=ZLupVyFR0e2v-TLpeNWdw1bVMZUAhgyxLJ7OV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Ohad Ben-Cohen's message of "Mon, 20 Sep 2010 16:11:31 +0200")
> Occasionally, drivers care about the value that idr associates with
> their pointers.
>
> Today we have idr_get_new_above() which allocates a new idr entry
> above or equal to a given starting id, but sometimes drivers need to
> force an exact value.
>
> To overcome this small API gap, drivers are wrapping idr_get_new_above
> and then either BUG_ON() or just call idr_remove() and returns -EBUSY
> when idr allocates them an id which is different than their requested
> value.
Looks fine to me as an improvement over the status quo, but I wonder how
many of these places could use the radix_tree stuff instead? If you're
not using the ability of the idr code to assign an id for you, then it
seems the radix_tree API is a better fit.
- R.
WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier@cisco.com>
To: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Jean Delvare (PC drivers,
core)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Steve Wise <swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>,
Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-ppp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Subject: Re: idr_get_new_exact ?
Date: Mon, 20 Sep 2010 20:35:42 +0000 [thread overview]
Message-ID: <adaiq20f90h.fsf@cisco.com> (raw)
In-Reply-To: <AANLkTi=ZLupVyFR0e2v-TLpeNWdw1bVMZUAhgyxLJ7OV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Ohad Ben-Cohen's message of "Mon, 20 Sep 2010 16:11:31 +0200")
> Occasionally, drivers care about the value that idr associates with
> their pointers.
>
> Today we have idr_get_new_above() which allocates a new idr entry
> above or equal to a given starting id, but sometimes drivers need to
> force an exact value.
>
> To overcome this small API gap, drivers are wrapping idr_get_new_above
> and then either BUG_ON() or just call idr_remove() and returns -EBUSY
> when idr allocates them an id which is different than their requested
> value.
Looks fine to me as an improvement over the status quo, but I wonder how
many of these places could use the radix_tree stuff instead? If you're
not using the ability of the idr code to assign an id for you, then it
seems the radix_tree API is a better fit.
- R.
WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier@cisco.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-kernel@vger.kernel.org, "Jean Delvare \(PC drivers\,
core\)" <khali@linux-fr.org>,
"Ben Dooks \(embedded platforms\)" <ben-linux@fluff.org>,
Roland Dreier <rolandd@cisco.com>,
Sean Hefty <sean.hefty@intel.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
Steve Wise <swise@chelsio.com>, Neil Brown <neilb@suse.de>,
Paul Mackerras <paulus@samba.org>,
linux-i2c@vger.kernel.org, linux-rdma@vger.kernel.org,
dm-devel@redhat.com, linux-raid@vger.kernel.org,
linux-ppp@vger.kernel.org, netdev@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: idr_get_new_exact ?
Date: Mon, 20 Sep 2010 13:35:42 -0700 [thread overview]
Message-ID: <adaiq20f90h.fsf@cisco.com> (raw)
In-Reply-To: <AANLkTi=ZLupVyFR0e2v-TLpeNWdw1bVMZUAhgyxLJ7OV@mail.gmail.com> (Ohad Ben-Cohen's message of "Mon, 20 Sep 2010 16:11:31 +0200")
> Occasionally, drivers care about the value that idr associates with
> their pointers.
>
> Today we have idr_get_new_above() which allocates a new idr entry
> above or equal to a given starting id, but sometimes drivers need to
> force an exact value.
>
> To overcome this small API gap, drivers are wrapping idr_get_new_above
> and then either BUG_ON() or just call idr_remove() and returns -EBUSY
> when idr allocates them an id which is different than their requested
> value.
Looks fine to me as an improvement over the status quo, but I wonder how
many of these places could use the radix_tree stuff instead? If you're
not using the ability of the idr code to assign an id for you, then it
seems the radix_tree API is a better fit.
- R.
WARNING: multiple messages have this Message-ID (diff)
From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Jean Delvare \(PC drivers\,
core\)" <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
"Ben Dooks \(embedded platforms\)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Steve Wise <swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>,
Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-ppp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
Subject: Re: idr_get_new_exact ?
Date: Mon, 20 Sep 2010 13:35:42 -0700 [thread overview]
Message-ID: <adaiq20f90h.fsf@cisco.com> (raw)
In-Reply-To: <AANLkTi=ZLupVyFR0e2v-TLpeNWdw1bVMZUAhgyxLJ7OV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Ohad Ben-Cohen's message of "Mon, 20 Sep 2010 16:11:31 +0200")
> Occasionally, drivers care about the value that idr associates with
> their pointers.
>
> Today we have idr_get_new_above() which allocates a new idr entry
> above or equal to a given starting id, but sometimes drivers need to
> force an exact value.
>
> To overcome this small API gap, drivers are wrapping idr_get_new_above
> and then either BUG_ON() or just call idr_remove() and returns -EBUSY
> when idr allocates them an id which is different than their requested
> value.
Looks fine to me as an improvement over the status quo, but I wonder how
many of these places could use the radix_tree stuff instead? If you're
not using the ability of the idr code to assign an id for you, then it
seems the radix_tree API is a better fit.
- R.
next prev parent reply other threads:[~2010-09-20 20:35 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-20 14:11 idr_get_new_exact ? Ohad Ben-Cohen
2010-09-20 14:11 ` Ohad Ben-Cohen
[not found] ` <AANLkTi=ZLupVyFR0e2v-TLpeNWdw1bVMZUAhgyxLJ7OV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-20 19:31 ` Andrew Morton
2010-09-20 19:31 ` Andrew Morton
2010-09-20 19:31 ` Andrew Morton
[not found] ` <20100920123140.f524de79.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2010-09-20 20:07 ` Steve Wise
2010-09-20 20:07 ` Steve Wise
2010-09-20 20:07 ` Steve Wise
2010-09-20 20:35 ` Roland Dreier [this message]
2010-09-20 20:35 ` Roland Dreier
2010-09-20 20:35 ` Roland Dreier
2010-09-20 20:35 ` Roland Dreier
2010-09-20 21:26 ` Tejun Heo
2010-09-20 21:26 ` Tejun Heo
2010-09-20 21:26 ` Tejun Heo
2010-09-20 21:38 ` [dm-devel] " Alasdair G Kergon
[not found] ` <4C97D197.9070703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-09-20 21:38 ` Alasdair G Kergon
2010-09-20 21:38 ` Alasdair G Kergon
2010-09-23 11:42 ` Paul Mundt
2010-09-23 11:42 ` Paul Mundt
2010-09-23 11:42 ` Paul Mundt
2010-09-23 11:46 ` Tejun Heo
2010-09-23 11:46 ` Tejun Heo
2010-09-20 21:38 ` [dm-devel] " Alasdair G Kergon
2010-09-20 21:38 ` Alasdair G Kergon
2010-09-20 21:38 ` Alasdair G Kergon
2010-09-20 21:38 ` Alasdair G Kergon
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=adaiq20f90h.fsf@cisco.com \
--to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-ppp-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=neilb-l3A5Bk7waGM@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
--cc=paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.